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

Home » Public Forums » archive » iplot colorbar label
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
iplot colorbar label [message #67877] Wed, 09 September 2009 07:42 Go to next message
Thibault . is currently offline  Thibault .
Messages: 9
Registered: September 2009
Junior Member
Hi,

Using iplot as a scatter plot, I assign colors to the data points
according to an array (using vert_colors) and I want to create the
corresponding colorbar with /insert_colorbar:


x=randomu(41,10)
y=randomu(50,10)

my_col=[150,255,12,160,187,245,36,58,210,170]

iplot,x,y,/insert_colorbar,rgb_table=39,sym_index=4,/
scatter,vert_colors=my_col


Doing that, the plot works and the colorbar is displayed BUT the
colorbar label goes from 0 to 1. I noticed that it goes from min to
max values of the y variable... whereas I want the label to span what
it really represents, namely the my_col array !!!

How to make the colorbar label ranging from 0 to 255 ( = the my_col
array min and max values) ?

Thank you.
Re: iplot colorbar label [message #67970 is a reply to message #67877] Wed, 16 September 2009 06:35 Go to previous messageGo to next message
Thibault . is currently offline  Thibault .
Messages: 9
Registered: September 2009
Junior Member
Here is the result of print,!version: { x86_64 linux unix linux 7.0
Oct 25 2007 64 64}

The error message is in a pop up window :"Invalid export data source
provided. Unable to continue."

The test
> iplot,findgen(10)
> pp_itool_save,'pp_iplotexample'

does the same thing...
Re: iplot colorbar label [message #67983 is a reply to message #67877] Tue, 15 September 2009 11:16 Go to previous messageGo to next message
penteado is currently offline  penteado
Messages: 866
Registered: February 2018
Senior Member
Administrator
On Sep 14, 7:21 am, "Thibault ." <garthalg...@yahoo.fr> wrote:
> Hi, I tried your pp_itool_save.pro routine but it does not work...
> When I do the example provided in the routine description, it saves
> an .isv file but not the.eps and it displays:    "Invalid export data
> source provided. Unable to continue."
> Have you ever seen this?
> Thanks.


I do not remember that happening. What is exactly the IDL version you
are using (what is the result of print,!version)?

Does that error message show on the console or in a pop up window?
Does it happen when you let the itool is allowed to make its window,
as in

iplot,findgen(10)
pp_itool_save,'pp_iplotexample'

?
Re: iplot colorbar label [message #67994 is a reply to message #67877] Mon, 14 September 2009 03:21 Go to previous messageGo to next message
Thibault . is currently offline  Thibault .
Messages: 9
Registered: September 2009
Junior Member
Hi, I tried your pp_itool_save.pro routine but it does not work...
When I do the example provided in the routine description, it saves
an .isv file but not the.eps and it displays: "Invalid export data
source provided. Unable to continue."
Have you ever seen this?
Thanks.

>
>> Yeah, i have a version previous to 7.1 and I had already noticed the
>> File->export way to save in .ps.
>> But is there any way to implement it in a routine?
>> I have to save many iplots in .ps automatically in a for loop...
>
> I did a lot of that, too, which before 7.1 I did with
>
> http://www.ppenteado.net/idl/pp_itool_save.html
> http://www.ppenteado.net/idl/pp_itool_save.pro
Re: iplot colorbar label [message #68010 is a reply to message #67877] Thu, 10 September 2009 07:34 Go to previous messageGo to next message
penteado is currently offline  penteado
Messages: 866
Registered: February 2018
Senior Member
Administrator
On Sep 10, 10:03 am, "Thibault ." <garthalg...@yahoo.fr> wrote:
>> It guesses the format by the extension in the file name.
>
>> Before 7.1, you can, in the iplot window, go to the menu file->export-
>
>>> to data file, if I remember right (in 7.1 it is in file->save).
>
> Yeah, i have a version previous to 7.1 and I had already noticed the
> File->export way to save in .ps.
> But is there any way to implement it in a routine?
> I have to save many iplots in .ps automatically in a for loop...

I did a lot of that, too, which before 7.1 I did with

http://www.ppenteado.net/idl/pp_itool_save.html
http://www.ppenteado.net/idl/pp_itool_save.pro
Re: iplot colorbar label [message #68013 is a reply to message #67877] Thu, 10 September 2009 06:03 Go to previous messageGo to next message
Thibault . is currently offline  Thibault .
Messages: 9
Registered: September 2009
Junior Member
> It guesses the format by the extension in the file name.
>
> Before 7.1, you can, in the iplot window, go to the menu file->export-
>
>> to data file, if I remember right (in 7.1 it is in file->save).
>
>

Yeah, i have a version previous to 7.1 and I had already noticed the
File->export way to save in .ps.
But is there any way to implement it in a routine?
I have to save many iplots in .ps automatically in a for loop...
Re: iplot colorbar label [message #68015 is a reply to message #67877] Thu, 10 September 2009 04:16 Go to previous messageGo to next message
penteado is currently offline  penteado
Messages: 866
Registered: February 2018
Senior Member
Administrator
On Sep 10, 7:11 am, "Thibault ." <garthalg...@yahoo.fr> wrote:
> Thanks for the routine!
>
> Indeed, I dont want the label to be the color index.
> I set my color table to a third variable z ( x and y are the
> positions).
> my_col = fix(z * 255/(max(z)-min(z)))   where z spans the range 50 to
> 800.
> I think that writing this makes the plot that i want, attributing to
> each point defined by x and y in position, the appropriate color
> according to the z value.
> Then, using your pp_colorbar_range.pro routine by setting:
>
> iplot,x,y,/insert_colorbar,rgb_table=39,sym_index=3,/
> scatter,vert_colors=my_col
> pp_colorbar_range,[min(z),max(z)],font_size=12
>
> it gives something which seems to make sense... I hope it does :)
>
> In which way the keyword colors=colors is useful??
>
> Furthermore, do you have any idea how to save the iplots as postscript
> files?

There is no colors keyword for iplot, that I am aware of.There is
color, which is used to set the color of the plot line by its rgb
values (a constant color, while vert_colors sets the color at each
vertex.

In IDL 7.1, you can save the current itool to isv, ps, eps, and a
bunch of other formats with

isave,'file.ps'

It guesses the format by the extension in the file name.

Before 7.1, you can, in the iplot window, go to the menu file->export-
> to data file, if I remember right (in 7.1 it is in file->save).
Re: iplot colorbar label [message #68112 is a reply to message #67970] Wed, 16 September 2009 20:54 Go to previous message
penteado is currently offline  penteado
Messages: 866
Registered: February 2018
Senior Member
Administrator
On Sep 16, 10:35 am, "Thibault ." <garthalg...@yahoo.fr> wrote:
> Here is the result of print,!version:    { x86_64 linux unix linux 7.0
> Oct 25 2007      64      64}
>
> The error message is in a pop up window :"Invalid export data source
> provided. Unable to continue."
>
> The test
>
>> iplot,findgen(10)
>> pp_itool_save,'pp_iplotexample'
>
> does the same thing...

Thanks. I forgot that the export source selection had changed in IDL
7.1, so I did not notice that I broke the program for older versions.
I updated the file on my website, it should work now. Please let me
know if it still does not work.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Legend for plot
Next Topic: Segmentation Fault: XQuartz update

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

Current Time: Wed Oct 08 13:35:56 PDT 2025

Total time taken to generate the page: 0.00575 seconds