Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Color JPG plot

27 views
Skip to first unread message

cico

unread,
Mar 7, 2013, 6:56:44 AM3/7/13
to
Dear everyone,

I am quite novel of IDL and any help will be much appreciated, that's the issue:

I am trying to get a jpg figure of a coloured plot but what that I obtaining it’s a jpg with three similar plots. Something is definitely wrong but I am able to find what the problem is, could you please help me.

Many thanks

Below the code that I wrote:

------------------------------------------------
pro plot_jpg

;set Z buffer
set_plot,'Z',/copy
device,set_resolution=[700,450],Z_buffer=0
erase

;set color
RED = [0, 1, 1, 0, 0,1]
GREEN = [0, 1, 0, 1, 0,1]
BLUE = [0, 1, 0, 0, 1,0]
tvlct, Red * 255, Green * 255, Blue * 255

;data
a= findgen(100)
b= sin(a)/exp(a/20)
Plot, a,b, color=5

im=tvrd(/true)
write_jpeg,'test.jpeg',im,/true
device,Z_Buffer=1
set_plot,'WIN'

end
------------------------------------------------
0 new messages