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

Home » Public Forums » archive » Re: fit image to logarithmic color bar
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
Re: fit image to logarithmic color bar [message #62394] Mon, 08 September 2008 10:06
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
maffie writes:

> I have changed my color black to magenta on index 128 as you
> suggested, but this doesn't help. I don't really understand. I have
> plotted a lot of information on one page (plots, colorbar, some text
> information....), in the colors I like it to be, and all is visible. I
> just can't seem to get the axis appearing, although it was there when
> I ran my script yesterday. And this is the most bizarre thing to me?
>
> Maybe I should just try to plot the variables name with XYOUTS as a
> string, on the location I want them to be on? As there is no direct
> relation with the values shown in the plot...

If the axis you are trying to draw contains no direct
connection to the plot, then I would say the possibility of
it showing up anywhere you can see it is vanishingly
small. The fact that it showed up yesterday just proves
that the possibility is not zero. :-)

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: fit image to logarithmic color bar [message #62395 is a reply to message #62394] Mon, 08 September 2008 09:54 Go to previous message
matthias.demuzere is currently offline  matthias.demuzere
Messages: 32
Registered: January 2006
Member
I have changed my color black to magenta on index 128 as you
suggested, but this doesn't help. I don't really understand. I have
plotted a lot of information on one page (plots, colorbar, some text
information....), in the colors I like it to be, and all is visible. I
just can't seem to get the axis appearing, although it was there when
I ran my script yesterday. And this is the most bizarre thing to me?

Maybe I should just try to plot the variables name with XYOUTS as a
string, on the location I want them to be on? As there is no direct
relation with the values shown in the plot...
Re: fit image to logarithmic color bar [message #62398 is a reply to message #62395] Mon, 08 September 2008 09:28 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
maffie writes:

> Well, I am thinking about already a long time actually, and it doens't
> seem to bring what I was hoping for.
>
> The idea of the axis is to plot axis which solely define classes, like
> for example variable names, without any other reference to the values
> plotted in the plot itself. So I just want to draw a line with a
> number of ticks which are denoted by their variable name.
>
> The strange thing hereby is that I can not see the axis, or axis title
> or any other information from the axis...

Well, if we have eliminated everything else, then I would
say drawing white on white is a good possibility. I'm not
sure why everyone and his brother appears to think GhostView
is the best display device these days, but there are color
problems to watch out for in PostScript. Specifically,
don't use the color indices 0 or 255 to specify *any*
of your colors. Try defining a magenta color at color index
128 and then use that to draw your axis. See anything now?

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: fit image to logarithmic color bar [message #62399 is a reply to message #62398] Mon, 08 September 2008 09:15 Go to previous message
matthias.demuzere is currently offline  matthias.demuzere
Messages: 32
Registered: January 2006
Member
Well, I am thinking about already a long time actually, and it doens't
seem to bring what I was hoping for.

The idea of the axis is to plot axis which solely define classes, like
for example variable names, without any other reference to the values
plotted in the plot itself. So I just want to draw a line with a
number of ticks which are denoted by their variable name.

The strange thing hereby is that I can not see the axis, or axis title
or any other information from the axis...
Re: fit image to logarithmic color bar [message #62400 is a reply to message #62399] Mon, 08 September 2008 08:44 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
maffie writes:

> Hum, for some reason, things doesn't seem to work.
>
> I have added the Plot keyword as follows:
>
> PLOT, X, /nodata,/normal,POSITION=[0.14,0.57,1,0.58]
>
> But still I can't see any axis when putting the following after the
> keyword:
>
> myticklen=-0.01
> myticks=['C','A','N','NE','E','SE','S','SW','W','NW']
> myticks1=['P0','Rain','SWD','Tmax','Tmin','RH','F010','D010' ,'CC']
> mytickvals=[X1+9.8, X1+(9.8*2), X1+(9.8*3), X1+(9.8*4), X1+(9.8*5),
> X1+(9.8*6), X1+(9.8*7), X1+(9.8*8), X1+(9.8*9), X1+(9.8*10)]
> mytickvals1=[0.1,0.3,0.6,0.8,0.9]
> AXIS, XAXIS=0,TICKLEN=myticklen,XTITLE='Weather type',$
> XTICKS=9, XTICKNAME=myticks, XTICKV=mytickvals,color=black,
> CHARTHICK=3, CHARSIZE=1.3
> AXIS, YAXIS=0, TICKLEN=myticklen,YTICKS=8, YTICKNAME=myticks1,
> YTICKV=mytickvals1,color=black,CHARTHICK=3, CHARSIZE=1.3
>
> Any more ideas??

Get rid of the NORMAL keyword and add some LOG keywords.
Set some ranges on your axes. Spend a couple of minutes
thinking about what you are trying to do. :-)

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: fit image to logarithmic color bar [message #62401 is a reply to message #62400] Mon, 08 September 2008 08:42 Go to previous message
Juggernaut is currently offline  Juggernaut
Messages: 83
Registered: June 2008
Member
On Sep 8, 10:34 am, maffie <matthias.demuz...@geo.kuleuven.be> wrote:
> Hum, for some reason, things doesn't seem to work.
>
> I have added the Plot keyword as follows:
>
> PLOT, X, /nodata,/normal,POSITION=[0.14,0.57,1,0.58]
>
> But still I can't see any axis when putting the following after the
> keyword:
>
> myticklen=-0.01
> myticks=['C','A','N','NE','E','SE','S','SW','W','NW']
> myticks1=['P0','Rain','SWD','Tmax','Tmin','RH','F010','D010' ,'CC']
> mytickvals=[X1+9.8, X1+(9.8*2), X1+(9.8*3), X1+(9.8*4), X1+(9.8*5),
> X1+(9.8*6), X1+(9.8*7), X1+(9.8*8), X1+(9.8*9), X1+(9.8*10)]
> mytickvals1=[0.1,0.3,0.6,0.8,0.9]
> AXIS, XAXIS=0,TICKLEN=myticklen,XTITLE='Weather type',$
>         XTICKS=9, XTICKNAME=myticks, XTICKV=mytickvals,color=black,
> CHARTHICK=3, CHARSIZE=1.3
> AXIS, YAXIS=0, TICKLEN=myticklen,YTICKS=8, YTICKNAME=myticks1,
> YTICKV=mytickvals1,color=black,CHARTHICK=3, CHARSIZE=1.3
>
> Any more ideas??

I'm guessing your background is white otherwise all those color=black
will just make the axis disappear into the default black background?
Re: fit image to logarithmic color bar [message #62402 is a reply to message #62401] Mon, 08 September 2008 07:34 Go to previous message
matthias.demuzere is currently offline  matthias.demuzere
Messages: 32
Registered: January 2006
Member
Hum, for some reason, things doesn't seem to work.

I have added the Plot keyword as follows:

PLOT, X, /nodata,/normal,POSITION=[0.14,0.57,1,0.58]

But still I can't see any axis when putting the following after the
keyword:

myticklen=-0.01
myticks=['C','A','N','NE','E','SE','S','SW','W','NW']
myticks1=['P0','Rain','SWD','Tmax','Tmin','RH','F010','D010' ,'CC']
mytickvals=[X1+9.8, X1+(9.8*2), X1+(9.8*3), X1+(9.8*4), X1+(9.8*5),
X1+(9.8*6), X1+(9.8*7), X1+(9.8*8), X1+(9.8*9), X1+(9.8*10)]
mytickvals1=[0.1,0.3,0.6,0.8,0.9]
AXIS, XAXIS=0,TICKLEN=myticklen,XTITLE='Weather type',$
XTICKS=9, XTICKNAME=myticks, XTICKV=mytickvals,color=black,
CHARTHICK=3, CHARSIZE=1.3
AXIS, YAXIS=0, TICKLEN=myticklen,YTICKS=8, YTICKNAME=myticks1,
YTICKV=mytickvals1,color=black,CHARTHICK=3, CHARSIZE=1.3

Any more ideas??
Re: fit image to logarithmic color bar [message #62405 is a reply to message #62402] Mon, 08 September 2008 07:03 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
maffie writes:

> Oh, maybe one more question (although a bit off topic here):
> I have tried to used the "Axis" command, to plot my own defined X and
> Y axis. Yesterday, the axis were appearing on the plot, today, this
> command doesn't result in any axis appearing in my .eps figure? Any
> idea what could be the cause of this?

In general, you need to have set up a data coordinate system
before you can use the AXIS command. I expect it is being
drawn, but it is so tiny you can't see it. :-)

I would try using a PLOT command with the /NODATA keyword
set to draw your axes. The PLOT command will establish the
data coordinate system for you.

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: fit image to logarithmic color bar [message #62406 is a reply to message #62405] Mon, 08 September 2008 06:51 Go to previous message
matthias.demuzere is currently offline  matthias.demuzere
Messages: 32
Registered: January 2006
Member
Yes!! That's it! I worked my way around with a more complex For loop
structure, but this is just perfect! That I couldn't think of that
myself!
Thank you David!

Cheers!

Oh, maybe one more question (although a bit off topic here):
I have tried to used the "Axis" command, to plot my own defined X and
Y axis. Yesterday, the axis were appearing on the plot, today, this
command doesn't result in any axis appearing in my .eps figure? Any
idea what could be the cause of this?

Here is the short axis script:

myticklen=-0.01
myticks1=['C','A','N','NE','E','SE','S','SW','W','NW']
mytickvals1=[X1+9.8, X1+(9.8*2), X1+(9.8*3), X1+(9.8*4), X1+(9.8*5),
X1+(9.8*6), X1+(9.8*7), X1+(9.8*8), X1+(9.8*9), X1+(9.8*10)]

AXIS, XAXIS=0, TICKLEN=myticklen,XTITLE='Title',$
XTICKS=9, XTICKNAME=myticks1, XTICKV=mytickvals1,color=255,
CHARTHICK=3, CHARSIZE=1.3, YTICKV = findgen(N_ELEMENTS(Astd))+0.6
Re: fit image to logarithmic color bar [message #62408 is a reply to message #62406] Mon, 08 September 2008 06:08 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
maffie writes:

> I am trying to fit my data vector to a logarithmic colorbar. For the
> latter, I use the code suggested by David on the following link:
> http://www.dfanning.com/graphics_tips/logcb.html.
>
> Now, I have for example a vector X = [4.0, 0.04, 65.88, 3.62, 2.75,
> 7.04, 1.12,1.65]
> whereby my color bar ranges logarithmically from 0.001 to 100. So the
> colors for each of this vector point element fit my logarithmic color
> bar. I guess I should do something with the scale_vector function, or
> bytscl, but I can't seem to get it right??
>
> I need to create a vector which contains a number (corresponding to an
> element of vector X) that I can use to extract the correct number
> referring to a color from the color bar. For each element, a box is
> filled with a specific color (here for I am using POLYFILL, so my
> image is not a continuum, but a chain of boxes, each with it's own
> color. Now, I need to get the color right following my logarithmic
> scale bar....
>
> I hope this is clear and somebody can help me out?

I think you want this:

IDL> x = [4.0, 0.04, 65.88, 3.62, 2.75, 7.04, 1.12, 1.65]
IDL> Print, BytScl(x, MIN=0.001, MAX=100)
10 0 168 9 7 18 2 4

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: converting a string to an IDL command
Next Topic: :-) bug during envi 4.5 installation

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

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

Total time taken to generate the page: 0.00639 seconds