11#ifndef __Pulsar_MultiDataPlot_h
12#define __Pulsar_MultiDataPlot_h
14#include "Pulsar/MultiData.h"
16#include "Pulsar/SimplePlot.h"
17#include "Pulsar/PlotFrame.h"
18#include "Pulsar/MultiFrame.h"
19#include "Pulsar/Archive.h"
48 std::vector< Reference::To<Type> > plots;
49 std::vector< Reference::To<const Archive> > data_sets;
74 the_plot->get_frame()->init (data);
77 cerr <<
"MultiDataPlot<Type>::plot call Type::prepare" << endl;
79 the_plot->prepare (data);
82 cerr <<
"MultiDataPlot<Type>::plot ptr=" << the_plot.ptr() << endl;
84 plots.push_back (the_plot);
85 data_sets.push_back (data);
88 Type* new_plot =
dynamic_cast<Type*
> (like.
ptr());
91 throw Error (InvalidState,
"Pulsar::MultiDataPlot<Type>::plot",
92 "Plot::Constructor::construct does not return a Type");
95 for (
unsigned i=0; i<
options.size(); i++)
98 cerr <<
"Pulsar::MultiDataPlot<Type>::plot apply "
99 "'" <<
options[i] <<
"'" << endl;
100 new_plot->configure(
options[i] );
111 cerr <<
"Pulsar::MultiDataPlot<Type>::finalize" << endl;
113 if (!data_sets.size())
116 Type* main_plot = plots[0];
118 for (
unsigned i=1; i < plots.size(); i++)
119 main_plot->get_frame()->include( plots[i]->get_frame() );
121 for (
unsigned i=0; i < plots.size(); i++)
123 plots[i]->get_frame()->copy( main_plot->get_frame() );
124 plots[i]->get_frame()->freeze();
127 for (
unsigned i=0; i < plots.size(); i++)
128 plots[i]->
plot( data_sets[i] );
The primary interface to pulsar observational data.
Definition Archive.h:46
MultiDataPlot(Type *simple=0)
Construct with plot to be managed.
Definition MultiDataPlot.h:57
void plot(const Archive *)
prepare the Simple Plot and push it onto the plots vector
Definition MultiDataPlot.h:72
void finalize()
draw the accumulated plots
Definition MultiDataPlot.h:108
void manage(Type *)
Manage a plot.
Definition MultiDataPlot.h:64
Combines multiple data sets in a single plot.
Definition MultiData.h:20
Reference::To< Plot > managed_plot
The plot that is managed by this instance.
Definition MultiData.h:57
std::vector< std::string > options
The options passed to configure.
Definition MultiData.h:60
static bool verbose
Verbosity flag.
Definition Plot.h:28
Defines the PSRCHIVE library.
Definition CalSource.h:17