libpgplotxx.a (C++ interface to PGPLOT)
basicdevice.h
Go to the documentation of this file.
1 
19 // include guard
20 #ifndef TF_PGPLOTBASICDEVICE_H_VERSION
21 
22 #define TF_PGPLOTBASICDEVICE_H_VERSION \
23  "TF_BASICDEVICE_H V1.0 (17-03-2015)"
24 
25 #include <pgplotxx/structs.h>
26 
27 namespace pgplot {
28 
29 #include<cpgplot.h>
30 
36 
57 class basic_device {
58  public:
60  basic_device(const char* devName) { this->devopen(devName); }
62  ~basic_device() { this->select(); cpgupdt(); cpgclos(); }
63 
64  // -----------------------------------------------------------------
65 
72  basic_device& arro(const float& x1, const float& y1,
74  const float& x2, const float& y2)
75  { this->select(); cpgarro(x1, y1, x2, y2); return(*this); }
77  basic_device& ask(const Logical& flag)
78  { this->select(); cpgask(flag); return(*this); }
80  basic_device& ask(const bool& flag=true)
81  { this->select(); cpgask(flag); return(*this); }
83  basic_device& axis(const char *opt, const float& x1, const float& y1,
84  const float& x2, const float& y2, const float& v1,
85  const float& v2, const float& step,
86  const int& nsub, const float& dmajl,
87  const float& dmajr, const float& fmin,
88  const float& disp, const float& orient)
89  {
90  this->select();
91  cpgaxis(opt, x1, y1, x2, y2, v1, v2, step, nsub,
92  dmajl, dmajr, fmin, disp, orient);
93  return(*this);
94  }
96  basic_device& axis(const char *opt, const Trect& line,
97  const Trange& val, const float& step=0.,
98  const int& nsub=0, const float& dmajl=0.01,
99  const float& dmajr=0.01, const float& fmin=0.3,
100  const float& disp=0.05, const float& orient=0.)
101  {
102  return(this->axis(opt, line.x.min, line.y.min, line.x.max, line.y.max,
103  val.min, val.max, step, nsub, dmajl, dmajr, fmin,
104  disp, orient));
105  }
108  { this->select(); cpgbbuf(); return(*this); }
110  basic_device& bin(const int& nbin, const float *x, const float *data,
111  const Logical& center)
112  { this->select(); cpgbin(nbin, x, data, center); return(*this); }
114  basic_device& box(const char *xopt, float xtick, int nxsub,
115  const char *yopt, float ytick, int nysub)
116  {
117  this->select();
118  cpgbox(xopt, xtick, nxsub, yopt, ytick, nysub);
119  return(*this);
120  }
121  /*
122  void circ(float xcent, float ycent, float radius)
123  { this->select(); }
124  void conb(const float *a, int idim, int jdim, int i1, int i2, int j1, int
125  j2, const float *c, int nc, const float *tr, float blank)
126  { this->select(); }
127  void conf(const float *a, int idim, int jdim, int i1, int i2, int j1, int
128  j2, float c1, float c2, const float *tr)
129  { this->select(); }
130  void conl(const float *a, int idim, int jdim, int i1, int i2, int j1, int
131  j2, float c, const float *tr, const char *label, int intval, int
132  minint)
133  { this->select(); }
134  void cons(const float *a, int idim, int jdim, int i1, int i2, int j1, int
135  j2, const float *c, int nc, const float *tr)
136  { this->select(); }
137  void cont(const float *a, int idim, int jdim, int i1, int i2, int j1, int
138  j2, const float *c, int nc, const float *tr)
139  { this->select(); }
140  void ctab(const float *l, const float *r, const float *g, const float *b,
141  int nc, float contra, float bright)
142  { this->select(); }
143  */
145  basic_device& draw(const float& x, const float& y)
146  { this->select(); cpgdraw(x, y); return(*this); }
148  basic_device& draw(const Tcoor& c) { return(this->draw(c.x, c.y)); }
151  { this->select(); cpgebuf(); return(*this); }
153  basic_device& env(const float &xmin, const float &xmax,
154  const float &ymin, const float &ymax,
155  const int &just=0, const int &axis=0)
156  {
157  this->select();
158  cpgenv(xmin, xmax, ymin, ymax, just, axis);
159  return(*this);
160  }
163  const int &just=0, const int &axis=0)
164  {
165  return(this->env(rect.x.min, rect.x.max, rect.y.min, rect.y.max,
166  just, axis));
167  }
170  { this->select(); cpgeras(); return(*this); }
172  basic_device& err1(const int& dir, const float& x,
173  const float& y, const float& e,
174  const float& t)
175  { this->select(); cpgerr1(dir, x, y, e ,t); return(*this); }
176  /*
177  void errb(int dir, int n, const float *x, const float *y, const float *e,
178  float t)
179  { this->select(); }
180  void errx(int n, const float *x1, const float *x2, const float *y, float t)
181  { this->select(); }
182  void erry(int n, const float *x, const float *y1, const float *y2, float t)
183  { this->select(); }
184  void etxt(void)
185  { this->select(); }
186  */
188  basic_device& gray(const float *a, int idim, int jdim,
189  int i1, int i2, int j1, int j2,
190  float fg, float bg, const float *tr)
191  {
192  this->select();
193  cpggray(a, idim, jdim, i1, i2, j1, j2, fg, bg, tr);
194  return(*this);
195  }
196  /*
197  void hi2d(const float *data, int nxv, int nyv, int ix1, int ix2, int iy1,
198  int iy2, const float *x, int ioff, float bias, Logical center,
199  float *ylims)
200  { this->select(); }
201  void hist(int n, const float *data, float datmin, float datmax, int nbin,
202  int pgflag)
203  { this->select(); }
204  void iden(void)
205  { this->select(); }
206  void imag(const float *a, int idim, int jdim, int i1, int i2, int j1, int
207  j2, float a1, float a2, const float *tr)
208  { this->select(); }
209  */
211  basic_device& lab(const char *xlbl, const char *ylbl, const char *toplbl)
212  { this->select(); cpglab(xlbl, ylbl, toplbl); return(*this); }
213  /*
214  void len(int units, const char *string, float *xl, float *yl)
215  { this->select(); }
216  */
218  basic_device& line(const int& n, const float *xpts, const float *ypts)
219  { this->select(); cpgline(n, xpts, ypts); return(*this); }
221  basic_device& move(const float& x, const float& y)
222  { this->select(); cpgmove(x, y); return(*this); }
224  basic_device& move(const Tcoor& c) { return(this->move(c.x, c.y)); }
226  basic_device& mtxt(const char *side, const float& disp, const float& coord,
227  const float& fjust, const char *text)
228  {
229  this->select();
230  cpgmtxt(side, disp, coord, fjust, text);
231  return(*this);
232  }
233  /*
234  void numb(int mm, int pp, int form, char *string, int *string_length)
235  { this->select(); }
236  */
239  { this->select(); cpgpage(); return(*this); }
241  basic_device& panl(int nxc, int nyc)
242  { this->select(); cpgpanl(nxc, nyc); return(*this); }
243  /*
244  void pap(float width, float aspect)
245  { this->select(); }
246  void pixl(const int *ia, int idim, int jdim, int i1, int i2, int j1, int
247  j2, float x1, float x2, float y1, float y2)
248  { this->select(); }
249  void pnts(int n, const float *x, const float *y, const int *symbol, int ns)
250  { this->select(); }
251  */
253  basic_device& poly(int n, const float *xpts, const float *ypts)
254  { this->select(); cpgpoly(n, xpts, ypts); return(*this); }
256  basic_device& pt(int n, const float *xpts, const float *ypts, int symbol)
257  { this->select(); cpgpt(n, xpts, ypts, symbol); return(*this); }
259  basic_device& pt1(float xpt, float ypt, int symbol)
260  { this->select(); cpgpt1(xpt, ypt, symbol); return(*this); }
262  basic_device& ptxt(const float& x, const float& y,
263  const float& angle, const float& fjust,
264  const char *text)
265  { this->select(); cpgptxt(x, y, angle, fjust, text); return(*this); }
267 
268  // -----------------------------------------------------------------
269 
275  /*
276  void qah(int *fs, float *angle, float *barb)
277  { this->select(); }
278  void qcf(int *font)
279  { this->select(); }
280  void qch(float *size)
281  { this->select(); }
282  void qci(int *ci)
283  { this->select(); }
284  void qcir(int *icilo, int *icihi)
285  { this->select(); }
286  void qclp(int *state)
287  { this->select(); }
288  void qcol(int *ci1, int *ci2)
289  { this->select(); }
290  */
292  basic_device& qcr(const int& ci, float *cr, float *cg, float *cb)
293  { this->select(); cpgqcr(ci, cr, cg, cb); return(*this); }
294  /*
295  void qcs(int units, float *xch, float *ych)
296  { this->select(); }
297  void qdt(int n, char *type, int *type_length, char *descr, int
298  *descr_length, int *inter)
299  { this->select(); }
300  void qfs(int *fs)
301  { this->select(); }
302  void qhs(float *angle, float *sepn, float *phase)
303  { this->select(); }
304  void qid(int *id)
305  { this->select(); }
306  void qinf(const char *item, char *value, int *value_length)
307  { this->select(); }
308  void qitf(int *itf)
309  { this->select(); }
310  void qls(int *ls)
311  { this->select(); }
312  void qlw(int *lw)
313  { this->select(); }
314  void qndt(int *n)
315  { this->select(); }
316  void qpos(float *x, float *y)
317  { this->select(); }
318  void qtbg(int *tbci)
319  { this->select(); }
320  */
322  basic_device& qtxt(const float& x, const float& y, const float& angle,
323  const float& fjust, const char *text,
324  float *xbox, float *ybox)
325  {
326  this->select();
327  cpgqtxt(x, y, angle, fjust, text, xbox, ybox);
328  return(*this);
329  }
331  basic_device& qtxt(const float& x, const float& y, const float& angle,
332  const float& fjust, const char *text, Tbbox& b)
333  {
334  float xbox[4], ybox[4];
335  this->qtxt(x, y, angle, fjust, text, xbox, ybox);
336  b=Tbbox(xbox, ybox);
337  return(*this);
338  }
339  /*
340  void qvp(int units, float *x1, float *x2, float *y1, float *y2)
341  { this->select(); }
342  void qvsz(int units, float *x1, float *x2, float *y1, float *y2)
343  { this->select(); }
344  */
346  basic_device& qwin(float *x1, float *x2, float *y1, float *y2)
347  {
348  this->select();
349  cpgqwin(x1, x2, y1, y2);
350  return(*this);
351  }
353  basic_device& qwin(float &x1, float &x2, float &y1, float &y2)
354  { return(this->qwin(&x1, &x2, &y1, &y2)); }
357  {
358  float x1,x2,y1,y2;
359  this->qwin(x1, x2, y1, y2);
360  win=Trect(Trange(x1,x2),Trange(y1,y2));
361  return(*this);
362  }
364 
365  // -----------------------------------------------------------------
366 
370  basic_device& rect(const float& x1, const float& x2,
372  const float& y1, const float& y2)
373  { this->select(); cpgrect(x1, x2, y1, y2); return(*this); }
375  basic_device& rect(const Trect& rec)
376  {
377  this->select();
378  cpgrect(rec.x.min, rec.x.max, rec.y.min, rec.y.max);
379  return(*this);
380  }
382 
383  // -----------------------------------------------------------------
384 
390  basic_device& sah(const int& fs, const float& angle, const float& barb)
392  { this->select(); cpgsah(fs, angle, barb); return(*this); }
395  { this->select(); cpgsave(); return(*this); }
398  { this->select(); cpgunsa(); return(*this); }
400  basic_device& scf(const int& font)
401  { this->select(); cpgscf(font); return(*this); }
403  basic_device& sch(const float& size)
404  { this->select(); cpgsch(size); return(*this); }
406  basic_device& sci(const int& ci)
407  { this->select(); cpgsci(ci); return(*this); }
409  basic_device& scir(const int& icilo, const int& icihi)
410  { this->select(); cpgscir(icilo, icihi); return(*this); }
412  basic_device& sclp(const int& state)
413  { this->select(); cpgsclp(state); return(*this); }
415  basic_device& scr(const int& ci, const float& cr,
416  const float& cg, const float& cb)
417  { this->select(); cpgscr(ci, cr, cg, cb); return(*this); }
419  basic_device& scr(const int& ci, const Tcol& rgb)
420  { return(this->scr(ci, rgb.r, rgb.g, rgb.b)); }
421  /*
422  void scrl(float dx, float dy)
423  { this->select(); }
424  void scrn(int ci, const char *name, int *ier)
425  { this->select(); }
426  */
428  basic_device& sfs(const int& fs)
429  { this->select(); cpgsfs(fs); return(*this); }
431  basic_device& shls(const int& ci, const float& ch, const float& cl,
432  const float& cs)
433  { this->select(); cpgshls(ci, ch, cl, cs); return(*this); }
435  basic_device& shls(const int& ci, const Tcol& hls)
436  { return(this->shls(ci, hls.h, hls.l, hls.s)); }
438  basic_device& shs(const float& angle, const float& sepn,
439  const float& phase)
440  { this->select(); cpgshs(angle, sepn, phase); return(*this); }
442  basic_device& sitf(const int& itf)
443  { this->select(); cpgsitf(itf); return(*this); }
445  basic_device& sls(const int& ls)
446  { this->select(); cpgsls(ls); return(*this); }
448  basic_device& slw(const int& lw)
449  { this->select(); cpgslw(lw); return(*this); }
451  basic_device& stbg(const int& tbci)
452  { this->select(); cpgstbg(tbci); return(*this); }
454  basic_device& subp(int nxsub, int nysub)
455  { this->select(); cpgsubp(nxsub, nysub); return(*this); }
457  basic_device& svp(const float& xleft, const float& xright,
458  const float& ybot, const float& ytop)
459  {
460  this->select();
461  cpgsvp(xleft, xright, ybot, ytop);
462  return(*this);
463  }
465  basic_device& svp(const Trect& vp)
466  { return(this->svp(vp.x.min, vp.x.max,vp.y.min,vp.y.max)); }
468  basic_device& swin(const float& x1, const float& x2,
469  const float& y1, const float& y2)
470  {
471  this->select();
472  cpgswin(x1, x2, y1, y2);
473  return(*this);
474  }
476  basic_device& swin(const Trect& win)
477  { return(this->swin(win.x.min, win.x.max,win.y.min,win.y.max)); }
479 
480  // -----------------------------------------------------------------
481 
485  basic_device& tbox(const char *xopt, float xtick, int nxsub,
487  const char *yopt, float ytick, int nysub)
488  {
489  this->select();
490  cpgtbox(xopt, xtick, nxsub, yopt, ytick, nysub);
491  return(*this);
492  }
493 
494  /*
495  void text(float x, float y, const char *text)
496  { this->select(); }
497  void tick(float x1, float y1, float x2, float y2, float v, float tikl,
498  float tikr, float disp, float orient, const char *str)
499  { this->select(); }
500  */
503  { this->select(); cpgupdt(); return(*this); }
504  /*
505  void vect(const float *a, const float *b, int idim, int jdim, int i1, int
506  i2, int j1, int j2, float c, int nc, const float *tr, float
507  blank)
508  { this->select(); }
509  */
511  basic_device& vsiz(const float& xleft, const float& xright,
512  const float& ybot, const float& ytop)
513  { this->select(); cpgvsiz(xleft, xright, ybot, ytop); return(*this); }
515  basic_device& vsiz(const Trect& vp)
516  { return(this->vsiz(vp.x.min, vp.x.max, vp.y.min, vp.y.max)); }
519  { this->select(); cpgvstd(); return(*this); }
521  basic_device& wedg(const char *side,
522  const float& disp, const float& width,
523  const float& fg, const float& bg,
524  const char *label)
525  {
526  this->select();
527  cpgwedg(side, disp, width, fg, bg, label);
528  return(*this);
529  }
531  basic_device& wedg(const char *side,
532  const float& disp, const float& width,
533  const Trange& range,
534  const char *label)
535  { return(this->wedg(side, disp, width, range.min, range.max, label)); }
537  basic_device& gwedg(const Trange& range,
538  const char *label="value",
539  const float& disp=0.3,
540  const float& width=3.0,
541  const char *side="RG")
542  { return(this->wedg(side, disp, width, range.min, range.max, label)); }
544  basic_device& wnad(const float& x1, const float& x2,
545  const float& y1, const float& y2)
546  { this->select(); cpgwnad(x1, x2, y1, y2); return(*this); }
548  basic_device& wnad(const Trect& win)
549  { return(this->wnad(win.x.min, win.x.max, win.y.min, win.y.max)); }
551 
552  // -----------------------------------------------------------------
553 
559  static float rnd(const float& x, int *nsub)
561  { return(cpgrnd(x, nsub)); }
563  static void ldev(void)
564  { cpgldev(); }
566  static void rnge(const float& x1, const float& x2, float *xlo, float *xhi)
567  { cpgrnge(x1, x2, xlo, xhi); }
569  static Trange rnge(const Trange& xin)
570  {
571  Trange result;
572  cpgrnge(xin.min, xin.max, &result.min, &result.max);
573  return(result);
574  }
576 
577  protected:
586  int band(const int& mode, const int& posn,
587  const float& xref, const float& yref, float *x, float *y,
588  char *ch_scalar)
589  {
590  this->select();
591  return(cpgband(mode, posn, xref, yref, x, y, ch_scalar));
592  }
593  int curs(float *x, float *y, char *ch_scalar)
594  {
595  this->select();
596  return(cpgcurs(x, y, ch_scalar));
597  }
598  basic_device& lcur(int maxpt, int *npt, float *x, float *y)
599  { this->select(); cpglcur(maxpt, npt, x, y); return(*this); }
600  basic_device& ncur(int maxpt, int *npt, float *x, float *y, int symbol)
601  { this->select(); cpgncur(maxpt, npt, x, y, symbol); return(*this); }
602  basic_device& olin(int maxpt, int *npt, float *x, float *y, int symbol)
603  { this->select(); cpgolin(maxpt, npt, x, y, symbol); return(*this); }
605  private:
606  void select() { cpgslct(MdevID); }
607  void devopen(const char *devname) { MdevID=cpgopen(devname); }
608  int MdevID;
609 }; // class basic_device
610 
613 } // namespace pgplot
614 
615 #endif // TF_PGPLOTBASICDEVICE_H_VERSION (includeguard)
616 
617 /* ----- END OF basicdevice.h ----- */
int band(const int &mode, const int &posn, const float &xref, const float &yref, float *x, float *y, char *ch_scalar)
Definition: basicdevice.h:586
basic_device & bbuf(void)
start buffering
Definition: basicdevice.h:107
~basic_device()
destructor closes PGPLOT device
Definition: basicdevice.h:62
basic_device & eras(void)
erase total panel
Definition: basicdevice.h:169
basic_device & qwin(float *x1, float *x2, float *y1, float *y2)
inquire window boundary coordinates
Definition: basicdevice.h:346
basic_device & olin(int maxpt, int *npt, float *x, float *y, int symbol)
Definition: basicdevice.h:602
provide useful structs for pgplotxx (prototypes)
hold coordinates
Definition: structs.h:186
basic_device & env(const Trect rect, const int &just=0, const int &axis=0)
define PGPLOT window and axis
Definition: basicdevice.h:162
basic_device & page()
advance to next output page
Definition: basicdevice.h:238
basic_device & scir(const int &icilo, const int &icihi)
set color index range
Definition: basicdevice.h:409
contains all pgplot stuff
Definition: affpgplot.cc:46
hold bounding box for text etc.
Definition: structs.h:204
basic_device & sci(const int &ci)
set color index
Definition: basicdevice.h:406
basic_device & draw(const float &x, const float &y)
draw line to position
Definition: basicdevice.h:145
basic_device & save(void)
save device settings
Definition: basicdevice.h:394
basic_device & vsiz(const float &xleft, const float &xright, const float &ybot, const float &ytop)
set viewport (view area - here: in inches)
Definition: basicdevice.h:511
basic_device & move(const float &x, const float &y)
move plot position
Definition: basicdevice.h:221
basic_device & sitf(const int &itf)
set image transfer function
Definition: basicdevice.h:442
basic_device & pt(int n, const float *xpts, const float *ypts, int symbol)
draw a sequence of marker symbols
Definition: basicdevice.h:256
basic_device & vstd(void)
select standard viewport
Definition: basicdevice.h:518
hold any parameter range
Definition: structs.h:42
basic_device & swin(const float &x1, const float &x2, const float &y1, const float &y2)
set window (world coordinate range)
Definition: basicdevice.h:468
basic_device & ask(const bool &flag=true)
ask before clearing page? (bool version)
Definition: basicdevice.h:80
basic_device & shs(const float &angle, const float &sepn, const float &phase)
set hatching style
Definition: basicdevice.h:438
basic_device & bin(const int &nbin, const float *x, const float *data, const Logical &center)
plot binning
Definition: basicdevice.h:110
basic_device & stbg(const int &tbci)
set background color index
Definition: basicdevice.h:451
basic_device & qtxt(const float &x, const float &y, const float &angle, const float &fjust, const char *text, float *xbox, float *ybox)
get bounding box of text
Definition: basicdevice.h:322
basic_device & scr(const int &ci, const float &cr, const float &cg, const float &cb)
set color representation
Definition: basicdevice.h:415
basic_device & svp(const Trect &vp)
set viewport (view area)
Definition: basicdevice.h:465
basic_device & panl(int nxc, int nyc)
switch to a different panel on the view surface
Definition: basicdevice.h:241
basic_device & rect(const float &x1, const float &x2, const float &y1, const float &y2)
plot rectangle (cf. poly)
Definition: basicdevice.h:371
basic_device & sah(const int &fs, const float &angle, const float &barb)
set arrow head style
Definition: basicdevice.h:391
basic_device & slw(const int &lw)
set line width
Definition: basicdevice.h:448
Trange x
coordinate ranges
Definition: structs.h:132
basic_device & scr(const int &ci, const Tcol &rgb)
set color representation by rgb values
Definition: basicdevice.h:419
basic_device & axis(const char *opt, const Trect &line, const Trange &val, const float &step=0., const int &nsub=0, const float &dmajl=0.01, const float &dmajr=0.01, const float &fmin=0.3, const float &disp=0.05, const float &orient=0.)
plot arbitrary axis
Definition: basicdevice.h:96
basic_device & lab(const char *xlbl, const char *ylbl, const char *toplbl)
write labels
Definition: basicdevice.h:211
basic_device & updt(void)
update plot (in buffering mode)
Definition: basicdevice.h:502
basic_device & draw(const Tcoor &c)
draw line to position
Definition: basicdevice.h:148
basic_device & sls(const int &ls)
set line style
Definition: basicdevice.h:445
basic_device & svp(const float &xleft, const float &xright, const float &ybot, const float &ytop)
set viewport (view area)
Definition: basicdevice.h:457
static void ldev(void)
tell about available devices
Definition: basicdevice.h:563
basic_device & poly(int n, const float *xpts, const float *ypts)
draw polygonial line
Definition: basicdevice.h:253
basic_device & axis(const char *opt, const float &x1, const float &y1, const float &x2, const float &y2, const float &v1, const float &v2, const float &step, const int &nsub, const float &dmajl, const float &dmajr, const float &fmin, const float &disp, const float &orient)
plot arbitrary axis
Definition: basicdevice.h:83
basic_device & gwedg(const Trange &range, const char *label="value", const float &disp=0.3, const float &width=3.0, const char *side="RG")
annotate an image plot with a wedge
Definition: basicdevice.h:537
basic_device & sfs(const int &fs)
set fill style
Definition: basicdevice.h:428
basic_device & sclp(const int &state)
set clipping mode
Definition: basicdevice.h:412
basic_device & wedg(const char *side, const float &disp, const float &width, const float &fg, const float &bg, const char *label)
annotate an image plot with a wedge
Definition: basicdevice.h:521
float y
y-coordinate shift coordinate by a vector c
Definition: structs.h:188
basic_device & mtxt(const char *side, const float &disp, const float &coord, const float &fjust, const char *text)
plot text outside viewport (for labels)
Definition: basicdevice.h:226
Trange y
Definition: structs.h:132
basic_device(const char *devName)
constructor opens PGPLOT device
Definition: basicdevice.h:60
basic_device & move(const Tcoor &c)
move plot position
Definition: basicdevice.h:224
void devopen(const char *devname)
Definition: basicdevice.h:607
basic_device & swin(const Trect &win)
set window (world coordinate range)
Definition: basicdevice.h:476
basic_device & ebuf(void)
stop buffering
Definition: basicdevice.h:150
basic_device & qwin(float &x1, float &x2, float &y1, float &y2)
inquire window boundary coordinates
Definition: basicdevice.h:353
basic_device & line(const int &n, const float *xpts, const float *ypts)
draw an open polygon
Definition: basicdevice.h:218
pgplot base class
Definition: basicdevice.h:57
basic_device & vsiz(const Trect &vp)
set viewport (view area - here: in inches)
Definition: basicdevice.h:515
basic_device & wnad(const float &x1, const float &x2, const float &y1, const float &y2)
set world coordinates and adjust viewport to same aspect ratio
Definition: basicdevice.h:544
basic_device & lcur(int maxpt, int *npt, float *x, float *y)
Definition: basicdevice.h:598
basic_device & env(const float &xmin, const float &xmax, const float &ymin, const float &ymax, const int &just=0, const int &axis=0)
define PGPLOT window and axis
Definition: basicdevice.h:153
basic_device & subp(int nxsub, int nysub)
subdivide view surface into panels
Definition: basicdevice.h:454
basic_device & gray(const float *a, int idim, int jdim, int i1, int i2, int j1, int j2, float fg, float bg, const float *tr)
plot gray scale image
Definition: basicdevice.h:188
basic_device & arro(const float &x1, const float &y1, const float &x2, const float &y2)
plot arrow
Definition: basicdevice.h:73
basic_device & tbox(const char *xopt, float xtick, int nxsub, const char *yopt, float ytick, int nysub)
plot tbox around graph
Definition: basicdevice.h:486
basic_device & ptxt(const float &x, const float &y, const float &angle, const float &fjust, const char *text)
write text at arbitraty position
Definition: basicdevice.h:262
static float rnd(const float &x, int *nsub)
find smallest "round" number greater than x
Definition: basicdevice.h:560
float min
range [min....max]
Definition: structs.h:44
float l
Definition: structs.h:224
int curs(float *x, float *y, char *ch_scalar)
Definition: basicdevice.h:593
basic_device & ncur(int maxpt, int *npt, float *x, float *y, int symbol)
Definition: basicdevice.h:600
basic_device & scf(const int &font)
set character font
Definition: basicdevice.h:400
basic_device & shls(const int &ci, const float &ch, const float &cl, const float &cs)
set color in the HLS system
Definition: basicdevice.h:431
float s
Definition: structs.h:226
basic_device & qwin(Trect &win)
inquire window boundary coordinates
Definition: basicdevice.h:356
static Trange rnge(const Trange &xin)
found suitable range
Definition: basicdevice.h:569
basic_device & pt1(float xpt, float ypt, int symbol)
draw one marker symbol
Definition: basicdevice.h:259
hold any rectangle
Definition: structs.h:130
a struct to hold colour triples i.e. rgb or hls values
Definition: structs.h:220
float x
x-coordinate
Definition: structs.h:187
float r
Definition: structs.h:222
float g
Definition: structs.h:224
float b
Definition: structs.h:226
basic_device & qtxt(const float &x, const float &y, const float &angle, const float &fjust, const char *text, Tbbox &b)
get bounding box of text
Definition: basicdevice.h:331
float max
Definition: structs.h:44
static void rnge(const float &x1, const float &x2, float *xlo, float *xhi)
found suitable range
Definition: basicdevice.h:566
basic_device & shls(const int &ci, const Tcol &hls)
set color representation by hls values
Definition: basicdevice.h:435
basic_device & wnad(const Trect &win)
set world coordinates and adjust viewport to same aspect ratio
Definition: basicdevice.h:548
basic_device & box(const char *xopt, float xtick, int nxsub, const char *yopt, float ytick, int nysub)
plot box around graph
Definition: basicdevice.h:114
basic_device & rect(const Trect &rec)
plot rectangle (cf. poly)
Definition: basicdevice.h:375
basic_device & wedg(const char *side, const float &disp, const float &width, const Trange &range, const char *label)
annotate an image plot with a wedge
Definition: basicdevice.h:531
float h
Definition: structs.h:222
basic_device & qcr(const int &ci, float *cr, float *cg, float *cb)
inquire color representation
Definition: basicdevice.h:292
basic_device & sch(const float &size)
set character height
Definition: basicdevice.h:403
basic_device & err1(const int &dir, const float &x, const float &y, const float &e, const float &t)
plot single error bar
Definition: basicdevice.h:172
basic_device & ask(const Logical &flag)
ask before clearing page? (Logical version)
Definition: basicdevice.h:77
basic_device & unsa(void)
restore device settings
Definition: basicdevice.h:397