libpgplotxx.a (C++ interface to PGPLOT)
affpgplot.h
Go to the documentation of this file.
1 
40 // include guard
41 #ifndef TF_AFFPGPLOT_H_VERSION
42 
43 #define TF_AFFPGPLOT_H_VERSION \
44  "TF_AFFPGPLOT_H V1.2"
45 
46 #include<pgplotxx/pgplotxx.h>
47 #include<aff/array.h>
48 #include<aff/series.h>
49 #include<aff/iterator.h>
50 
51 namespace pgplot {
52 
58 
60  namespace pgaff {
61 
63  typedef aff::SimpleRigidArray<float, 6> Ttransform;
64 
66  typedef aff::Array<float> Tarray;
67  typedef aff::Series<float> Tseries;
68 
71  const Tarray& a,
72  const pgplot::Trange& range,
73  const Ttransform& tr);
74 
77  const Tarray& a,
78  const pgplot::Trange& range,
79  const bool& xisfirst=true);
80 
83  const Tarray& a,
84  const bool& xisfirst=true);
85 
87  Ttransform create_transform(const Tarray::Tcoc& a,
88  const pgplot::Trect& rect,
89  const bool& xisfirst=true);
90 
92  Trange array_value_range(const Tarray::Tcoc& a);
93  Trange series_value_range(const Tseries::Tcoc& a);
94 
95  /*----------------------------------------------------------------------*/
96 
111  template<class T, class SX, class SY>
112  T& line(T& dev, const SX& x, const SY& y)
113  {
114  typename aff::Browser<SX> ix=x;
115  typename aff::Browser<SY> iy=y;
116  float fx=float(*ix);
117  float fy=float(*iy);
118  dev.move(fx, fy);
119  while ((ix.valid()) && (iy.valid()))
120  { fx=float(*ix); fy=float(*iy); dev.draw(fx, fy); ++ix; ++iy; }
121  return(dev);
122  }
123 
124  /*----------------------------------------------------------------------*/
125 
129  enum Eerrdir {
142  };
143 
144  /*----------------------------------------------------------------------*/
145 
163  template<class T, class SX, class SY, class SE>
164  T& errb(T& dev, const SX& x, const SY& y, const SE& e,
165  const Eerrdir& dir=Fdirver, const float& t=1.)
166  {
167  typename aff::Browser<SX> ix=x;
168  typename aff::Browser<SY> iy=y;
169  typename aff::Browser<SE> ie=e;
170  float fx=float(*ix);
171  float fy=float(*iy);
172  float fe=float(*ie);
173  int idir=int(dir);
174  while ((ix.valid()) && (iy.valid()) && (ie.valid()))
175  { fx=float(*ix); fy=float(*iy); fe=float(*ie);
176  dev.err1(idir, fx, fy, fe, t); ++ix; ++iy; ++ie; }
177  return(dev);
178  }
179 
180  /*----------------------------------------------------------------------*/
181 
197  template<class T, class SX, class SY>
198  T& pt(T& dev, const SX& x, const SY& y, const int& s)
199  {
200  typename aff::Browser<SX> ix=x;
201  typename aff::Browser<SY> iy=y;
202  float fx=float(*ix);
203  float fy=float(*iy);
204  while ((ix.valid()) && (iy.valid()))
205  { fx=float(*ix); fy=float(*iy);
206  dev.pt1(fx, fy, s); ++ix; ++iy; }
207  return(dev);
208  } // T& pt(T& dev, const SX& x, const SY& y, const int& s)
209 
210  } // namespace pgaff
211 
214 } // namespace pgplot
215 
216 #endif // TF_AFFPGPLOT_H_VERSION (includeguard)
217 
218 /* ----- END OF affpgplot.h ----- */
+x (x to x+e)
Definition: affpgplot.h:131
contains all pgplot stuff
Definition: affpgplot.cc:46
Trange array_value_range(const Tarray::Tcoc &a)
return range of values
Definition: affpgplot.cc:164
hold any parameter range
Definition: structs.h:42
pgplot::basic_device & gray(pgplot::basic_device &dev, const Tarray &a, const pgplot::Trange &range, const Ttransform &tr)
function to plot gray image
Definition: affpgplot.cc:52
C++ interface for PGPLOT.
Eerrdir
error bar directions
Definition: affpgplot.h:129
T & errb(T &dev, const SX &x, const SY &y, const SE &e, const Eerrdir &dir=Fdirver, const float &t=1.)
draw error bars from series
Definition: affpgplot.h:164
+/-y (y-e to y+e)
Definition: affpgplot.h:141
aff::Series< float > Tseries
Definition: affpgplot.h:67
aff::Array< float > Tarray
array type to be passed to gray function
Definition: affpgplot.h:66
Trange series_value_range(const Tseries::Tcoc &a)
Definition: affpgplot.cc:169
pgplot base class
Definition: basicdevice.h:57
aff::SimpleRigidArray< float, 6 > Ttransform
transform matrix for gray shade plot function
Definition: affpgplot.h:63
hold any rectangle
Definition: structs.h:130
+/-x (x-e to x+e)
Definition: affpgplot.h:139
T & line(T &dev, const SX &x, const SY &y)
draw an open polygon from a dense series
Definition: affpgplot.h:112
T & pt(T &dev, const SX &x, const SY &y, const int &s)
draw symbols from series
Definition: affpgplot.h:198
+y (y to y+e)
Definition: affpgplot.h:133
-x (x to x-e)
Definition: affpgplot.h:135
Ttransform create_transform(const Tarray::Tcoc &a, const pgplot::Trect &rect, const bool &xisfirst)
create standard transform array
Definition: affpgplot.cc:102