From: Werner S. <sm...@ia...> - 2005-11-09 14:25:45
|
Hi plplot developers, I'm working on the wxWidgets driver and looking at the other drivers I couldn't find out where the best place is to clear the background and which color I should use, when a new plot is started. Is the function plD_bop supposed to clear the background of the plot? Which color should be used and how do I get it. Or should the background always cleared with black (or white) color? Thanks for any information on that. Regards, Werner |
From: Alan W. I. <ir...@be...> - 2005-11-09 17:58:45
|
On 2005-11-09 15:25+0100 Werner Smekal wrote: > Hi plplot developers, > > I'm working on the wxWidgets driver and looking at the other drivers I > couldn't find out where the best place is to clear the background and > which color I should use, when a new plot is started. > > Is the function plD_bop supposed to clear the background of the plot? > Which color should be used and how do I get it. > > Or should the background always cleared with black (or white) color? > > Thanks for any information on that. See http://plplot.sourceforge.net/docbook-manual/plplot-html-5.5.3/color.html (the cmap0 section) for an explanation of how the background colour is set. One of the functions mentioned there is plscolbg to set the background colour. That allows the user to set any background colour they choose. Usually, there is also a "g" form of such functions to "get" the information that was set, and http://plplot.sourceforge.net/docbook-manual/plplot-html-5.5.3/plgcolbg.html documents the "get" form. So far so good, but no existing device driver actually uses plgcolbg to obtain the background colour that was set by the user so I suspect plgcolbg was created after most of the device drivers were already coded. But looking at the code for plgcolbg in src/plctrl.c, I spotted this section of ps.c with similar functionality: r = ((PLFLT) pls->cmap0[0].r) / 255.; g = ((PLFLT) pls->cmap0[0].g) / 255.; b = ((PLFLT) pls->cmap0[0].b) / 255.; Similarly, in other device drivers look for anything that uses cmap0[0]. Hope this background colour information helps you to get started. Alan __________________________ Alan W. Irwin email: ir...@be... phone: 250-727-2902 Astronomical research affiliation with Department of Physics and Astronomy, University of Victoria (astrowww.phys.uvic.ca). Programming affiliations with the FreeEOS equation-of-state implementation for stellar interiors (freeeos.sf.net); PLplot scientific plotting software package (plplot.org); the Yorick front-end to PLplot (yplot.sf.net); the Loads of Linux Links project (loll.sf.net); and the Linux Brochure Project (lbproject.sf.net). __________________________ Linux-powered Science __________________________ |