Source code for titania.plots.line_plot
from titania.plots.base_plot import NavToolbarPlot, MplPlot
[docs]class LinePlot(MplPlot):
def __init__(self, parent=None, view=None, *args, **kwargs):
"""
Simple matplotlib line plot class
"""
MplPlot.__init__(self, parent=parent, view=view)
[docs] def draw_plot(self, data=None) -> None:
self.figure.clear()
ax = self.figure.add_subplot(self.plot_number)
ax.plot(self.view.data.fetch(), '*-')
self.draw()
[docs]class ToolbarLinePlot(NavToolbarPlot):
def __init__(self, parent=None, view=None):
"""
A Line Plot with a toolbar
Args:
"""
NavToolbarPlot.__init__(self, parent=parent, view=view)
[docs] def draw_plot(self, data=None):
self.figure.clear()
ax = self.figure.add_subplot(self.plot_number)
ax.plot(self.view.data.fetch(), '*-')
self.draw()