paramonte.vis.HeatMapPlot
¶
Module Contents¶
Classes¶
|
This is the HeatMapPlot class for generating instances of |
-
paramonte.vis.HeatMapPlot.
newline
¶
-
class
paramonte.vis.HeatMapPlot.
HeatMapPlot
(plotType, dataFrame=None, methodName='ParaMonte', reportEnabled=True, resetPlot=None)[source]¶ Bases:
paramonte.vis._BasePlot.BasePlot
This is the HeatMapPlot class for generating instances of heatmap figures based on the seaborn library’s
heatmap()
.Usage
First generate an object of this class by optionally passing the following parameters described below. Then call the
make()
method.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
columns
An attribute that determines the columns of dataFrame to be visualized. 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.
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.
heatmap
A structure with one attribute:
kws
A structure whose components are directly passed as keyword arguments to the
heatmap()
function of the seaborn library.Example usage:
heatmap.square = True
NOTE
If a desired property is missing among the
kws
attributes, simply add the field and its value to the component.annotPrecision
- optional integer which determines the precision with which
the output numbers corresponding to each pixel are written to the heatmap when annotation is requested via
heatmap.kws.annot = True
. The default is 2, meaning that only two digits after the decimal are considered.
xticklabels
A structure with one attribute:
kws
A structure whose components are directly passed as keyword arguments to the
set_xticklabels()
function of the matplotlib library.Example usage:
xticklabels.verticalalignment = "right"
NOTE
If a desired property is missing among the
kws
attributes, simply add the field and its value to the component.yticklabels
A structure with one attribute:
kws
A structure whose components are directly passed as keyword arguments to the
set_yticklabels()
function of the matplotlib library.Example usage:
yticklabels.verticalalignment = "right"
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.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.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.
Returns
An object of class
HeatMapPlot
.-
__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 heatmap 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 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.
-
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")