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

Home » Public Forums » archive » simplest contour & .png
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
simplest contour & .png [message #80011] Thu, 26 April 2012 06:39 Go to previous message
Leslie Moy is currently offline  Leslie Moy
Messages: 4
Registered: August 2011
Junior Member
It seems like it should be easy...

I have a 2D array C(20,20) and i want to make a simple figure with
20x20 colored boxes. I started with a CG contour template but have two
questions.

1. i assumed there must be a command to Not make it contour and just
put in a colored box. is there such a thing? or am i starting out
wrong with 'contour'?

2. i want to output to a .png file. but i get two figures with my code
below - one of the contour plot, the other of the colorbar. normally i
would think to add in /overplot to cgcolorbar but that gives me an
error.

cgwindow
nlevels=12
loadct,33,ncolors=nlevels,bottom=1
step=(max(C)-min(C))/nlevels
levels=indgen(nlevels)*step+min(C)
setdecomposedstate,0,currentstate=currentstate

cgcontour,C,/fill,Levels=levels,position=[0.125,0.125,0.95,0 .8],$
background=cgcolor('white'),color=cgcolor('black'),$
xstyle=1,ystyle=1,c_colors=indgen(nlevels)+1,/window

setdecomposedstate,currentstate
cgcolorbar,range=[min(C),max(C)],divisions=12,xticklen=1,xmi nor=0,$
annotatecolor='black',ncolors=12,bottom=1, $

position=[0.125,0.915,0.955,0.95],charsize=1.00,format='(F0. 4)'

cgcontrol,create_png='tt.png'
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Re: IDL v7.0 "native" colourbar procedure?
Next Topic: Relationship between IDLgrXXXX and associated NG functions. Was: IDL documentation gripe - How to erase a new graphics window?

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

Current Time: Sat Oct 11 21:41:08 PDT 2025

Total time taken to generate the page: 0.31628 seconds