#530 default color in postscript incorrect

v1.0 (example)
open
nobody
None
9
2014-02-22
2013-04-26
sachahony
No

When I make a color postscript plot the background color is set to white but the default plotting color is not set to black and therefore the parts plotted using the default color do not show up in the figure.
example:

set_plot,'ps'
device,filename='test.ps',color=1
plot,[1,2]
device,/close
set_plot,'x'

I have located the place where !p.color should be forced to 0L: after line 109 in src/deviceps.hpp, but I could not figure out how.

Discussion

  • Hi,

    I've tried to look into it (this bug makes most of the plots in the docs invalid), but I've only ended up reaching this comments in plotting_misc.cpp (49-51):

    static unsigned colorTag=pStruct->Desc()->TagIndex("COLOR");
    (*static_cast<DLongGDL*>(pStruct->GetTag(colorTag, 0)))[0]=255; //PLEASE DO NOT CHANGE values here until a better color handling has been found.
    

    IIUC, this comment relates the difference between IDL's and GDL's behaviour with default values of P.COLOR:

    $ idl
    IDL> print, !P.COLOR
             255
    IDL> set_plot, 'x' & print, !P.COLOR
             255
    IDL> set_plot, 'ps' & print, !P.COLOR
               0
    IDL> set_plot, 'z' & print, !P.COLOR
             255
    

    vs.

    $ gdl
    GDL> print, !P.COLOR
             255
    GDL> set_plot, 'x' & print, !P.COLOR
        16777215
    GDL> set_plot, 'ps' & print, !P.COLOR
             255
    GDL> set_plot, 'z' & print, !P.COLOR
        16777215
    

    Gilles, Alain, Marc, any update on it?

    Best,
    Sylwester

     
  • Alain C.
    Alain C.
    2013-11-12

    Hi Sylwester

    Great you come back on this topic.

    I think the best way to progress on this topic is to clarify the situation,
    having one file with many examples (with naming conventions and IDL/GDL), and running it on various computers. We have also to take care of x86/x86_64
    and plplot versions and libps.
    I am ready to help running on the test bed I have (no more OSX unfortunately due to technical issues related to last move to OSX 10.8)

    Alain

    PS: just concatenating the examples you mention might be a good starting point,
    I know we had different behaviors just for that ...

     
  • Hi,

    When mentioning "docs", I was referring to the gdl.pdf file you get after running the "makeall" script in gdl/doc/udg. If you compare it with the old one on the website, you can notice that all plots with colours had changed, and most of them now differ from what IDL gives.

    The output from these plots are in the cvs, so running "cvs diff" in gdl/doc/udg/examples/*/gdl.ps also gives a hint which plots had changed.

    Best,
    Sylwester

     
    • Group: --> v1.0 (example)
    • Priority: 5 --> 9