Graphics

A mini wrapper to matplotlib.pyplot to create a unified interface I know how to work with

default_style: dict
axes_keys: set
figure_keys: set
layout_keys: set
known_keys: set
inset_options: dict

 

set_options(self, axes_labels=None, plot_label=None, plot_range=None, plot_legend=None, legend_style=None, frame=None, frame_style=None, ticks=None, scale=None, padding=None, spacings=None, ticks_style=None, ticks_label_style=None, image_size=None, axes_bbox=None, aspect_ratio=None, background=None, colorbar=None, prolog=None, epilog=None, **parent_opts): 

 

@property
artists(self): 

 

@property
plot_label(self): 

 

@property
plot_legend(self): 

 

@property
legend_style(self): 

 

@property
axes_labels(self): 

 

@property
frame(self): 

 

@property
frame_style(self): 

 

@property
plot_range(self): 

 

@property
ticks(self): 

 

@property
ticks_style(self): 

 

@property
ticks_label_style(self): 

 

@property
scale(self): 

 

@property
axes_bbox(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): 

 

prep_show(self): 

 

get_padding_offsets(self): 

 

get_bbox(self): 

 

create_inset(self, bbox, coordinates='absolute', graphics_class=None, **opts): 

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.


Feedback

Examples

Templates

Documentation