Unequally spaced ticklabels with the FSC_COLORBAR function [message #86366] |
Thu, 31 October 2013 01:49  |
Karlo Janos
Messages: 31 Registered: July 2008
|
Member |
|
|
Hi,
I have found an issue with the FSC_COLORBAR function.
I wondered why the ticklabels were not distributed equally in the given
range in my example (the line with the "levels" variable is taken from
"fsc_colorbar__define.pro"):
IDL> minval = 46.8614502
IDL> maxval = 46.8615112
IDL> divisions = 10
IDL> levels = minval >
(INDGEN(divisions+1)*(maxval-minval)/divisions+minval) < maxval
IDL> pm, levels, FORMAT='(F0.6)'
46.861450
46.861458
46.861462
46.861469
46.861473
46.861481
46.861488
46.861492
46.861500
46.861504
46.861511
The reason is that when I call the function with "divisions" being an
integer the above result occurs. A change to a DOUBLE value yields the
correct result:
IDL> divisions = 10d0
IDL> levels = minval >
(INDGEN(divisions+1)*(maxval-minval)/divisions+minval) < maxval
IDL> pm, levels, FORMAT='(F0.6)'
46.861450
46.861456
46.861462
46.861469
46.861475
46.861481
46.861487
46.861493
46.861499
46.861505
46.861511
IDL>
David, if you are reading this, please consider a floating point
variable for the division by the variable "divisions".
Regards
Karlo
|
|
|
Re: Unequally spaced ticklabels with the FSC_COLORBAR function [message #86367 is a reply to message #86366] |
Thu, 31 October 2013 05:11   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Karlo Janos writes:
> David, if you are reading this, please consider a floating point
> variable for the division by the variable "divisions".
Karlo, if you are reading this, please update your Coyote Library to
something that is less than 10 years old! :-)
minval = 46.8614502
maxval = 46.8615112
cgcolorbar, range=[minval, maxval], divisions=10d, format='(F0.6)'
You can find the Library here:
http:/www.idlcoyote.com/programs/zip_files/coyotelibrary.zip
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.")
|
|
|
Re: Unequally spaced ticklabels with the FSC_COLORBAR function [message #86369 is a reply to message #86367] |
Thu, 31 October 2013 06:30  |
Karlo Janos
Messages: 31 Registered: July 2008
|
Member |
|
|
Hehe, nice joke. Actually I downloaded your library yesterday just to
make sure that I _have_ the latest version. ;)
Anyway, if I understand your humorous hint correctly I should use
"cgcolorbar".
A quick check showed me that
cgcolorbar, range=[minval, maxval], divisions=10
and
cgcolorbar, range=[minval, maxval], divisions=10d
yield the same results.
Thanks for your reply!
Regards
Karlo
31.10.2013 13:11, David Fanning:
> Karlo Janos writes:
>
>> David, if you are reading this, please consider a floating point
>> variable for the division by the variable "divisions".
>
> Karlo, if you are reading this, please update your Coyote Library to
> something that is less than 10 years old! :-)
>
> minval = 46.8614502
> maxval = 46.8615112
> cgcolorbar, range=[minval, maxval], divisions=10d, format='(F0.6)'
>
> You can find the Library here:
>
> http:/www.idlcoyote.com/programs/zip_files/coyotelibrary.zip
>
> Cheers,
>
> David
>
>
>
|
|
|