43 #define TF_XPGPLOTCPP_CC_VERSION \ 44 "TF_XPGPLOTCPP_CC V1.6 (17-03-2015)" 57 template<
class T,
class T2>
58 T
limit(
const T& v,
const T2& min,
const T2& max)
60 T retval = v > min ? v : min;
61 retval = retval < max ? retval : max;
129 const Trect& win,
const int& nx,
const int& ny)
138 for (
int i=0; i<
Mnx; i++)
140 for (
int j=0; j<
Mny; j++)
156 Mvp(panels.Mvp), Mnx(panels.Mnx), Mny(panels.Mny)
159 for (
int i=0; i<
Mnx; i++)
161 for (
int j=0; j<
Mny; j++)
175 for (
int i=0; i<
Mnx; i++)
177 for (
int j=0; j<
Mny; j++)
192 int iix=(ix<
Mnx ? ix :
Mnx-1);
193 int iiix=(iix>-1 ? iix : 0);
194 int iiy=(iy<
Mny ? iy :
Mny-1);
195 int iiiy=(iiy>-1 ? iiy : 0);
206 Mgridflags(
Fhvselect), Mgridstyle(1, 4, 1),
208 Maxisflags(
Fnone), Maxisstyle(1, 1, 1) ,
211 Mxtick(0.), Mytick(0.), Mxticksub(0), Myticksub(0),
212 Mticksstyle(1, 1, 1) ,
214 Mylabelflags(
Fselect), Mlabelstyle(1, 1, 1),
271 }
else if (elem&
Faxis) {
273 }
else if (elem&
Fgrid) {
289 const char* yopt)
const 311 std::string xopt, yopt;
314 std::string txopt=
"", tyopt=
"";
345 xopt=txopt; yopt=tyopt;
381 xopt=txopt; yopt=tyopt;
390 xopt=txopt; yopt=tyopt;
399 xopt=txopt; yopt=tyopt;
441 const bool& nl,
const float& sep)
443 float xbox[4], ybox[4];
452 dev.
poly(4, xbox, ybox);
460 this->
advance(xbox, ybox, nl, sep);
472 float dxh=xbox[3]-xbox[0];
473 float dyh=ybox[3]-ybox[0];
474 float ddh=sqrt(dxh*dxh+dyh*dyh);
475 float dxv=xbox[1]-xbox[0];
476 float dyv=ybox[1]-ybox[0];
477 float ddv=sqrt(dxv*dxv+dyv*dyv);
522 const char* spacechar=
"t";
523 float xbox[4], ybox[4];
532 dev.
poly(4, xbox, ybox);
535 this->
advance(xbox, ybox,
false, 0.);
yselect, vselect, rselect (y, vertical, right)
Tlinestyle Maxisstyle
axis linestyle
Tlinestyle Mframestyle
frame linestyle
Tlinestyle & sethls(const Tcol &hls)
set color representation with hls values
Trange c_range19(0.1, 0.9)
range form 0.1 to 0.9
int Mxtickflags
tick options
Ttiledpanels(const Tpanel &panel, const Trect &svp, const Trect &win, const int &nx, const int &ny)
contains all pgplot stuff
hold bounding box for text etc.
basic_device & sci(const int &ci)
set color index
basic_device & save(void)
save device settings
Tbbox Mbbox
place to store bounding box of print function
int Mxlabelflags
label options
void setup(const Trect &svp, const Trect &win, const int &nx, const int &ny)
function used by constructors
Tpanel & setwin(const Trect &win)
set world coordinates
int Mnx
number of subpanels
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
logarithmic scale (labels)
basic_device & scr(const int &ci, const float &cr, const float &cg, const float &cb)
set color representation
Tlinestyle Mgridstyle
grid linestyle
basic_device & slw(const int &lw)
set line width
Tlinestyle Mticksstyle
ticks linestyle
Trange x
coordinate ranges
void advance(const float *xbox, const float *ybox, const bool &nl, const float &sep)
advance to new reference position
Frltbselect (right, left, top, and bottom)
basic_device & sls(const int &ls)
set line style
basic_device & poly(int n, const float *xpts, const float *ypts)
draw polygonial line
basic_device & sfs(const int &fs)
set fill style
~Ttiledpanels()
destructor
Tboxstyle & setmode(const int &elem, const int &modes, const bool &set=true)
general mode setting
bool Minline
true if text was written previously with no nl
force exponential (labels)
Tpanel * Mpanels
array of subpanels
Tpanel & setvp(const Trect &vp)
set viewport relative to total viewport
Trange c_range01(0., 1.)
range form 0 to 1
int Mylabelflags
label options
Tboxstyle(const bool &tbox=false)
Tpanel & operator()(const int &ix, const int &iy)
return subpanel
omit first label (time scale)
degrees, minutes, and seconds (time scale)
int Myticksub
tick options
int Mxticksub
tick subintervals
void issuecommand(basic_device &dev, const Tlinestyle &linestyle, const char *xopt, const char *yopt) const
issue appropriate box command
do not include day field (time scale)
int Mytickflags
tick options
float Mynl
text reference position for carriage return
int Mxtimeflags
time scale options
basic_device & ptxt(const float &x, const float &y, const float &angle, const float &fjust, const char *text)
write text at arbitraty position
C++ extensions to PGPLOT.
float min
range [min....max]
Trect c_rect1919(c_range19, c_range19)
rect form 0.1,0.1 to 0.9,0.9
Tcol Mcol
rgb or hls colour setting
void apply(basic_device &dev) const
apply to basic device class
basic_device & shls(const int &ci, const float &ch, const float &cl, const float &cs)
set color in the HLS system
hour modulus 24h (time scale)
Fxyselect, Fhvselect (x and y, left and right)
a struct to hold colour triples i.e. rgb or hls values
Ttiledpanels & operator=(const Ttiledpanels &panels)
Ttext & space(basic_device &dev)
advance one character
float Mxtick
major tick interval
float Mjust
parameters to pgptxt
namespace containing flags for Tboxstyle
Tlinestyle & setrgb(const Tcol &rgb)
set color representation with rgb values
T limit(const T &v, const T2 &min, const T2 &max)
limit a value to min and max
Ttext & print(basic_device &dev, const char *txt, const bool &nl=false, const float &sep=0.025)
print text.
void apply(basic_device &dev) const
apply to basic device class
Trect c_rect0101(c_range01, c_range01)
rect form 0,0 to 1,1
omit leading zeros (time scale)
use superscript symbols (time scale)
Trect Mvp
the total view surface area
Tlinestyle Mlabelstyle
labels linestyle
float Myref
text reference position
bool operator!=(const Tlinestyle &ls) const
compare
bool Merase
erase box prior to plotting text
Tboxstyle & setstyle(const int &elem, const Tlinestyle &style)
set linestyle
Tpanel & settvp(const Trect &tvp)
set total viewport relative to device surface
basic_device & unsa(void)
restore device settings