Replies are inline below. On Sat, Sep 18, 2010 at 7:48 AM, Johan Mazel <[email protected]> wrote: > I just found a way to obtain the background color that I want. > I just have to use these commands before any drawing: "plscolbg 255 255 > 255;" and then "plclear ();". > I don't know if it is the canonical way to do it but anyway, it is > working... >
This is one way to make this work. Another would be to set the default indexed color map (color map 0) to another palette when you run cmake. This can be done by providing this parameter to cmake: -DDEFAULT_CMAP0_FILE=cmap0_alternate.pal cmap0_alternate.pal is one of the index color maps provided with PLplot. You can look in the data/ directory under the PLplot source tree or installation tree to see all of the indexed and continuous palettes provided out-of-the-box with PLplot. > > 2010/9/16 Johan Mazel <[email protected]> >> >> Hi >> I am trying to change the color of the background through the use of >> plscolbg. >> I am using PLplot with Cairo and GTK, the whole program being coded in >> Ocaml and thus using Ocaml bindings. >> >> I use the code from this example: >> http://plplot.svn.sourceforge.net/viewvc/plplot/trunk/examples/ocaml/xgtk_interface.ml?view=markup. >> I juste want to change the background color from black, as in default, to >> white. >> >> In order to do this, I use the following line: "plscolbg 255 255 255;". >> As it is indicated on this page >> (http://techlogbook.wordpress.com/2009/12/11/changing-background-and-front-color-in-plplot-library/), >> I added this command just before the line: "let plcairo = plinit_cairo >> ~clear: true (plot_width, plot_height) plimagecairo in" >> My guess being that plinit_cairo was actually calling plinit and thus I >> needed to change the background before. >> However, the background color does not change. >> Does anyone have a idea of the cause of this problem ? >> This is, unfortunately, due to a combination of a feature and a limitation of the Plcairo module. The feature is that the plinit_cairo function creates a new plot stream during its initialization. This is done to ease the creation of multiple plots for a single interface. The limitation is that this means any functions called before plinit_cairo will not affect the newly created plot stream, so you can't set the plot background before creating the plot device, as you just found out. I will fix this in PLplot's development branch - thank you for pointing this out! Hez ------------------------------------------------------------------------------ Start uncovering the many advantages of virtual appliances and start using them to simplify application deployment and accelerate your shift to cloud computing. http://p.sf.net/sfu/novell-sfdev2dev _______________________________________________ Plplot-general mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/plplot-general
