paramonte.vis.Target
¶
Module Contents¶
Classes¶
|
This is the Target class for generating instances |
-
paramonte.vis.Target.
newline
¶
-
class
paramonte.vis.Target.
Target
(values: tp.Optional[tp.Union[tp.List[int], tp.List[float]]] = [0, 0], axes=None)[source]¶ This is the Target class for generating instances of a target on the current active figure and axis.
Usage
First generate an object of this class by optionally passing the following parameters described below. Then call the
make()
method. The generated object is also callable with the same input parameters as the object’s constructor.Parameters
values (optional)
A pair (list, array, or tuple) of floats, representing the (x,y) coordinates of the target.
axes
The axes object to which the target must be added. The default is
None
in which case the output of the matplotlib’sgca()
function will be used to get the current active axes.Attributes
All of the parameters described above, except
axes
.The input axes object (whether user-provided or automatically fetched) will be stored as a component of the object’s attribute
currentFig
.axvline (optional)
A structure with two components:
enabled
A logical value, indicating whether an
axvline
will be added to the plot or not. If set toFalse
no vertical target line will be added.kws
A structure whose components will be passed to the matplotlib’s
axvline()
function. For example:1 2 3 4 5
axvline.kws.linewidth = 0.5 axvline.kws.color = "orangered" axvline.kws.linestyle = ":" axvline.kws.ymin = 0.1 axvline.kws.ymax = 1.9
NOTE
If a desired property is missing in the structure, simply add the property and its value to the structure.
axhline (optional)
A structure with two components:
enabled
A logical value, indicating whether an
axhline
will be added to the plot or not. If set toFalse
no horizontal target line will be added.kws
A structure whose components will be passed to the matplotlib’s
axhline()
function. For example:1 2 3 4 5
axhline.kws.linewidth = 0.5 axhline.kws.color = "orangered" axhline.kws.linestyle = ":" axhline.kws.xmin = 0.1 axhline.kws.xmax = 1.9
NOTE
If a desired property is missing in the structure, simply add the property and its value to the structure.
scatter (optional)
A structure with two components:
enabled
A logical value, indicating whether an
scatter
will be added to the plot or not. If set toFalse
no target scatter circle will be added.kws
A structure whose components will be passed to the matplotlib’s
scatter()
function. For example:scatter.kws.s = 20 scatter.kws.color = "orangered"
NOTE: If a desired property is missing in the NOTE: structure, simply add the property and NOTE: its value to the structure.
currentFig
An structure which is initially
None
, but upon making a plot, is populated with attributes representing all outputs from matplotlib function calls, with the following attributes:axes
The output of matplotlib’s
gca()
function or, the input axes object by the user.axhline
The output of matplotlib’s
axhline()
function.axvline
The output of matplotlib’s
axvline()
function.scatter
The output of matplotlib’s
scatter()
function.Returns
self
An object of class
Target
.-
__call__
(self, reself: tp.Optional[bool] = False, **kwargs)[source]¶ Call the
make()
method of the current instance of the class.Parameters
Any arguments that can be passed to the
make()
method of the target object.Returns
Any return value from the
make()
method of the target object.
-
make
(self, reself: tp.Optional[bool] = False, **kwargs)[source]¶ Add a target on an existing plot (the current active axes object) based on the
values
attribute of the target object.Parameters
reself
A logical variable. If
True
, an instance of the object will be returned upon exit to the calling routine. The default value isFalse
.Returns
the object self if
reself = True
otherwise,None
. However, this method causes side-effects by manipulating the existing attributes of the object.
-