SimplePlot.h
1 //-*-C++-*-
2 /***************************************************************************
3  *
4  * Copyright (C) 2006 by Willem van Straten
5  * Licensed under the Academic Free License version 2.1
6  *
7  ***************************************************************************/
8 
9 // psrchive/More/Plotting/Pulsar/SimplePlot.h
10 
11 #ifndef __Pulsar_SimplePlot_h
12 #define __Pulsar_SimplePlot_h
13 
14 #include "Pulsar/FramedPlot.h"
15 #include "Pulsar/PlotAnnotation.h"
16 
17 namespace Pulsar {
18 
20 
33  class SimplePlot : public FramedPlot {
34 
35  public:
36 
38  virtual void plot (const Archive*);
39 
41  virtual std::string get_xlabel (const Archive*) { return ""; }
42 
44  virtual std::string get_ylabel (const Archive*) { return ""; }
45 
47  virtual void draw (const Archive*) = 0;
48 
50  void add_annotation(PlotAnnotation *a)
51  {
52  annotations.push_back(a);
53  a->parent = this;
54  }
55 
56  protected:
57 
59  std::vector< Reference::To<PlotAnnotation> > annotations;
60 
61  };
62 
63 }
64 
65 #endif
virtual std::string get_ylabel(const Archive *)
Get the default label for the y axis.
Definition: SimplePlot.h:54
virtual void draw(const Archive *)=0
Derived classes must draw in the current viewport.
The primary interface to pulsar observational data.
Definition: Archive.h:45
PlotPen * get_pen()
Provide access to the Pen.
Definition: HasPen.h:36
virtual std::string get_xlabel(const Archive *)
Get the default label for the x axis.
Definition: SimplePlot.h:51
void setup()
Set the plot line attributes.
Definition: PlotPen.C:24
Interface to objects that have a PlotPen.
Definition: HasPen.h:24
virtual void plot(const Archive *)
Plot in the current viewport.
Definition: SimplePlot.C:15
Defines the PSRCHIVE library.
Definition: CalSource.h:17
void add_annotation(PlotAnnotation *a)
Add an annotation.
Definition: SimplePlot.h:60
std::vector< Reference::To< PlotAnnotation > > annotations
Annotations to add to the plot.
Definition: SimplePlot.h:69

Generated using doxygen 1.8.17