From: Hezekiah M. Carty <hezekiahcarty@us...> - 2010-09-18 20:21:07
On Sat, Sep 18, 2010 at 3:57 PM, Alan W. Irwin
> Hi Hez:
> Could you look into this please? I am positive that plclear
> is not needed to set the background colour for all PLplot languages
> other than OCaml so I suspect there is a subtle OCaml bug being
> revealed here by Johan's experiments.
Sorry, I think Johan and I worked through this off-list.
The problem arose because the plinit_cairo function in the OCaml
bindings creates a new plot stream using plmkstrm. Therefore, any
PLplot configuration applied before plinit_cairo will have no effect
on the newly created plot because they were acting on a different plot
stream. I wrote the code this way to make it easier to have multiple,
independent plot streams in a single program (GUI or otherwise).
I committed a change to PLplot trunk (revision 11191) which adds the
ability for a user to specify anything they would like to run after
the new stream is created but before plinit is called. The most
common use for this would be for things like setting a custom
background color or calling plparseopts to apply options from PLplot's
command line arguments.
I hope this makes sense. This functionality was already in the core
OCaml bindings but I had not added this support to the OCaml + PLplot
+ Cairo module until this commit.
Thank you for following up on this,