- spacepy.plot.utils.set_target(target, figsize=None, loc=None, polar=False)¶
Given a target on which to plot a figure, determine if that target is None or a matplotlib figure or axes object. Based on the type of target, a figure and/or axes will be either located or generated. Both the figure and axes objects are returned to the caller for further manipulation. This is used in nearly all add_plot-type methods.
The object on which plotting will happen.
A matplotlib figure object on which to plot.
A matplotlib subplot object on which to plot.
- Other Parameters
A two-item tuple/list giving the dimensions of the figure, in inches. Defaults to Matplotlib defaults.
The subplot triple that specifies the location of the axes object. Defaults to matplotlib default (111).
Set the axes object to polar coodinates. Defaults to False.
>>> import matplotlib.pyplot as plt >>> from spacepy.pybats import set_target >>> fig = plt.figure() >>> fig, ax = set_target(target=fig, loc=211)