A backend for plotting SymPy’s symbolic expressions using Plotly.
Parameters:
aspectstr, optional
Set the aspect ratio of the plot. Default to "auto".
Possible values:
"equal": sets equal spacing on the axis of a 2D plot.
For 3D plots:
"cube": fix the ratio to be a cube
"data": draw axes in proportion to the proportion of their
ranges
"auto": automatically produce something that is well
proportioned using ‘data’ as the default.
manually set the aspect ratio by providing a dictionary.
For example: dict(x=1,y=1,z=2) forces the z-axis to appear
twice as big as the other two.
cameradict, optional
A dictionary of keyword arguments that will be passed to the layout’s
scene_camera in order to set the 3D camera orientation.
Refer to [16] 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).
themestr, optional
Set the theme. Default to "plotly_dark". Find more Plotly themes at
[10] .
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 the markers required.
The keys in the dictionary should be equivalent to the arguments
of the Plotly’s graph_objects.Scatter class. Refer to [13]
for more information.
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 Plotly’s graph_objects.Scatter class. Refer to [3]
for more information.
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 Plotly’s
graph_objects.Figure.add_shape function. Refer to [14]
for more information.
This feature is experimental. It might get removed in the future.
filldict, optional
A list of dictionaries specifying the type the markers required.
The keys in the dictionary should be equivalent to the arguments
of the Plotly’s graph_objects.Scatter class. Refer to [15]
for more information.
This feature is experimental. It might get removed in the future.
See also
Plot, MatplotlibBackend, BokehBackend, K3DBackend
Notes
A few bugs related to Plotly might prevent the correct visualization:
with 2D domain coloring, the vertical axis is reversed, with negative
values on the top and positive values on the bottom.
with 3D complex plots: when hovering a point, the tooltip will display
wrong information for the argument and the phase. Hopefully, this bug
[11] will be fixed upstream.
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()