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,                      # needs sage.plot
....:        hyperplane_legend=False)
Graphics3d Object

sage: c = H3([(1,0,0),0], [(0,0,1),5])
sage: c.plot(ranges=10)                                                             # needs sage.plot
Graphics3d Object
sage: c.plot(ranges=[[9.5,10], [-3,3]])                                             # needs sage.plot
Graphics3d Object
sage: c.plot(ranges=[[[9.5,10], [-3,3]], [[-6,6], [-5,5]]])                         # needs sage.plot
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)                                                             # needs sage.plot
Graphics object consisting of 3 graphics primitives
sage: h.plot(ranges=[-1, 10])                                                       # needs sage.plot
Graphics object consisting of 3 graphics primitives
sage: h.plot(ranges=[[-1, 1], [-5, 5], [-1, 10]])                                   # needs sage.plot
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)                                                                # needs sage.plot
Graphics3d Object
sage: opts['hyperplane_labels'] = 'short'
sage: a.plot(**opts)                                                                # needs sage.plot
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'])                         # needs sage.plot
Graphics object consisting of 3 graphics primitives
sage: pts.plot(point_sizes=[50,100,200], hyperplane_colors='blue')                  # needs sage.plot
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)        # needs sage.plot
Graphics3d Object
sage: a.plot(hyperplane_labels=True, label_colors=['red','green','black'])          # needs sage.plot
Graphics3d Object
>>> from sage.all import *
>>> H3 = HyperplaneArrangements(QQ, names=('x', 'y', 'z',)); (x, y, z,) = H3._first_ngens(3)
>>> A = H3([(Integer(1),Integer(0),Integer(0)), Integer(0)], [(Integer(0),Integer(0),Integer(1)), Integer(5)])
>>> A.plot(hyperplane_opacities=RealNumber('0.5'), hyperplane_labels=True,                      # needs sage.plot
...        hyperplane_legend=False)
Graphics3d Object

>>> c = H3([(Integer(1),Integer(0),Integer(0)),Integer(0)], [(Integer(0),Integer(0),Integer(1)),Integer(5)])
>>> c.plot(ranges=Integer(10))                                                             # needs sage.plot
Graphics3d Object
>>> c.plot(ranges=[[RealNumber('9.5'),Integer(10)], [-Integer(3),Integer(3)]])                                             # needs sage.plot
Graphics3d Object
>>> c.plot(ranges=[[[RealNumber('9.5'),Integer(10)], [-Integer(3),Integer(3)]], [[-Integer(6),Integer(6)], [-Integer(5),Integer(5)]]])                         # needs sage.plot
Graphics3d Object


>>> H2 = HyperplaneArrangements(QQ, names=('s', 't',)); (s, t,) = H2._first_ngens(2)
>>> h = H2([(Integer(1),Integer(1)),Integer(0)], [(Integer(1),-Integer(1)),Integer(0)], [(Integer(0),Integer(1)),Integer(2)])
>>> h.plot(ranges=Integer(20))                                                             # needs sage.plot
Graphics object consisting of 3 graphics primitives
>>> h.plot(ranges=[-Integer(1), Integer(10)])                                                       # needs sage.plot
Graphics object consisting of 3 graphics primitives
>>> h.plot(ranges=[[-Integer(1), Integer(1)], [-Integer(5), Integer(5)], [-Integer(1), Integer(10)]])                                   # needs sage.plot
Graphics object consisting of 3 graphics primitives

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

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

>>> H = HyperplaneArrangements(QQ, names=('x', 'y', 'z',)); (x, y, z,) = H._first_ngens(3)
>>> a = H(x, y+Integer(1), y+Integer(2))
>>> a.plot(hyperplane_labels=True, label_colors='blue', label_fontsize=Integer(18))        # needs sage.plot
Graphics3d Object
>>> a.plot(hyperplane_labels=True, label_colors=['red','green','black'])          # needs sage.plot
Graphics3d Object
sage.geometry.hyperplane_arrangement.plot.legend_3d(hyperplane_arrangement, hyperplane_colors, length)[source]

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')                    # needs sage.combinat sage.plot
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')                   # needs sage.combinat sage.plot
Graphics object consisting of 12 graphics primitives

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

sage: p = legend_3d(c, list(colors.values())[:12], length='short')              # needs sage.combinat sage.plot
sage: p.set_legend_options(ncol=4)                                              # needs sage.combinat sage.plot
sage: type(p)                                                                   # needs sage.combinat sage.plot
<class 'sage.plot.graphics.Graphics'>
>>> from sage.all import *
>>> a = hyperplane_arrangements.semiorder(Integer(3))
>>> from sage.geometry.hyperplane_arrangement.plot import legend_3d
>>> legend_3d(a, list(colors.values())[:Integer(6)], length='long')                    # needs sage.combinat sage.plot
Graphics object consisting of 6 graphics primitives

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

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

>>> p = legend_3d(c, list(colors.values())[:Integer(12)], length='short')              # needs sage.combinat sage.plot
>>> p.set_legend_options(ncol=Integer(4))                                              # needs sage.combinat sage.plot
>>> type(p)                                                                   # needs sage.combinat sage.plot
<class 'sage.plot.graphics.Graphics'>
sage.geometry.hyperplane_arrangement.plot.plot(hyperplane_arrangement, **kwds)[source]

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()                                                                  # needs sage.combinat sage.plot
Displaying the essentialization.
Graphics3d Object
>>> from sage.all import *
>>> B = hyperplane_arrangements.semiorder(Integer(4))
>>> B.plot()                                                                  # needs sage.combinat sage.plot
Displaying the essentialization.
Graphics3d Object
sage.geometry.hyperplane_arrangement.plot.plot_hyperplane(hyperplane, **kwds)[source]

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                                            # needs sage.plot
Graphics object consisting of 3 graphics primitives
sage: a.plot(point_size=100, hyperplane_label='hello')                          # needs sage.plot
Graphics object consisting of 3 graphics primitives

sage: H2.<x,y> = HyperplaneArrangements(QQ)
sage: b = 3*x + 4*y + 5
sage: b.plot()                                                                  # needs sage.plot
Graphics object consisting of 2 graphics primitives
sage: b.plot(ranges=(1,5), label_offset=(2,-1))                                 # needs sage.plot
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)                                                            # needs sage.plot
Graphics object consisting of 2 graphics primitives

sage: # needs sage.plot
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
>>> from sage.all import *
>>> H1 = HyperplaneArrangements(QQ, names=('x',)); (x,) = H1._first_ngens(1)
>>> a = Integer(3)*x + Integer(4)
>>> a.plot()    # indirect doctest                                            # needs sage.plot
Graphics object consisting of 3 graphics primitives
>>> a.plot(point_size=Integer(100), hyperplane_label='hello')                          # needs sage.plot
Graphics object consisting of 3 graphics primitives

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

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