simplest contour & .png [message #80011] |
Thu, 26 April 2012 06:39  |
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'
|
|
|
Re: simplest contour & .png [message #80127 is a reply to message #80011] |
Mon, 30 April 2012 10:28  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
David Fanning writes:
> No, coyote_library_1.12.6 will.
I should say "does", because I just did it.
A little crazy around here this morning. I'm on the verge
of publishing some of my *real* writing (nothing whatsoever
to do with IDL) as an e-book and then there was a death
in the family, so we have a lot of balls in the air today.
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|
Re: simplest contour & .png [message #80128 is a reply to message #80011] |
Mon, 30 April 2012 10:23  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Paul van Delst writes:
> Does the "coyote_library_1.12.5" tag include these latest updates?
No, coyote_library_1.12.6 will.
> The google-code repo browser is pretty brain dead regarding timeline
browsing and the "committed changes" list doesn't
> have any entries for tag creation.
>
> Your library is part of our repository as well and, as such, I'd rather provide a tagged version than one from trunk.
> The last tagged version mentioned on your project page is v1.11.0 (from 03 March)
Yes, you are having me tag these so often, I would have to
get paid double my current salary to spend my time updating
the project page. I now have Twitter, Facebook, and Google +
to keep up with, too!
> p.s. I really like the "Issues" page on your google code site. Of the
idl-coyote project it states: "This project
> currently has no issues." Man... I lay awake at night dreaming about reaching that stage with my software projects.
Well, I think it should say "no issues I feel like dealing with at
the moment." I tend to fix any issue in find in less time than it takes
me to write about it, which probably explains the overly aggressive
tag releases. :-)
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|