# Plotting of Hyperplane Arrangements¶

PLOT OPTIONS:

Beside the usual plot options (enter plot?), the plot command for hyperplane arrangements includes the following:

• hyperplane_colors – Color or list of colors, one for each hyperplane (default: equally spread range of hues).

• hyperplane_labels – Boolean, 'short', 'long' (default: False). If False, no labels are shown; if ‘short’ or ‘long’, the hyperplanes are given short or long labels, respectively. If True, the hyperplanes are given long labels.

• label_colors – Color or list of colors, one for each hyperplane (default: black).

• label_fontsize – Size for hyperplane_label font (default: 14). This does not work for 3d plots.

• label_offsets – Amount be which labels are offset from h.point() for each hyperplane h. The format is different for each dimension: if the hyperplanes have dimension 0, the offset can be a single number or a list of numbers, one for each hyperplane; if the hyperplanes have dimension 1, the offset can be a single 2-tuple, or a list of 2-tuples, one for each hyperplane; if the hyperplanes have dimension 2, the offset can be a single 3-tuple or a list of 3-tuples, one for each hyperplane. (Defaults: 0-dim: 0.1, 1-dim: (0,1), 2-dim: (0,0,0.2)).

• hyperplane_legend – Boolean, 'short', 'long' (default: 'long'; in 3-d: False). If False, no legend is shown; if True, 'short', or 'long', the legend is shown with the default, long, or short labeling, respectively. (For arrangements of lines or planes, only.)

• hyperplane_opacities – A number or list of numbers, one for each hyperplane, between 0 and 1. Only applies to 3d plots.

• point_sizes – Number or list of numbers, one for each hyperplane giving the sizes of points in a zero-dimensional arrangement (default: 50).

• ranges – Range for the parameters or a list of ranges of parameters, one for each hyperplane, for the parametric plots of the hyperplanes. If a single positive number $$r$$ is given for ranges, then all parameters run from -r to r. Otherwise, for a line in the plane, the range has the form [a,b] (default: [-3,3]), and for a plane in 3-space, the range has the form [[a,b],[c,d]] (default: [[-3,3],[-3,3]]). The ranges are centered around hyperplane_arrangement.point().

EXAMPLES:

sage: H3.<x,y,z> = HyperplaneArrangements(QQ)
sage: A = H3([(1,0,0), 0], [(0,0,1), 5])
sage: A.plot(hyperplane_opacities=0.5, hyperplane_labels=True, hyperplane_legend=False)
Graphics3d Object

sage: c = H3([(1,0,0),0], [(0,0,1),5])
sage: c.plot(ranges=10)
Graphics3d Object
sage: c.plot(ranges=[[9.5,10], [-3,3]])
Graphics3d Object
sage: c.plot(ranges=[[[9.5,10], [-3,3]], [[-6,6], [-5,5]]])
Graphics3d Object

sage: H2.<s,t> = HyperplaneArrangements(QQ)
sage: h = H2([(1,1),0], [(1,-1),0], [(0,1),2])
sage: h.plot(ranges=20)
Graphics object consisting of 3 graphics primitives
sage: h.plot(ranges=[-1, 10])
Graphics object consisting of 3 graphics primitives
sage: h.plot(ranges=[[-1, 1], [-5, 5], [-1, 10]])
Graphics object consisting of 3 graphics primitives

sage: a = hyperplane_arrangements.coordinate(3)
sage: opts = {'hyperplane_colors':['yellow', 'green', 'blue']}
sage: opts['hyperplane_labels'] = True
sage: opts['label_offsets'] = [(0,2,2), (2,0,2), (2,2,0)]
sage: opts['hyperplane_legend'] = False
sage: opts['hyperplane_opacities'] = 0.7
sage: a.plot(**opts)
Graphics3d Object
sage: opts['hyperplane_labels'] = 'short'
sage: a.plot(**opts)
Graphics3d Object

sage: H.<u> = HyperplaneArrangements(QQ)
sage: pts = H(3*u+4, 2*u+5, 7*u+1)
sage: pts.plot(hyperplane_colors=['yellow','black','blue'])
Graphics object consisting of 3 graphics primitives
sage: pts.plot(point_sizes=[50,100,200], hyperplane_colors='blue')
Graphics object consisting of 3 graphics primitives

sage: H.<x,y,z> = HyperplaneArrangements(QQ)
sage: a = H(x, y+1, y+2)
sage: a.plot(hyperplane_labels=True,label_colors='blue',label_fontsize=18)
Graphics3d Object
sage: a.plot(hyperplane_labels=True,label_colors=['red','green','black'])
Graphics3d Object

sage.geometry.hyperplane_arrangement.plot.legend_3d(hyperplane_arrangement, hyperplane_colors, length)

Create plot of a 3d legend for an arrangement of planes in 3-space. The length parameter determines whether short or long labels are used in the legend.

INPUT:

• hyperplane_arrangement – a hyperplane arrangement

• hyperplane_colors – list of colors

• length – either 'short' or 'long'

OUTPUT:

• A graphics object.

EXAMPLES:

sage: a = hyperplane_arrangements.semiorder(3)
sage: from sage.geometry.hyperplane_arrangement.plot import legend_3d
sage: legend_3d(a, list(colors.values())[:6],length='long')
Graphics object consisting of 6 graphics primitives

sage: b = hyperplane_arrangements.semiorder(4)
sage: c = b.essentialization()
sage: legend_3d(c, list(colors.values())[:12], length='long')
Graphics object consisting of 12 graphics primitives

sage: legend_3d(c, list(colors.values())[:12], length='short')
Graphics object consisting of 12 graphics primitives

sage: p = legend_3d(c, list(colors.values())[:12], length='short')
sage: p.set_legend_options(ncol=4)
sage: type(p)
<class 'sage.plot.graphics.Graphics'>

sage.geometry.hyperplane_arrangement.plot.plot(hyperplane_arrangement, **kwds)

Return a plot of the hyperplane arrangement.

If the arrangement is in 4 dimensions but inessential, a plot of the essentialization is returned.

Note

This function is available as the plot() method of hyperplane arrangements. You should not call this function directly, only through the method.

INPUT:

OUTPUT:

A graphics object of the plot.

EXAMPLES:

sage: B = hyperplane_arrangements.semiorder(4)
sage: B.plot()
Displaying the essentialization.
Graphics3d Object

sage.geometry.hyperplane_arrangement.plot.plot_hyperplane(hyperplane, **kwds)

Return the plot of a single hyperplane.

INPUT:

• **kwds – plot options: see below

OUTPUT:

A graphics object of the plot.

Plot Options

Beside the usual plot options (enter plot?), the plot command for hyperplanes includes the following:

• hyperplane_label – Boolean value or string (default: True). If True, the hyperplane is labeled with its equation, if a string, it is labeled by that string, otherwise it is not labeled.

• label_color – (Default: 'black') Color for hyperplane_label.

• label_fontsize – Size for hyperplane_label font (default: 14) (does not work in 3d, yet).

• label_offset – (Default: 0-dim: 0.1, 1-dim: (0,1), 2-dim: (0,0,0.2)) Amount by which label is offset from hyperplane.point().

• point_size – (Default: 50) Size of points in a zero-dimensional arrangement or of an arrangement over a finite field.

• ranges – Range for the parameters for the parametric plot of the hyperplane. If a single positive number r is given for the value of ranges, then the ranges for all parameters are set to $$[-r, r]$$. Otherwise, for a line in the plane, ranges has the form [a, b] (default: [-3,3]), and for a plane in 3-space, the ranges has the form [[a, b], [c, d]] (default: [[-3,3],[-3,3]]). (The ranges are centered around hyperplane.point().)

EXAMPLES:

sage: H1.<x> = HyperplaneArrangements(QQ)
sage: a = 3*x + 4
sage: a.plot()    # indirect doctest
Graphics object consisting of 3 graphics primitives
sage: a.plot(point_size=100,hyperplane_label='hello')
Graphics object consisting of 3 graphics primitives

sage: H2.<x,y> = HyperplaneArrangements(QQ)
sage: b = 3*x + 4*y + 5
sage: b.plot()
Graphics object consisting of 2 graphics primitives
sage: b.plot(ranges=(1,5),label_offset=(2,-1))
Graphics object consisting of 2 graphics primitives
sage: opts = {'hyperplane_label':True, 'label_color':'green',
....:         'label_fontsize':24, 'label_offset':(0,1.5)}
sage: b.plot(**opts)
Graphics object consisting of 2 graphics primitives

sage: H3.<x,y,z> = HyperplaneArrangements(QQ)
sage: c = 2*x + 3*y + 4*z + 5
sage: c.plot()
Graphics3d Object
sage: c.plot(label_offset=(1,0,1), color='green', label_color='red', frame=False)
Graphics3d Object
sage: d = -3*x + 2*y + 2*z + 3
sage: d.plot(opacity=0.8)
Graphics3d Object
sage: e = 4*x + 2*z + 3
sage: e.plot(ranges=[[-1,1],[0,8]], label_offset=(2,2,1), aspect_ratio=1)
Graphics3d Object