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

Home » Public Forums » archive » Contour labels in IDL 8.0
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
Contour labels in IDL 8.0 [message #72800] Tue, 05 October 2010 08:32 Go to next message
OUWxGuesser is currently offline  OUWxGuesser
Messages: 7
Registered: October 2010
Junior Member
Greetings,

I'm having a heck of a time trying to get my contour labels to look
reasonable in IDL 8.0.

If I use a y axis that is in reverse (for example plotting atmospheric
pressure data from 1000 mb (at y=0) up to 100mb (y=36 in this case),
all of my labels are flipped vertically (not upside-down). I have
tried to specify the baseline and updir in the contour command in
combination with setting C_USE_LABEL_ORIENTATION=1, but these fail to
change the labels. Very frustrating.

Here's a snippet of code:

data=fltarr(12,37) (for reference)

yvals=[1000,850,700,600,500,400,300,200,100]

x=indgen(12)+1

p=1000-25*indgen(37)

image=contour(data,x,p,n_levels=ncol,c_value=clevs,/
ylog,yrange=[1000,100],xrange=[1,12],$
ytickv=yvals,xtickv=x,C_USE_LABEL_ORIENTATION=1,C_LABEL_SHOW =[0,1])

(I omitted the baseline/updir keywords... I tried just about every
combination of 0,1,-s, but nothing seems to impact the labeling.

If any of you can find something inherently wrong with my code OR know
how to get this to work I would be extremely happy! Other than this
issue, I've been relatively pleased with the transition to the new
graphics system.
Re: Contour labels in IDL 8.0 [message #93533 is a reply to message #72800] Thu, 11 August 2016 10:24 Go to previous messageGo to next message
Brian McNoldy is currently offline  Brian McNoldy
Messages: 35
Registered: July 2000
Member
I see this post is about 6 years old, but I'm wondering if there has ever been a remedy?? I am using 8.4 and am having exactly the same problem.

I have a filled contour plot with a reverse ylog axis (1000 up to 50), and then overplot line contours with their labels. The labels get plotted, but some of them are upside-down, some are correct, and some are very distorted. I have an example of a plot at http://andrew.rsmas.miami.edu/bmcnoldy/tmp/contour_labels.pn g

I'm guessing that the labeling doesn't like the ylog part (distortion) and REALLY doesn't like the reverse ylog part (upside-down).

Thanks!
Brian


On Tuesday, October 5, 2010 at 11:32:20 AM UTC-4, OUWxGuesser wrote:
> Greetings,
>
> I'm having a heck of a time trying to get my contour labels to look
> reasonable in IDL 8.0.
>
> If I use a y axis that is in reverse (for example plotting atmospheric
> pressure data from 1000 mb (at y=0) up to 100mb (y=36 in this case),
> all of my labels are flipped vertically (not upside-down). I have
> tried to specify the baseline and updir in the contour command in
> combination with setting C_USE_LABEL_ORIENTATION=1, but these fail to
> change the labels. Very frustrating.
>
> Here's a snippet of code:
>
> data=fltarr(12,37) (for reference)
>
> yvals=[1000,850,700,600,500,400,300,200,100]
>
> x=indgen(12)+1
>
> p=1000-25*indgen(37)
>
> image=contour(data,x,p,n_levels=ncol,c_value=clevs,/
> ylog,yrange=[1000,100],xrange=[1,12],$
> ytickv=yvals,xtickv=x,C_USE_LABEL_ORIENTATION=1,C_LABEL_SHOW =[0,1])
>
> (I omitted the baseline/updir keywords... I tried just about every
> combination of 0,1,-s, but nothing seems to impact the labeling.
>
> If any of you can find something inherently wrong with my code OR know
> how to get this to work I would be extremely happy! Other than this
> issue, I've been relatively pleased with the transition to the new
> graphics system.
Re: Contour labels in IDL 8.0 [message #93558 is a reply to message #72800] Thu, 18 August 2016 07:00 Go to previous messageGo to next message
Brian McNoldy is currently offline  Brian McNoldy
Messages: 35
Registered: July 2000
Member
This is still confounding me... I cannot get the contour labels to appear upright on a reversed y axis, nor can I get contour labels to appear undistorted on a log axis. And unfortunately, my plots involve BOTH (my y axis is atmospheric pressure), and I can't get anything that is acceptable to use (see example in previous post).

Is this a bug in the CONTOUR function, or am I not doing something correctly? Here is the essence of my code:

c1=contour(array,x,y,/fill,/ylog,c_value=findgen(81)*0.5,$
xrange=[0,500],yrange=[1000,50])
c2=contour(array,x,y,c_value=findgen(21)*5,c_label_show=1,c_ color=0,color='black',/overplot)

Thanks!
Brian


On Tuesday, October 5, 2010 at 11:32:20 AM UTC-4, OUWxGuesser wrote:
> Greetings,
>
> I'm having a heck of a time trying to get my contour labels to look
> reasonable in IDL 8.0.
>
> If I use a y axis that is in reverse (for example plotting atmospheric
> pressure data from 1000 mb (at y=0) up to 100mb (y=36 in this case),
> all of my labels are flipped vertically (not upside-down). I have
> tried to specify the baseline and updir in the contour command in
> combination with setting C_USE_LABEL_ORIENTATION=1, but these fail to
> change the labels. Very frustrating.
>
> Here's a snippet of code:
>
> data=fltarr(12,37) (for reference)
>
> yvals=[1000,850,700,600,500,400,300,200,100]
>
> x=indgen(12)+1
>
> p=1000-25*indgen(37)
>
> image=contour(data,x,p,n_levels=ncol,c_value=clevs,/
> ylog,yrange=[1000,100],xrange=[1,12],$
> ytickv=yvals,xtickv=x,C_USE_LABEL_ORIENTATION=1,C_LABEL_SHOW =[0,1])
>
> (I omitted the baseline/updir keywords... I tried just about every
> combination of 0,1,-s, but nothing seems to impact the labeling.
>
> If any of you can find something inherently wrong with my code OR know
> how to get this to work I would be extremely happy! Other than this
> issue, I've been relatively pleased with the transition to the new
> graphics system.
Re: Contour labels in IDL 8.0 [message #93683 is a reply to message #93558] Wed, 28 September 2016 11:24 Go to previous message
louiesun2016 is currently offline  louiesun2016
Messages: 1
Registered: September 2016
Junior Member
On Thursday, August 18, 2016 at 7:00:55 AM UTC-7, Brian McNoldy wrote:
> This is still confounding me... I cannot get the contour labels to appear upright on a reversed y axis, nor can I get contour labels to appear undistorted on a log axis. And unfortunately, my plots involve BOTH (my y axis is atmospheric pressure), and I can't get anything that is acceptable to use (see example in previous post).
>
> Is this a bug in the CONTOUR function, or am I not doing something correctly? Here is the essence of my code:
>
> c1=contour(array,x,y,/fill,/ylog,c_value=findgen(81)*0.5,$
> xrange=[0,500],yrange=[1000,50])
> c2=contour(array,x,y,c_value=findgen(21)*5,c_label_show=1,c_ color=0,color='black',/overplot)
>
> Thanks!
> Brian
>
>
> On Tuesday, October 5, 2010 at 11:32:20 AM UTC-4, OUWxGuesser wrote:
>> Greetings,
>>
>> I'm having a heck of a time trying to get my contour labels to look
>> reasonable in IDL 8.0.
>>
>> If I use a y axis that is in reverse (for example plotting atmospheric
>> pressure data from 1000 mb (at y=0) up to 100mb (y=36 in this case),
>> all of my labels are flipped vertically (not upside-down). I have
>> tried to specify the baseline and updir in the contour command in
>> combination with setting C_USE_LABEL_ORIENTATION=1, but these fail to
>> change the labels. Very frustrating.
>>
>> Here's a snippet of code:
>>
>> data=fltarr(12,37) (for reference)
>>
>> yvals=[1000,850,700,600,500,400,300,200,100]
>>
>> x=indgen(12)+1
>>
>> p=1000-25*indgen(37)
>>
>> image=contour(data,x,p,n_levels=ncol,c_value=clevs,/
>> ylog,yrange=[1000,100],xrange=[1,12],$
>> ytickv=yvals,xtickv=x,C_USE_LABEL_ORIENTATION=1,C_LABEL_SHOW =[0,1])
>>
>> (I omitted the baseline/updir keywords... I tried just about every
>> combination of 0,1,-s, but nothing seems to impact the labeling.
>>
>> If any of you can find something inherently wrong with my code OR know
>> how to get this to work I would be extremely happy! Other than this
>> issue, I've been relatively pleased with the transition to the new
>> graphics system.

I am also facing with the same problem
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Efficiently multiplying an array by a vector
Next Topic: get data points of the contoured image

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

Current Time: Wed Oct 08 15:05:59 PDT 2025

Total time taken to generate the page: 0.00735 seconds