A backend for plotting SymPy’s symbolic expressions using Matplotlib.
Parameters:
aspect(float, float) or str, optional
Set the aspect ratio of a 2D plot. Possible values:
"auto": Matplotlib will fit the plot in the vibile area.
"equal": sets equal spacing.
tuple containing 2 float numbers, from which the aspect ratio is
computed. This only works for 2D plots.
axis_center(float, float) or str or None, optional
Set the location of the intersection between the horizontal and
vertical axis in a 2D plot. It can be:
None: traditional layout, with the horizontal axis fixed on the
bottom and the vertical axis fixed on the left. This is the default
value.
a tuple (x,y) specifying the exact intersection point.
'center': center of the current plot area.
'auto': the intersection point is automatically computed.
cameradict, optional
A dictionary of keyword arguments that will be passed to the
Axes3D.view_init method. Refer to [9] for more information.
rendering_kwdict, optional
A dictionary of keywords/values which is passed to Matplotlib’s plot
functions to customize the appearance of lines, surfaces, images,
contours, quivers, streamlines…
To learn more about customization:
Turns on/off the axis visibility (and associated tick labels).
Default to True (axis are visible).
update_eventbool, optional
If True, it binds pan/zoom events in order to automatically compute
new data as the user interact with the plot.
Default to False.
annotationslist, optional
A list of dictionaries specifying the type of annotation
required. The keys in the dictionary should be equivalent
to the arguments of the matplotlib.axes.Axes.annotate method.
This feature is experimental. It might get removed in the future.
markerslist, optional
A list of dictionaries specifying the type the markers required.
The keys in the dictionary should be equivalent to the arguments
of the matplotlib.pyplot.plot() function along with the marker
related keyworded arguments.
This feature is experimental. It might get removed in the future.
rectangleslist, optional
A list of dictionaries specifying the dimensions of the
rectangles to be plotted. The keys in the dictionary should be
equivalent to the arguments of the matplotlib.patches.Rectangle
class.
This feature is experimental. It might get removed in the future.
filldict, optional
A dictionary specifying the type of color filling required in
the plot. The keys in the dictionary should be equivalent to the
arguments of the matplotlib.axes.Axes.fill_between method.
This feature is experimental. It might get removed in the future.
Consider two Plot objects, p1 and p2. To add the
second plot’s first series object to the first, use the
append method, like so:
>>> fromsympyimportsymbols>>> fromspbimportplot>>> x=symbols('x')>>> p1=plot(x*x,show=False)>>> p2=plot(x,show=False)>>> p1.append(p2[0])>>> p1Plot object containing:[0]: cartesian line: x**2 for x over (-10.0, 10.0)[1]: cartesian line: x for x over (-10.0, 10.0)>>> p1.show()
Consider two Plot objects, p1 and p2. To add the
second plot to the first, use the extend method, like so:
>>> fromsympyimportsymbols>>> fromspbimportplot>>> x=symbols('x')>>> p1=plot(x**2,show=False)>>> p2=plot(x,-x,show=False)>>> p1.extend(p2)>>> p1Plot object containing:[0]: cartesian line: x**2 for x over (-10.0, 10.0)[1]: cartesian line: x for x over (-10.0, 10.0)[2]: cartesian line: -x for x over (-10.0, 10.0)>>> p1.show()