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
17namespace 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
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
The primary interface to pulsar observational data.
Definition Archive.h:46
FramedPlot()
Default constructor.
Definition FramedPlot.C:10
Add generic annotations to any SimplePlot.
Definition PlotAnnotation.h:27
Reference::To< SimplePlot > parent
Reference to the plot that the annotation goes on.
Definition PlotAnnotation.h:37
Plots a single plot.
Definition SimplePlot.h:33
virtual void plot(const Archive *)
Plot in the current viewport.
Definition SimplePlot.C:15
virtual std::string get_xlabel(const Archive *)
Get the default label for the x axis.
Definition SimplePlot.h:41
virtual std::string get_ylabel(const Archive *)
Get the default label for the y axis.
Definition SimplePlot.h:44
std::vector< Reference::To< PlotAnnotation > > annotations
Annotations to add to the plot.
Definition SimplePlot.h:59
virtual void draw(const Archive *)=0
Derived classes must draw in the current viewport.
void add_annotation(PlotAnnotation *a)
Add an annotation.
Definition SimplePlot.h:50
Defines the PSRCHIVE library.
Definition CalSource.h:17

Generated using doxygen 1.14.0