paramonte.vis.LineScatterPlot
¶
Module Contents¶
Classes¶
|
This is the LineScatterPlot class for generating instances |
-
paramonte.vis.LineScatterPlot.
newline
¶
-
class
paramonte.vis.LineScatterPlot.
LineScatterPlot
(plotType, dataFrame=None, methodName='ParaMonte', reportEnabled=True, resetPlot=None)[source]¶ Bases:
paramonte.vis._BasePlot.BasePlot
This is the LineScatterPlot class for generating instances of line or scatter plots or the combination of the two in two or three dimensions based on the visualization tools of the
matplotlib
andseaborn
Python libraries.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
plotType
A string indicating the name of the plot to be constructed.
dataFrame (optional)
A pandas dataFrame whose data will be plotted.
methodName (optional)
The name of the ParaMonte sample requesting the BasePlot.
reportEnabled (optional)
A boolean whose value indicates whether guidelines should be printed in the standard output.
resetPlot (optional)
A function that resets the properties of the plot as desired from outside. If provided, a pointer to this function will be saved for future internal usage.
Attributes
xcolumns
An attribute that determines the columns of dataFrame to be visualized as the X-axis. It can have three forms:
A list of column indices in dataFrame.
A list of column names in dataFrame.columns.
A
range(start,stop,step)
of column indices.
Examples:
xcolumns = [0,1,4,3]
xcolumns = ["SampleLogFunc","SampleVariable1"]
xcolumns = range(17,7,-2)
The default behavior includes all columns of the dataFrame.
ycolumns
An attribute that determines the columns of dataFrame to be visualized as the Y-axis. It can have three forms:
A list of column indices in dataFrame.
A list of column names in dataFrame.columns.
A
range(start,stop,step)
of column indices.
Examples:
ycolumns = [0,1,4,3]
ycolumns = ["SampleLogFunc","SampleVariable1"]
ycolumns = range(17,7,-2)
The default behavior includes all columns of the dataFrame.
zcolumns (exists only in 3D plot objects)
An attribute that determines the columns of dataFrame to be visualized as the Z-axis. It can have three forms:
A list of column indices in dataFrame.
A list of column names in dataFrame.columns.
A
range(start,stop,step)
of column indices.
Examples:
zcolumns = [0,1,4,3]
zcolumns = ["SampleLogFunc","SampleVariable1"]
zcolumns = range(17,7,-2)
The default behavior includes all columns of the dataFrame.
ccolumns
An attribute that determines the columns of dataFrame to be used for color mapping. It can have three forms:
A list of column indices in dataFrame.
A list of column names in dataFrame.columns.
A
range(start,stop,step)
of column indices.
Examples:
ccolumns = [0,1,4,3]
ccolumns = ["SampleLogFunc","SampleVariable1"]
ccolumns = range(17,7,-2)
If
ccolumns
is set toNone
, then no color-mapping will be made. If it is set to an empty list[]
, then the values from therows
attribute will be used for color-mapping.rows
An attribute that determines the rows of dataFrame to be visualized. It can be either:
A
range(start,stop,step)
, or,A list of row indices in dataFrame.index.
Examples:
rows = range(17,7,-2)
rows = [i for i in range(7,17)]
The default behavior includes all rows of the dataFrame.
plot (exists only for line or lineScatter plots in 2D and 3D)
A structure with two attributes:
enabled
A boolean indicating whether a call to the
plot()
function of the matplotlib library should be made or not.kws
A structure whose components are directly passed as keyword arguments to the
plot()
function.Example usage:
plot.enabled = True plot.kws.linewidth = 1
NOTE
If a desired property is missing among the
kws
attributes, simply add the field and its value to the component.scatter (exists only for scatter / lineScatter plots in 2D and 3D)
A structure with two attributes:
enabled
A boolean indicating whether a call to the
scatter()
function of the matplotlib library should be made or not.kws
A structure whose components are directly passed as keyword arguments to the
scatter()
function.Example usage:
scatter.enabled = True scatter.kws.s = 2
NOTE
If a desired property is missing among the
kws
attributes, simply add the field and its value to the component.lineCollection (exists only for 2D / 3D line / lineScatter plots)
A structure with two attributes:
enabled
A boolean indicating whether a call to the
LineCollection()
class of the matplotlib library should be made or not. This will result in line plots that are color-mapped.kws
A structure whose components are directly passed as keyword arguments to the
LineCollection()
class of matplotlib library.Example usage:
lineCollection.enabled = True lineCollection.kws.linewidth = 1
NOTE
If a desired property is missing among the
kws
attributes, simply add the field and its value to the component.set
A structure with two attributes:
enabled
A boolean indicating whether a call to the
set()
function of the seaborn library should be made or not.kws
A structure whose components are directly passed as keyword arguments to the
set()
function.Example usage:
set.kws.style = "darkgrid"
NOTE
If a desired property is missing among the
kws
attributes, simply add the field and its value to the component.axes (available only in 1D and 2D plots)
A structure with one attribute:
kws
A structure whose components are directly passed as keyword arguments to the
gca()
function of the matplotlib library.Example usage:
axes.kws.facecolor = "w"
NOTE
If a desired property is missing among the
kws
attributes, simply add the field and its value to the component.axes3d (available only in 3D plots)
A structure with one attribute:
kws
A structure whose components are directly passed as keyword arguments to the
Axes3D()
function of the matplotlib library.Example usage:
axes3d.kws.facecolor = "w"
NOTE
If a desired property is missing among the
kws
attributes, simply add the field and its value to the component.figure
A structure with two attributes:
enabled
A boolean indicating whether a call to the
figure()
function of the matplotlib library should be made or not. If a call is made, a new figure will be generated. Otherwise, the current active figure will be used.kws
A structure whose components are directly passed as keyword arguments to the
figure()
function.Example usage:
figure.kws.facecolor = "w"
NOTE
If a desired property is missing among the
kws
attributes, simply add the field and its value to the component.colorbar (exists only for plots that require colorbar)
A structure with two attributes:
enabled
A boolean indicating whether a call to the
colorbar()
function of the matplotlib library should be made or not. If a call is made, a new figure will be generated. Otherwise, the current active figure will be used.kws
A structure whose components are directly passed as keyword arguments to the
colorbar()
function of the matplotlib library.NOTE
If a desired property is missing among the
kws
attributes, simply add the field and its value to the component.A colorbar will be added to a plot only if a color-mappings is requested in the plot.
legend (may not exist for some types of plots)
A structure with two attributes:
enabled
A boolean indicating whether a call to the
legend()
function of the matplotlib library should be made or not. If a call is made, a new figure will be generated. Otherwise, the current active figure will be used.kws
A structure whose components are directly passed as keyword arguments to the
legend()
function.Example usage:
legend.kws.labels = ["Variable1", "Variable2"]
NOTE
If a desired property is missing among the
kws
attributes, simply add the field and its value to the component.A legend will be added to a plot only if no color-mappings are requested in the plot.
currentFig
A structure whose attributes are the outputs of various plotting tools used to make the current figure. These include the handle to the current figure, the handle to the current axes in the plot, the handle to the colorbar (if any exists), and other Python plotting tools used to make to generate the figure.
target (available only in 1D and 2D plot objects)
A callable object of the ParaMonte library’s
Target
class which can be used to add target point or lines to the current active plot.Returns
An object of class
LineScatterPlot
.-
__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 plot object.Returns
Any return value from the
make()
method of the plot object.
-
make
(self, reself: tp.Optional[bool] = False, **kwargs)[source]¶ Generate a line/scatter plot from the selected columns of the object’s dataframe.
Parameters
reself
A logical variable. If
True
, an instance of the object will be returned to the calling routine upon exit. 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.
-
helpme
(self, topic=None)[source]¶ Print the documentation for the input string topic. If the topic does not exist, the documentation for the object will be printed.
Parameters
topic (optional)
A string containing the name of the object for which help is needed.
Returns
None
Example
1 2 3 4
helpme() helpme("make") helpme("helpme") helpme("getLogLinSpace")