5 Nonrenderers

▼ |  | Plot: Graph Plotting

1 | Introduction
2 | 2D and 3D Plotting Procedures
3 | 2D Renderers
4 | 3D Renderers
5 | Nonrenderers
6 | Axis Transforms and Ticks
7 | Plot Utilities
8 | Plot and Renderer Parameters
9 | Plot Contracts
10 | Porting From Plot <= 5.1.3
11 | Legacy Typed Interface
12 | Compatibility Module

On this page:

x-ticks
y-ticks
z-ticks
invisible-rect
invisible-rect3d

8.16
top contents ← prev up next →

### 5`` Nonrenderers🔗ℹ

(require plot) | package: plot-gui-lib

The following functions create nonrenderers, or plot elements that draw nothing in the plot.

> procedure (x-ticks ts [#:far? far?]) → nonrenderer?
> ts : (listof tick?)
> far? : boolean? = #f
> procedure (y-ticks ts [#:far? far?]) → nonrenderer?
> ts : (listof tick?)
> far? : boolean? = #f
> procedure (z-ticks ts [#:far? far?]) → nonrenderer?
> ts : (listof tick?)
> far? : boolean? = #f

The x-ticks, y-ticks and z-ticks return a nonrenderer that adds custom ticks to a 2D or 3D plot.

Although ticks-add allows placing arbitrary major and minor ticks on an axis, it does not allow them to be formatted differently from the other ticks on the same axis. Use one of these functions to get maximum control.

Example:

> > (parameterize ([plot-x-ticks no-ticks])
> (plot (list (function sin (- pi) pi)
> (x-ticks (list (tick (- pi) #t "-π")
> (tick (* -3/4 pi) #f "")
> (tick (* -1/2 pi) #t "-π/2")
> (tick (* -1/4 pi) #f "")
> (tick 0 #t "0")
> (tick (* 1/4 pi) #f "")
> (tick (* 1/2 pi) #t "π/2")
> (tick (* 3/4 pi) #f "")
> (tick pi #t "π")))
> (axes))))

When considering using one of these functions, remember that minor tick labels are never drawn, and that including a z-ticks nonrenderer will not add extra contour lines to contour plots.

> procedure (invisible-rect x-min x-max y-min y-max) → nonrenderer?
> x-min : (or/c rational? #f)
> x-max : (or/c rational? #f)
> y-min : (or/c rational? #f)
> y-max : (or/c rational? #f)

Returns a nonrenderer that simply takes up space in the plot. Use this to cause the plot area to include a minimal rectangle.

Example:

> > (plot (list (function sin (- pi) pi)
> (invisible-rect #f #f -2 2)))

> > procedure
> > (invisible-rect3d |  | x-min |  |  |  |
> > |  | x-max |  |  |  |
> > |  | y-min |  |  |  |
> > |  | y-max |  |  |  |
> > |  | z-min |  |  |  |
> > |  | z-max) |  | → |  | nonrenderer?
> x-min : (or/c rational? #f)
> x-max : (or/c rational? #f)
> y-min : (or/c rational? #f)
> y-max : (or/c rational? #f)
> z-min : (or/c rational? #f)
> z-max : (or/c rational? #f)

Returns a nonrenderer that simply takes up space in the plot. Use this to cause the plot area to include a minimal rectangle. See invisible-rect for a 2D example.
top contents ← prev up next →