Skip to content

Commit e55a915

Browse files
author
Release Manager
committed
Trac #32950: add pictures to ellipse.py docstring
Docstring lacks a PLOT section to illustrate the examples URL: https://trac.sagemath.org/32950 Reported by: jhonrubia6 Ticket author(s): Javier Honrubia González Reviewer(s): Eric Gourgoulhon
2 parents 8d0dd64 + dbc80f9 commit e55a915

File tree

1 file changed

+35
-1
lines changed

1 file changed

+35
-1
lines changed

src/sage/plot/ellipse.py

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,23 +272,51 @@ def ellipse(center, r1, r2, angle=0, **options):
272272
sage: ellipse((0,0),2,1)
273273
Graphics object consisting of 1 graphics primitive
274274
275+
.. PLOT::
276+
277+
E=ellipse((0,0),2,1)
278+
sphinx_plot(E)
279+
275280
More complicated examples with tilted axes and drawing options::
276281
277282
sage: ellipse((0,0),3,1,pi/6,fill=True,alpha=0.3,linestyle="dashed")
278283
Graphics object consisting of 1 graphics primitive
284+
285+
.. PLOT::
286+
287+
E = ellipse((0,0),3,1,pi/6,fill=True,alpha=0.3,linestyle="dashed")
288+
sphinx_plot(E)
289+
290+
other way to indicate dashed linestyle::
291+
279292
sage: ellipse((0,0),3,1,pi/6,fill=True,alpha=0.3,linestyle="--")
280293
Graphics object consisting of 1 graphics primitive
281294
282-
::
295+
.. PLOT::
296+
297+
E =ellipse((0,0),3,1,pi/6,fill=True,alpha=0.3,linestyle='--')
298+
sphinx_plot(E)
299+
300+
with colors ::
283301
284302
sage: ellipse((0,0),3,1,pi/6,fill=True,edgecolor='black',facecolor='red')
285303
Graphics object consisting of 1 graphics primitive
304+
305+
.. PLOT::
306+
307+
E=ellipse((0,0),3,1,pi/6,fill=True,edgecolor='black',facecolor='red')
308+
sphinx_plot(E)
286309
287310
We see that ``rgbcolor`` overrides these other options, as this plot
288311
is green::
289312
290313
sage: ellipse((0,0),3,1,pi/6,fill=True,edgecolor='black',facecolor='red',rgbcolor='green')
291314
Graphics object consisting of 1 graphics primitive
315+
316+
.. PLOT::
317+
318+
E=ellipse((0,0),3,1,pi/6,fill=True,edgecolor='black',facecolor='red',rgbcolor='green')
319+
sphinx_plot(E)
292320
293321
The default aspect ratio for ellipses is 1.0::
294322
@@ -306,6 +334,12 @@ def ellipse(center, r1, r2, angle=0, **options):
306334
307335
sage: ellipse((0,0),2,1,legend_label="My ellipse", legend_color='green')
308336
Graphics object consisting of 1 graphics primitive
337+
338+
.. PLOT::
339+
340+
E=ellipse((0,0),2,1,legend_label="My ellipse", legend_color='green')
341+
sphinx_plot(E)
342+
309343
"""
310344
from sage.plot.all import Graphics
311345
g = Graphics()

0 commit comments

Comments
 (0)