12
12
sage: pretty_print(1, 2, 3)
13
13
1 2 3
14
14
15
- sage: pretty_print(x^2 / (x + 1)) # optional - sage.symbolic
15
+ sage: pretty_print(x^2 / (x + 1)) # needs sage.symbolic
16
16
x^2/(x + 1)
17
17
18
18
TESTS::
23
23
EXAMPLES::
24
24
25
25
sage: %display ascii_art # not tested
26
- sage: pretty_print(x^2 / (x + 1)) # optional - sage.symbolic
26
+ sage: pretty_print(x^2 / (x + 1)) # needs sage.symbolic
27
27
2
28
28
x
29
29
-----
41
41
:func:`pretty_print` does not print anything and just shows the
42
42
graphics instead::
43
43
44
- sage: print(plot(sin)) # optional - sage.symbolic sage.plot
44
+ sage: print(plot(sin)) # needs sage.plot sage.symbolic
45
45
Graphics object consisting of 1 graphics primitive
46
- sage: pretty_print(plot(sin)) # optional - sage.symbolic sage.plot
46
+ sage: pretty_print(plot(sin)) # needs sage.plot sage.symbolic
47
47
"""
48
48
49
49
# ****************************************************************************
@@ -117,10 +117,10 @@ def _concatenate_graphs(self):
117
117
EXAMPLES::
118
118
119
119
sage: from sage.repl.rich_output.pretty_print import SequencePrettyPrinter
120
- sage: plt = SequencePrettyPrinter(*list(graphs(3)))._concatenate_graphs() # optional - sage.graphs sage.plot
121
- sage: type(plt) # optional - sage.graphs sage.plot
120
+ sage: plt = SequencePrettyPrinter(*list(graphs(3)))._concatenate_graphs() # needs sage.graphs sage.plot
121
+ sage: type(plt) # needs sage.graphs sage.plot
122
122
<class 'sage.plot.multigraphics.GraphicsArray'>
123
- sage: plt # optional - sage.graphs sage.plot
123
+ sage: plt # needs sage.graphs sage.plot
124
124
Graphics Array of size 1 x 4
125
125
"""
126
126
import sage .graphs .graph_list as graphs_list
@@ -137,10 +137,10 @@ def _concatenate_graphics(self):
137
137
EXAMPLES::
138
138
139
139
sage: from sage.repl.rich_output.pretty_print import SequencePrettyPrinter
140
- sage: ga = SequencePrettyPrinter(*[Graphics()]*5)._concatenate_graphics() # optional - sage.plot
141
- sage: type(ga) # optional - sage.plot
140
+ sage: ga = SequencePrettyPrinter(*[Graphics()]*5)._concatenate_graphics() # needs sage.plot
141
+ sage: type(ga) # needs sage.plot
142
142
<class 'sage.plot.multigraphics.GraphicsArray'>
143
- sage: ga.nrows(), ga.ncols() # optional - sage.plot
143
+ sage: ga.nrows(), ga.ncols() # needs sage.plot
144
144
(2, 4)
145
145
"""
146
146
from sage .plot .plot import graphics_array
@@ -159,9 +159,9 @@ def pretty_print(self):
159
159
The keyword arguments are only used the first time graphics
160
160
output is generated::
161
161
162
- sage: seq = SequencePrettyPrinter(Graph(), Graph(), edge_labels=True) # optional - sage.graphs sage.plot
163
- sage: seq.pretty_print() # does not pass edge_labels to graphics object # optional - sage.graphs sage.plot
164
- sage: seq._concatenate_graphs().show(edge_labels=True) # optional - sage.graphs sage.plot
162
+ sage: seq = SequencePrettyPrinter(Graph(), Graph(), edge_labels=True) # needs sage.graphs sage.plot
163
+ sage: seq.pretty_print() # does not pass edge_labels to graphics object # needs sage.graphs sage.plot
164
+ sage: seq._concatenate_graphs().show(edge_labels=True) # needs sage.graphs sage.plot
165
165
Traceback (most recent call last):
166
166
...
167
167
TypeError: ...matplotlib() got an unexpected keyword argument 'edge_labels'
@@ -243,13 +243,13 @@ def pretty_print(*args, **kwds):
243
243
For text-based backends, the default text display preference is to output
244
244
plain text which is usually the same as using ``print()``::
245
245
246
- sage: pretty_print(x^2 / (x + 1)) # optional - sage.symbolic
246
+ sage: pretty_print(x^2 / (x + 1)) # needs sage.symbolic
247
247
x^2/(x + 1)
248
248
249
- sage: t = BinaryTrees(3).first() # optional - sage.graphs
250
- sage: pretty_print(t) # optional - sage.graphs
249
+ sage: t = BinaryTrees(3).first() # needs sage.graphs
250
+ sage: pretty_print(t) # needs sage.graphs
251
251
[., [., [., .]]]
252
- sage: print(t) # optional - sage.graphs
252
+ sage: print(t) # needs sage.graphs
253
253
[., [., [., .]]]
254
254
255
255
TESTS::
@@ -263,7 +263,7 @@ def pretty_print(*args, **kwds):
263
263
The following illustrates a possible use-case::
264
264
265
265
sage: %display ascii_art # not tested
266
- sage: for t in BinaryTrees(3)[:3]: # optional - sage.graphs
266
+ sage: for t in BinaryTrees(3)[:3]: # needs sage.graphs
267
267
....: pretty_print(t)
268
268
o
269
269
\
@@ -279,7 +279,7 @@ def pretty_print(*args, **kwds):
279
279
/ \
280
280
o o
281
281
282
- sage: pretty_print(x^2 / (x + 1)) # optional - sage.symbolic
282
+ sage: pretty_print(x^2 / (x + 1)) # needs sage.symbolic
283
283
2
284
284
x
285
285
-----
@@ -293,10 +293,11 @@ def pretty_print(*args, **kwds):
293
293
294
294
::
295
295
296
- sage: plt = plot(sin) # optional - sage.symbolic # optional - sage.plot
297
- sage: pretty_print(plt) # graphics output # optional - sage.symbolic # optional - sage.plot
298
- sage: pretty_print(plt, plt) # graphics output # optional - sage.symbolic # optional - sage.plot
299
- sage: pretty_print(ZZ, 123, plt) # optional - sage.symbolic # optional - sage.plot
296
+ sage: # needs sage.plot sage.symbolic
297
+ sage: plt = plot(sin)
298
+ sage: pretty_print(plt) # graphics output
299
+ sage: pretty_print(plt, plt) # graphics output
300
+ sage: pretty_print(ZZ, 123, plt)
300
301
Integer Ring 123 Graphics object consisting of 1 graphics primitive
301
302
"""
302
303
dm = get_display_manager ()
0 commit comments