comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: help with transparent plot in version 8.2.2
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: help with transparent plot in version 8.2.2 [message #83659 is a reply to message #83658] Thu, 14 March 2013 06:05 Go to previous message
Brian Daniel is currently offline  Brian Daniel
Messages: 80
Registered: July 2009
Member
On Wednesday, March 13, 2013 11:42:42 PM UTC-4, Teddy Allen wrote:
> In the past I was able to easily save any line plot with a transparent background simply by saving the plot as:
>
>
>
> plot.save,'transparent_plot.png',/TRANSPARENT
>
>
>
> Unfortunately, this does not seem to work anymore if used with the plot function with the POSITION keyword. The following lines of code do not produce an expected transparent .png .
>
>
>
>
>
> ;;;; GPCP2b is a 16,16,12 array
>
> ;;;; Lines below produce a 12 month annual rainfall time series for a 16x16 grid
>
> ;;;; in the Caribbean.
>
>
>
> DIM=16.
>
> SC=1/DIM
>
> p = plot(GPCP2b[0,0,*],position=[0,0,SC,SC],$
>
> yrange=[0,max(GPCP2b)], XSHOWTEXT=0,$
>
> YSHOWTEXT=0, color='black',TRANSPARENCY=0)
>
>
>
> for i = 0,15 do begin
>
> for j =0,15 do begin
>
> p1=plot(GPCP2b[i,j,*],position=[SC*i,SC*j,SC*(i+1),SC*(j+1)] $,/current,
>
> yrange=[0,max(GPCP2b)], XSHOWTEXT=0, YSHOWTEXT=0, color='black')
>
> endfor
>
> endfor
>
> p1.save,'C:\datasets\testTRANS.png',/TRANSPARENT
>
>
>
>
>
>
>
> I have tried various combinations of using BACKGROUND_COLOR and BACKGROUND_TRANSPARENCY in the plot commands, but nothing works.
>
>
>
> This produces a transparent plot:
>
> p = plot(GPCP2b[0,0,*],yrange=[0,max(GPCP2b)], XSHOWTEXT=0, YSHOWTEXT=0, $ color='black')
>
> p.save,'C:\datasets\testTRANS.png',/TRANSPARENT
>
>
>
> However, this DOES NOT:
>
> p = plot(GPCP2b[0,0,*],position=[0,0,SC,SC],yrange=[0,max(GPCP2b )],$ XSHOWTEXT=0,YSHOWTEXT=0,color='black')
>
> p.save,'C:\datasets\testTRANS.png',/TRANSPARENT
>
>
>
>
>
> Any tips would be greatly appreciated. Thank you.
>
> teddy

Have you tried using the Layout keyword instead of Position?
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: cgPlotS and cgColorBar issues
Next Topic: setcurrent and buffer don't work together?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 15:28:29 PDT 2025

Total time taken to generate the page: 0.00409 seconds