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

Home » Public Forums » archive » cgcontour and cgcolorbar irregular levels
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
cgcontour and cgcolorbar irregular levels [message #93514] Tue, 09 August 2016 10:22 Go to next message
tho.siegert is currently offline  tho.siegert
Messages: 6
Registered: April 2014
Junior Member
Hi all,

my problem is that when I use irregular spacings for contours in e.g. cgcontour, and then want to use a colorbar for it, e.g. with cgcolobar, I cannot match the colorbar and the data.

Example:
cgdisplay,1024*1.25,1024
cgloadct,39
aa = 10^(dindgen(100)/99*4-2)
cgcontour,dist(100)^2,aa,aa,levels=[2^(dindgen(10)),(dindgen (10)+1)*550],/fill,position=[0.1,0.1,0.74,0.9],/xlog,/ylog
cgcontour,dist(100)^2,aa,aa,levels=[2^dindgen(10),(dindgen(1 0)+1)*550],/noerase,position=[0.1,0.1,0.74,0.9],/xlog,/ylog
cgcolorbar,pos=[0.8,0.1,0.9,0.9],/vert,range=minmax([2^dindg en(10),(dindgen(10)+1)*550]),/ylog

You can immediately see that neither the colorbar range does not conform to the data. Also if the /ylog is removed, of course, it does not fit.

What do I have to do if I need irregular (here powerlaw for low values and linear for high values) contours and colours?

Thanks,
Thomas
cgcontour and cgcolorbar irregular levels [message #93538 is a reply to message #93514] Sat, 13 August 2016 15:50 Go to previous message
DavidF[1] is currently offline  DavidF[1]
Messages: 94
Registered: April 2012
Member
I'm thousands of miles away from my computer, but my guess is that you will have to write your own color bar routine. cgColorbar was never written with this kind of functionality in mind.

Cheers,

David
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: "Automatically indent lines" breaks copying and pasting code
Next Topic: Pros & cons of methods 1) DLM and 2) Call_External of calling C from IDL

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

Current Time: Wed Oct 08 07:16:33 PDT 2025

Total time taken to generate the page: 0.00370 seconds