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

Home » Public Forums » archive » help with transparent plot in version 8.2.2
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
help with transparent plot in version 8.2.2 [message #83664] Wed, 13 March 2013 20:42
Teddy Allen is currently offline  Teddy Allen
Messages: 13
Registered: October 2010
Junior Member
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
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Widget Cursor Event Freezes
Next Topic: setintersection assumes sets have no repetitions?

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

Current Time: Wed Oct 08 18:41:50 PDT 2025

Total time taken to generate the page: 0.00491 seconds