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

Home » Public Forums » archive » colorbar
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: colorbar [message #88411 is a reply to message #88410] Wed, 23 April 2014 06:52 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
shbhuk@gmail.com writes:

> On using cgcolorbar and tvim for the same, the colorbar obtained does not match with the color values in the image.

Yes, because you scale your image into 255 values, but use only 100
colors in your color bar. If you want to match your image, the values in
the image have to match the colors in the color bar.

cgloadct, 4, ncolors=100
grid = cgDemodata(18)
grid = bytscl(grid, Top=99, Min=0, Max=100)
cgImage, grid, Position=[0.125, 0.1, 0.925, 0.8], /Axes
cgColorbar, ncolors=100, range=[0, 100]

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
[Message index]
 
Read Message
Read Message
Previous Topic: Reading a Python numpy save (.npy) file into IDL
Next Topic: How to delete a variable

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

Current Time: Wed Oct 08 15:56:08 PDT 2025

Total time taken to generate the page: 0.00395 seconds