MultiPlot.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/MultiPlot.h
10 
11 #ifndef __Pulsar_MultiPlot_h
12 #define __Pulsar_MultiPlot_h
13 
14 #include "Pulsar/Plot.h"
15 #include "Pulsar/MultiFrame.h"
16 
17 namespace Pulsar {
18 
19  class FramedPlot;
20 
22  class MultiPlot : public Plot {
23 
24  public:
25 
28 
30  static MultiPlot* factory (Plot*);
31 
34 
37 
39  void plot (const Archive*);
40 
42 
44  void manage (Plot*);
45 
47  void manage (const std::string& name, FramedPlot*);
48 
50  void unmanage (FramedPlot*);
51 
53  virtual void prepare (const Archive*);
54 
56  virtual void prepare (FramedPlot*) { }
57 
59  virtual MultiFrame* get_frame () { return &frames; }
60 
62  virtual const MultiFrame* get_frame () const { return &frames; }
63 
64  protected:
65 
68 
70  std::map< std::string, Reference::To<FramedPlot> > plots;
71 
72  void set_viewport (PlotFrame* frame,
73  std::pair<float,float>& sub_xvp,
74  std::pair<float,float>& sub_yvp);
75 
76  };
77 
78 }
79 
80 #endif
static MultiPlot * factory(Plot *)
Factory returns appropriate derived class.
Definition: MultiPlot.C:222
void set_viewport(float x0, float x1, float y0, float y1)
Set the viewport (normalized device coordinates)
Definition: PlotFrame.C:256
Plots multiple viewports.
Definition: MultiPlot.h:27
PlotAxis * get_x_axis(bool allow_transpose)
Get the x-axis.
Definition: PlotFrame.C:204
void set_viewport(const std::pair< float, float > &f)
Set the viewport (normalized device coordinates)
Definition: PlotEdge.h:44
PlotLabel * get_label_below()
Get the below-frame label.
Definition: PlotFrame.h:74
void plot(const Archive *)
Plot in the current viewport.
Definition: MultiPlot.C:43
PlotScale * get_y_scale(bool allow_transpose)
Get the x-scale.
Definition: PlotFrame.C:213
The primary interface to pulsar observational data.
Definition: Archive.h:45
void rem_opt(char opt)
Remove from the options to be passed to pgbox for this axis.
Definition: PlotAxis.C:30
Plots multiple viewports with pulse phase along the shared x-axis.
Definition: MultiPhase.h:25
Plots multiple viewports with radio frequency along the shared x-axis.
Definition: MultiFrequency.h:25
PlotLabel * get_label_above()
Get the above-frame label.
Definition: PlotAttributes.h:59
virtual MultiFrame * get_frame()
Get the frame.
Definition: MultiPlot.h:64
Stores the properties of the plot frame.
Definition: PlotAttributes.h:25
A Plot with a PlotFrame.
Definition: FramedPlot.h:25
void manage(Plot *)
Auto-manage a plot.
Definition: MultiPlot.C:130
Interface to plots with a phase scale.
Definition: HasPhaseScale.h:24
PlotScale * get_x_scale(bool allow_transpose)
Get the x-scale.
Definition: PlotFrame.C:189
std::map< std::string, Reference::To< FramedPlot > > plots
The plots.
Definition: MultiPlot.h:75
TextInterface::Parser * get_frame_interface()
Get the text interface to the frame attributes.
Definition: MultiPlot.C:21
MultiPlot()
Default constructor.
Definition: MultiPlot.C:17
void set_label(const std::string &_label, bool overwrite)
Set the label to be drawn on the axis.
Definition: PlotAxis.C:37
std::pair< float, float > get_viewport() const
Get the viewport (normalized device coordinates)
Definition: PlotEdge.h:47
void unmanage(FramedPlot *)
Stop managing a plot.
Definition: MultiPlot.C:207
Defines the PSRCHIVE library.
Definition: CalSource.h:17
PlotAttributes * get_attributes()
Get the plot attributes.
Definition: MultiPlot.C:26
Manages multiple plot frames.
Definition: MultiFrame.h:25
Base class of all plotters.
Definition: Plot.h:28
Stores the properties of the plot frame.
Definition: PlotFrame.h:31
virtual void prepare(const Archive *)
Derived classes may wish to prepare before plotting.
Definition: MultiPlot.C:31
Simple plots with radio frequency along the x-axis.
Definition: FrequencyPlot.h:27
MultiFrame frames
The plot frames.
Definition: MultiPlot.h:72
void set_all(const std::string &label)
Set all labels to the specified value.
Definition: PlotLabel.h:70

Generated using doxygen 1.8.17