Graphics
A mini wrapper to matplotlib.pyplot to create a unified interface I know how to work with
Properties and Methods
default_style: dict
set_options(self, axes_labels=None, plot_label=None, plot_range=None, plot_legend=None, frame=None, frame_style=None, ticks=None, scale=None, padding=None, spacings=None, ticks_style=None, image_size=None, aspect_ratio=None, background=None, colorbar=None, prolog=None, epilog=None, **parent_opts):
@property
plot_label(self):
@property
plot_legend(self):
@property
axes_labels(self):
@property
frame(self):
@property
frame_style(self):
@property
plot_range(self):
@property
ticks(self):
@property
ticks_style(self):
@property
scale(self):
@property
aspect_ratio(self):
@property
image_size(self):
@property
padding(self):
@property
padding_left(self):
@property
padding_right(self):
@property
padding_top(self):
@property
padding_bottom(self):
@property
spacings(self):
@property
background(self):
@property
colorbar(self):
Examples
The Graphics
object is a simple interface to the matplotlib.figure.Figure
class.
This is bound to the figure
attribute of the object.
from McUtils.Plots import *
g = Graphics()
type(g.figure)
# Out: matplotlib.figure.Figure
Each Graphics
object also binds an matplotlib.axes.Axes object.
Because of this, the framework is set up so that multiple Graphics
objects can
use the same underlying figure
:
g = Graphics()
f = Graphics(figure=g)
g.figure is f.figure
# Out: True
Usually one won’t use Graphics
on its own, but will instead use on of the
other plotting functions, such as Plot
or ContourPlot
to create a
Graphics
object.
Edit Examples or
Create New Examples
Edit Template or
Create New Template
Edit Docstrings