PlotAxis.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/PlotAxis.h
10 
11 #ifndef __Pulsar_PlotAxis_h
12 #define __Pulsar_PlotAxis_h
13 
14 #include "TextInterface.h"
15 
16 namespace Pulsar {
17 
19  class PlotAxis : public Reference::Able {
20 
21  public:
22 
25 
26  // Text interface to the PlotAxis class
27  class Interface : public TextInterface::To<PlotAxis> {
28  public:
29  Interface (PlotAxis* = 0);
30  };
31 
33  void set_label (const std::string& _label, bool overwrite);
34  void set_label (const std::string& _label) { set_label(_label, true); }
36  std::string get_label () const { return label; }
37 
39 
40  void set_displacement (float d) { displacement = d; }
42  float get_displacement () const { return displacement; }
43 
45  void set_alternate (bool f) { alternate = f; }
47  bool get_alternate () const { return alternate; }
48 
50  void set_opt (const std::string& o) { opt = o; }
52  std::string get_opt () const { return opt; }
53 
55  void set_tick (float f) { tick = f; }
57  float get_tick () const { return tick; }
58 
60  void set_nsub (unsigned f) { nsub = f; }
62  unsigned get_nsub () const { return nsub; }
63 
65  void add_opt (char opt);
66 
68  void rem_opt (char opt);
69 
70  protected:
71 
72  std::string label;
73  float displacement;
74 
75  std::string opt;
76  float tick;
77  unsigned nsub;
78 
79  bool alternate;
80 
81  };
82 
83 
84 }
85 
86 #endif
void rem_opt(char opt)
Remove from the options to be passed to pgbox for this axis.
Definition: PlotAxis.C:30
float get_displacement() const
Get the label displacement from edge of viewport.
Definition: PlotAxis.h:52
bool get_alternate() const
Get the world-normalized minimum value on the axis.
Definition: PlotAxis.h:57
void set_displacement(float d)
Set the label displacement from edge of viewport.
Definition: PlotAxis.h:50
PlotAxis()
Default constructor.
Definition: PlotAxis.C:11
void set_alternate(bool f)
Set if the frame opposite the axis may have an alternate scale.
Definition: PlotAxis.h:55
std::string get_opt() const
Get the label to be drawn on the axis.
Definition: PlotAxis.h:62
void set_tick(float f)
Set the tick to be passed to pgbox for this axis.
Definition: PlotAxis.h:65
Stores the label and cpgbox options for an axis.
Definition: PlotAxis.h:24
std::string get_label() const
Get the label to be drawn on the axis.
Definition: PlotAxis.h:46
void set_nsub(unsigned f)
Set the nsub to be passed to pgbox for this axis.
Definition: PlotAxis.h:70
void set_label(const std::string &_label, bool overwrite)
Set the label to be drawn on the axis.
Definition: PlotAxis.C:37
void add_opt(char opt)
Add to the options to be passed to pgbox for this axis.
Definition: PlotAxis.C:22
void set_opt(const std::string &o)
Set the options to be passed to pgbox for this axis.
Definition: PlotAxis.h:60
Defines the PSRCHIVE library.
Definition: CalSource.h:17
static std::string unset
Default label string signifies not set by user.
Definition: PlotLabel.h:32

Generated using doxygen 1.8.17