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

Home » Public Forums » archive » Re: Iplot x labeling
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: Iplot x labeling [message #54345] Mon, 04 June 2007 12:19
jochem.verelst@gmail. is currently offline  jochem.verelst@gmail.
Messages: 19
Registered: January 2007
Junior Member
Hi David,
Thanks a lot for your efforts to help me out! To me it is really
strange that such apparently trivial problem cannot being resolved
properly in IDL.

I reported the problem. Though I can imagine you are in closer contact
with those magic software designers. If there are any advances on this
issue, please let us know.

Greetzz,
Joe



On Jun 4, 2:26 am, David Fanning <n...@dfanning.com> wrote:
> David Fanning writes:
>> This works:
>
>> IDL> iplot, x, y, xtickvalues=x, xmajor=5, xrange=[-6.5, 7.5], $
>> xtickname=Strtrim(x,2)
>
>> Which leads me to wonder if this is a documentation problem, rather
>> than an iPlot problem. The solution has an "object graphics" flavor
>> to it that the technical writer might have missed.
>
> Humm. Well, when I started to write an article about this, I
> realized this is wrong, too. Consider the following code:
>
> IDL> x = [-6.1, -4.3, 1.25, 5.1, 7.0]
> IDL> y = [5, 4, 3, 4, 5]
> IDL> iPlot, x, y, XRANGE=[-6.5, 7.5], XMAJOR=5, XTICKVALUES=x, $
> XTICKNAME=String(x, Format='(F5.2)'), SYM_INDEX=7
>
> Notice that the labels and the actual plotted values are not
> aligned. :-(
>
> I don't know. But this is clearly not right and I haven't been
> able to come up with anything to make it right in 30 minutes
> of effort. This is in IDL 6.4.
>
> I guess I would report this as a bug.
>
> 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: Iplot x labeling [message #54354 is a reply to message #54345] Sun, 03 June 2007 17:26 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
David Fanning writes:

> This works:
>
> IDL> iplot, x, y, xtickvalues=x, xmajor=5, xrange=[-6.5, 7.5], $
> xtickname=Strtrim(x,2)
>
> Which leads me to wonder if this is a documentation problem, rather
> than an iPlot problem. The solution has an "object graphics" flavor
> to it that the technical writer might have missed.

Humm. Well, when I started to write an article about this, I
realized this is wrong, too. Consider the following code:

IDL> x = [-6.1, -4.3, 1.25, 5.1, 7.0]
IDL> y = [5, 4, 3, 4, 5]
IDL> iPlot, x, y, XRANGE=[-6.5, 7.5], XMAJOR=5, XTICKVALUES=x, $
XTICKNAME=String(x, Format='(F5.2)'), SYM_INDEX=7

Notice that the labels and the actual plotted values are not
aligned. :-(

I don't know. But this is clearly not right and I haven't been
able to come up with anything to make it right in 30 minutes
of effort. This is in IDL 6.4.

I guess I would report this as a bug.

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: Iplot x labeling [message #54357 is a reply to message #54354] Sun, 03 June 2007 06:29 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
mgalloy@gmail.com writes:

> If I'm understanding you correctly,
>
> iplot, x, y, xrange=[-6.5, 7.5]
>
> will do the second part (putting the values "a bit inside"). I think
> the XTICKVALUES keyword should have solved the first part (maybe with
> adding the XMAJOR keyword), but I couldn't get the result I was
> expecting from:
>
> iplot, x, y, xtickvalues=x, xmajor=5, xrange=[-6.5, 7.5]
>
> (as a matter of fact, XTICKVALUES didn't seem to ever have any
> effect).

This works:

IDL> iplot, x, y, xtickvalues=x, xmajor=5, xrange=[-6.5, 7.5], $
xtickname=Strtrim(x,2)

Which leads me to wonder if this is a documentation problem, rather
than an iPlot problem. The solution has an "object graphics" flavor
to it that the technical writer might have missed.

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: Iplot x labeling [message #54362 is a reply to message #54357] Sat, 02 June 2007 00:25 Go to previous message
jochem.verelst@gmail. is currently offline  jochem.verelst@gmail.
Messages: 19
Registered: January 2007
Junior Member
Indeed, Mike, the second part was the easy part. :) Thanks a lot! But
you have probably also noted that the x values did not appear.

I still dont understand why the desired x values are not shown on the
x-axis.

A troubled Joe



On Jun 2, 1:05 am, "mgal...@gmail.com" <mgal...@gmail.com> wrote:
> On Jun 1, 4:13 pm, "jochem.vere...@gmail.com"
>
>
>
>
>
> <jochem.vere...@gmail.com> wrote:
>> Hi IDL gurus,
>
>> A simple question which is providing me headache.
>
>> I have, say, x=[-6,-4,1,5,7]
>> and y=[5,4,3,4,5]
>
>> now I wish to plot x and y in IPLOT in such a way that on the x-axis
>> only the x values are shown. Without any additional ticks. Hereby, the
>> outer values should not be at the very end of the plot, but rather a
>> bit inside.
>
>> Somebody can help me out?
>
>> greetzz, Joe
>
> If I'm understanding you correctly,
>
> iplot, x, y, xrange=[-6.5, 7.5]
>
> will do the second part (putting the values "a bit inside"). I think
> the XTICKVALUES keyword should have solved the first part (maybe with
> adding the XMAJOR keyword), but I couldn't get the result I was
> expecting from:
>
> iplot, x, y, xtickvalues=x, xmajor=5, xrange=[-6.5, 7.5]
>
> (as a matter of fact, XTICKVALUES didn't seem to ever have any
> effect).
>
> Mike
> --www.michaelgalloy.com- Hide quoted text -
>
> - Show quoted text -
Re: Iplot x labeling [message #54367 is a reply to message #54362] Fri, 01 June 2007 16:05 Go to previous message
Michael Galloy is currently offline  Michael Galloy
Messages: 1114
Registered: April 2006
Senior Member
On Jun 1, 4:13 pm, "jochem.vere...@gmail.com"
<jochem.vere...@gmail.com> wrote:
> Hi IDL gurus,
>
> A simple question which is providing me headache.
>
> I have, say, x=[-6,-4,1,5,7]
> and y=[5,4,3,4,5]
>
> now I wish to plot x and y in IPLOT in such a way that on the x-axis
> only the x values are shown. Without any additional ticks. Hereby, the
> outer values should not be at the very end of the plot, but rather a
> bit inside.
>
> Somebody can help me out?
>
> greetzz, Joe

If I'm understanding you correctly,

iplot, x, y, xrange=[-6.5, 7.5]

will do the second part (putting the values "a bit inside"). I think
the XTICKVALUES keyword should have solved the first part (maybe with
adding the XMAJOR keyword), but I couldn't get the result I was
expecting from:

iplot, x, y, xtickvalues=x, xmajor=5, xrange=[-6.5, 7.5]

(as a matter of fact, XTICKVALUES didn't seem to ever have any
effect).

Mike
--
www.michaelgalloy.com
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Simple output question
Next Topic: Re: Simple output question

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

Current Time: Fri Oct 10 07:56:27 PDT 2025

Total time taken to generate the page: 0.96070 seconds