GraphicsBase

The base class for all things Graphics Defines the common parts of the interface with some calling into matplotlib

opt_keys: set
layout_keys: set
MPLManager: MPLManager
known_keys: set
axes_params: set
inset_options: dict
axes_keys: set

 

resolve_figure_graphics(fig): 

 

add_figure_graphics(fig, graphics): 

 

remove_figure_mapping(fig): 

 

get_child_graphics(fig): 

 

resolve_axes_graphics(axes): 

 

add_axes_graphics(axes, graphics): 

 

remove_axes_mapping(axes): 

 

get_axes_child_graphics(axes): 

 

get_raw_attr(self, key): 

 

__init__(self, *args, name=None, figure=None, tighten=False, axes=None, subplot_kw=None, parent=None, image_size=None, padding=None, aspect_ratio=None, interactive=None, reshowable=None, mpl_backend=None, theme=None, prop_manager=<class 'McUtils.Plots.Properties.GraphicsPropertyManager'>, theme_manager=<class 'McUtils.Plots.Styling.ThemeManager'>, managed=None, strict=True, **opts): 
  • args: Any
  • figure: matplotlib.figure.Figure | None
  • axes: matplotlib.axes.Axes | None
  • subplot_kw: dict | None
  • parent: GraphicsBase | None
  • opts: Any

 

@property
pyplot(self): 

 

@property
parent(self): 

 

@property
figure_parent(self): 

 

@property
inset(self): 

 

@property
children(self): 

 

@property
event_handlers(self): 

 

@property
animated(self): 

 

bind_events(self, *handlers, **events): 

 

create_animation(self, *args, **opts): 

 

set_options(self, event_handlers=None, animated=None, prolog=None, epilog=None, strict=True, **opts): 

Sets options for the plot

  • event_handlers: Any
  • animated: Any
  • opts: Any
  • :returns: _

 

@property
prolog(self): 

 

@property
epilog(self): 

 

copy_axes(self): 

Copies the axes object

  • :returns: matplotlib.axes.Axes

 

refresh(self): 

Refreshes the axes

  • :returns: _

 

@property
opts(self): 

 

copy(self, **kwargs): 

Creates a copy of the object with new axes and a new figure

  • :returns: _

 

change_figure(self, new, *init_args, figs=None, **init_kwargs): 

Creates a copy of the object with new axes and a new figure

  • :returns: _

 

prep_show(self): 

 

show(self, reshow=None): 

 

close(self, force=False): 

 

__del__(self): 

 

__repr__(self): 

 

clear(self): 

 

savefig(self, where, format=None, **kw): 

Saves the image to file

  • where: Any
  • format: Any
  • kw: Any
  • :returns: str

    f i l e

i t

w a s

s a v e d

t o

( I

t h i n k . . . ? )

 

to_png(self): 

Used by Jupyter and friends to make a version of the image that they can display, hence the extra ‘tight_layout’ call

  • :returns: _

 

add_colorbar(self, graphics=None, norm=None, cmap=None, size=(20, 200), tick_padding=40, **kw): 

 

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

Feedback

Examples

Templates

Documentation