Package pylal :: Module plotutils :: Class BasicPlot
[hide private]
[frames] | no frames]

Class BasicPlot

source code

object --+
         |
        BasicPlot

A very default meta-class to almost any plot you might want to make. It provides basic initialization, a savefig method, and a close method. It is up to developers to subclass BasicPlot and fill in the add_content() and finalize() methods.

Instance Methods [hide private]
 
__init__(self, xlabel="", ylabel="", title="", subtitle="", **kwargs)
Basic plot initialization.
source code
 
add_content(self, data, label="_nolabel_")
Stub.
source code
 
finalize(self)
Stub.
source code
 
savefig(self, *args, **kwargs) source code
 
close(self)
Close the plot and release its memory.
source code
 
add_legend_if_labels_exist(self, *args, **kwargs)
Create a legend if there are any non-trivial labels.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, xlabel="", ylabel="", title="", subtitle="", **kwargs)
(Constructor)

source code 

Basic plot initialization. A subclass can override __init__ and call this one (plotutils.BasicPlot.__init__(self, *args, **kwargs)) and then initialize variables to hold data to plot and labels.

Overrides: object.__init__

add_content(self, data, label="_nolabel_")

source code 

Stub. Replace with a method that appends values or lists of values to self.data_sets and appends labels to self.data_labels. Feel free to accept complicated inputs, but try to store only the raw numbers that will enter the plot.

finalize(self)

source code 

Stub. Replace with a function that creates and makes your plot pretty. Do not do I/O here.