Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
Trac #20207: Add pictures to complex_plot.py
Browse files Browse the repository at this point in the history
URL: http://trac.sagemath.org/20207
Reported by: jhonrubia6
Ticket author(s): Javier Honrubia González
Reviewer(s): Travis Scrimshaw
  • Loading branch information
Release Manager authored and vbraun committed Mar 23, 2016
2 parents 5de5bf2 + fd82f83 commit 09a5a39
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions src/sage/plot/complex_plot.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -275,37 +275,66 @@ def complex_plot(f, xrange, yrange, **options):
sage: complex_plot(sqrt(x), (-5, 5), (-5, 5))
Graphics object consisting of 1 graphics primitive
.. PLOT::
sphinx_plot(complex_plot(sqrt(x), (-5, 5), (-5, 5)))
::
sage: complex_plot(sin(x), (-5, 5), (-5, 5))
Graphics object consisting of 1 graphics primitive
.. PLOT::
sphinx_plot(complex_plot(sin(x), (-5, 5), (-5, 5)))
::
sage: complex_plot(log(x), (-10, 10), (-10, 10))
Graphics object consisting of 1 graphics primitive
.. PLOT::
sphinx_plot(complex_plot(log(x), (-10, 10), (-10, 10)))
::
sage: complex_plot(exp(x), (-10, 10), (-10, 10))
Graphics object consisting of 1 graphics primitive
.. PLOT::
sphinx_plot(complex_plot(exp(x), (-10, 10), (-10, 10)))
A function with some nice zeros and a pole::
sage: f(z) = z^5 + z - 1 + 1/z
sage: complex_plot(f, (-3, 3), (-3, 3))
Graphics object consisting of 1 graphics primitive
.. PLOT::
def f(z): return z**5 + z - 1 + 1/z
sphinx_plot(complex_plot(f, (-3, 3), (-3, 3)))
Here is the identity, useful for seeing what values map to what colors::
sage: complex_plot(lambda z: z, (-3, 3), (-3, 3))
Graphics object consisting of 1 graphics primitive
.. PLOT::
sphinx_plot(complex_plot(lambda z: z, (-3, 3), (-3, 3)))
The Riemann Zeta function::
sage: complex_plot(zeta, (-30,30), (-30,30))
Graphics object consisting of 1 graphics primitive
.. PLOT::
sphinx_plot(complex_plot(zeta, (-30,30), (-30,30)))
Extra options will get passed on to show(), as long as they are valid::
sage: complex_plot(lambda z: z, (-3, 3), (-3, 3), figsize=[1,1])
Expand Down

0 comments on commit 09a5a39

Please sign in to comment.