Skip to content

Commit 9f6c58c

Browse files
author
Matthias Koeppe
committed
Update # optional / # needs
1 parent ba4c9e4 commit 9f6c58c

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

src/sage/plot/matrix_plot.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,8 @@ def _allowed_options(self):
132132
133133
EXAMPLES::
134134
135-
sage: M = matrix_plot([[sin(i*j) for i in range(5)] for j in range(5)]) # optional - sage.symbolic
136-
sage: isinstance(M[0]._allowed_options(), dict) # optional - sage.symbolic
135+
sage: M = matrix_plot([[sin(i*j) for i in range(5)] for j in range(5)]) # needs sage.symbolic
136+
sage: isinstance(M[0]._allowed_options(), dict) # needs sage.symbolic
137137
True
138138
"""
139139
return {'cmap':"""the name of a predefined colormap,
@@ -158,8 +158,8 @@ def _repr_(self):
158158
159159
EXAMPLES::
160160
161-
sage: M = matrix_plot([[sin(i*j) for i in range(5)] for j in range(5)]) # optional - sage.symbolic
162-
sage: m = M[0]; m # optional - sage.symbolic
161+
sage: M = matrix_plot([[sin(i*j) for i in range(5)] for j in range(5)]) # needs sage.symbolic
162+
sage: m = M[0]; m # needs sage.symbolic
163163
MatrixPlot defined by a 5 x 5 data grid
164164
"""
165165
return "MatrixPlot defined by a %s x %s data grid"%(self.xy_array_row, self.xy_array_col)
@@ -412,9 +412,9 @@ def matrix_plot(mat, xrange=None, yrange=None, **options):
412412
A custom bounding box in which to draw the matrix can be specified using
413413
the ``xrange`` and ``yrange`` arguments::
414414
415-
sage: P = matrix_plot(identity_matrix(10), xrange=(0, pi), yrange=(-pi, 0)); P # optional - sage.symbolic
415+
sage: P = matrix_plot(identity_matrix(10), xrange=(0, pi), yrange=(-pi, 0)); P # needs sage.symbolic
416416
Graphics object consisting of 1 graphics primitive
417-
sage: P.get_minmax_data() # optional - sage.symbolic
417+
sage: P.get_minmax_data() # needs sage.symbolic
418418
{'xmax': 3.14159..., 'xmin': 0.0, 'ymax': 0.0, 'ymin': -3.14159...}
419419
420420
If the horizontal and vertical dimension of the image are very different,
@@ -427,13 +427,13 @@ def matrix_plot(mat, xrange=None, yrange=None, **options):
427427
428428
Another random plot, but over `\GF{389}`::
429429
430-
sage: m = random_matrix(GF(389), 10) # optional - sage.rings.finite_rings
431-
sage: matrix_plot(m, cmap='Oranges') # optional - sage.rings.finite_rings
430+
sage: m = random_matrix(GF(389), 10) # needs sage.rings.finite_rings
431+
sage: matrix_plot(m, cmap='Oranges') # needs sage.rings.finite_rings
432432
Graphics object consisting of 1 graphics primitive
433433
434434
It also works if you lift it to the polynomial ring::
435435
436-
sage: matrix_plot(m.change_ring(GF(389)['x']), cmap='Oranges') # optional - sage.rings.finite_rings
436+
sage: matrix_plot(m.change_ring(GF(389)['x']), cmap='Oranges') # needs sage.rings.finite_rings
437437
Graphics object consisting of 1 graphics primitive
438438
439439
We have several options for colorbars::
@@ -474,8 +474,8 @@ def matrix_plot(mat, xrange=None, yrange=None, **options):
474474
converted to floating point numbers before plotting. Thus the
475475
following works::
476476
477-
sage: b = random_matrix(GF(2), 200, sparse=True, density=0.01) # optional - sage.rings.finite_rings
478-
sage: matrix_plot(b)
477+
sage: b = random_matrix(GF(2), 200, sparse=True, density=0.01) # needs sage.rings.finite_rings
478+
sage: matrix_plot(b) # needs sage.rings.finite_rings
479479
Graphics object consisting of 1 graphics primitive
480480
481481
While this returns an error::
@@ -500,8 +500,8 @@ def matrix_plot(mat, xrange=None, yrange=None, **options):
500500
501501
As does plotting of NumPy arrays::
502502
503-
sage: import numpy # optional - numpy
504-
sage: matrix_plot(numpy.random.rand(10, 10)) # optional - numpy
503+
sage: import numpy # needs numpy
504+
sage: matrix_plot(numpy.random.rand(10, 10)) # needs numpy
505505
Graphics object consisting of 1 graphics primitive
506506
507507
A plot title can be added to the matrix plot.::

0 commit comments

Comments
 (0)