Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

plots are cut off using set_plot,'ps' creating huge plots

Help
Michael
2013-09-26
2014-08-29
  • Michael
    Michael
    2013-09-26

    I am trying to create plots, but they are all way too big. For example, the simple command,

    set_plot,'ps'
    device,filename='plot.eps',/decomposed,/encapsulated
    plot,[1,2,3,4,5],[1,2,3,4,5],psym=4
    device,/close

    produces a plot that extends well beyond a full page so that the x-axis cuts off at 4.2 and the y-axis cuts off at 3.4. But, if I use set_plot,'x' instead then I can plot fine. I have tried setting the keywords [x][y]size, inches, and scale_factor keywords (together and separately), but they do nothing. What else can I try to reduce the size of my postscript plots?

    Thanks for any suggestions.

     
  • Alain C.
    Alain C.
    2013-09-27

    which GDL version do you use ?
    Which Plplot version do you use ? (>= 5.9.7 would be better)

    with the CVS version, your example is OK for me

    GDL> print, !gdl
    { 0.9.3 CVS Sep 26 2013 1380146400}

    Alain

     
  • Michael
    Michael
    2013-09-27

    I am using gdl 0.9.2 (the latest in the Ubuntu 12.04 repositories) and plplot version 5.9.9. I tested my simple plot with gnuplot as well and got the same problem. I can use cups to print documents to .ps files and give the correct size, so I don't know what the issue is. Is there a plplot or system wide setting I need to change maybe?

     
  • Michael
    Michael
    2013-09-27

    I have some new information. When I open my .eps file with evince it says the paper size is prc3 Envelope, Landscape (6.86 × 4.89 inch). But then if I use ps2pdf, the resulting PDF file says Paper Size: US Letter, Portrait (8.50 × 11.00 inch), and it looks fine. Or if I import the .eps into LaTeX and create a DVI file it looks fine. If I try to use /inches and [x][y]size, the paper size reported by evince doesn't change.

     
  • giloo
    giloo
    2013-09-27

    Unfortunately this feature has only been avoided in the cvs version and the 0.9.4 version coming soon. It is still present in 0.9.3 . The behaviour of showing/printing an eps file is by nature undefined since the eps should be embedded in another document and it is that document that define paper size and margins... That is what ps2pdf does for example.

     
  • Michael
    Michael
    2013-10-03

    ah, I see, that's really good to know. Thank you for the responses!

     
  • RB
    RB
    2014-08-28

    I am having the same problem using gdl 0.9.4 and plplot 5.9.6-5, downloaded today on my mac with OSX 10.9.4. The little test code is below: using set_plot,'x' its fine, but using set_plot,'ps' it cuts off x and y axes, and no combination of device settings (size/position) fixes it.

    Is there a known work around/solution or should I resign myself to purchasing IDL?

    Thanks in advance.

    pro plot_test
    X=indgen(20)
    z=10
    X-0.5X^2
    set_plot,'ps'
    device, filename='test_plot.ps'
    device,/encapsulated
    device,xoffset=0
    plot,x,z
    device,/close
    end

     
  • Alain C.
    Alain C.
    2014-08-29

    Could you update to more recent plplot ?
    (due to Aqua change, might be difficult to compile last plplot on OSX ! [you need to edit a file])

    I tested today on three Linux boxes on the CVS version:
    -1- CentOS 5.x and plplot 5.9.7
    -2- Ubuntu 12.04 and plplot 5.9.9-2ubuntu2
    -3- Debian and plplot 5.9.9-5

    Output is "wrong" on -1- and OK for the 2 others.

    You can see below that the differences between PS outputs
    are very very limited !!!!

    FYI, all 3 created perfect SVG outputs ...

    set_plot,'svg'
    device, filename='test_plot.svg'
    plot,x,z
    device,/close

    test_plot1.ps : generated on Centos, plplot 5.9.7
    test_plot3.ps : generated on Debian, plplot 5.9.9-5

    diff test_plot1.ps test_plot3.ps
    5,6c5,6
    < %%Creator: PLplot Version 5.9.7
    < %%CreationDate: Fri Aug 29 13:58:45 2014


    %%Creator: PLplot Version 5.9.9
    %%CreationDate: Fri Aug 29 14:21:41 2014
    77c77
    < /B {Z -160 -160 M -160 3759 D 2859 3759 D 2859 -160 D -160 -160 closepath} def


    /B {Z 0 0 M 0 3599 D 2699 3599 D 2699 0 D 0 0 closepath} def
    87,88c87,88
    < 32 @hoffset
    < 32 @voffset


    -53 @hoffset
    -201 @voffset
    94c94
    < 0.0000 0.0000 0.0000 C S


    1.0000 G S
    96,97c96,97
    < 0.0706 0.0039 0.0039 C S
    < 0.0000 0.0000 0.0000 C Z


    0.0000 G S
    0.0000 G Z