@@ -132,8 +132,8 @@ def _allowed_options(self):
132
132
133
133
EXAMPLES::
134
134
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
137
137
True
138
138
"""
139
139
return {'cmap' :"""the name of a predefined colormap,
@@ -158,8 +158,8 @@ def _repr_(self):
158
158
159
159
EXAMPLES::
160
160
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
163
163
MatrixPlot defined by a 5 x 5 data grid
164
164
"""
165
165
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):
412
412
A custom bounding box in which to draw the matrix can be specified using
413
413
the ``xrange`` and ``yrange`` arguments::
414
414
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
416
416
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
418
418
{'xmax': 3.14159..., 'xmin': 0.0, 'ymax': 0.0, 'ymin': -3.14159...}
419
419
420
420
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):
427
427
428
428
Another random plot, but over `\GF{389}`::
429
429
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
432
432
Graphics object consisting of 1 graphics primitive
433
433
434
434
It also works if you lift it to the polynomial ring::
435
435
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
437
437
Graphics object consisting of 1 graphics primitive
438
438
439
439
We have several options for colorbars::
@@ -474,8 +474,8 @@ def matrix_plot(mat, xrange=None, yrange=None, **options):
474
474
converted to floating point numbers before plotting. Thus the
475
475
following works::
476
476
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
479
479
Graphics object consisting of 1 graphics primitive
480
480
481
481
While this returns an error::
@@ -500,8 +500,8 @@ def matrix_plot(mat, xrange=None, yrange=None, **options):
500
500
501
501
As does plotting of NumPy arrays::
502
502
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
505
505
Graphics object consisting of 1 graphics primitive
506
506
507
507
A plot title can be added to the matrix plot.::
0 commit comments