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

Home » Public Forums » archive » Re: getting an IDLgrPlot drawn
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: getting an IDLgrPlot drawn [message #51475] Fri, 24 November 2006 07:49
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Laurens writes:

> Now need to correct that axis to the correct scale, need to change
> range-property for that then?

Also, for the people listening in, be sure you use the
*calculated* range in the scaling, not the range you
*asked* for when you made the axis. Because IDL *always*
autoscales axis unless you expressly forbid it, the
calculated range is very often different from the
requested range.

If you fail to do this, your data points will be
off every so slightly, which you won't realize
until the big presentation when your arch nemesis
points it out to you in front of hundreds of people. :-)

This is explained explicitly in the XPLOT code.

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: getting an IDLgrPlot drawn [message #51476 is a reply to message #51475] Fri, 24 November 2006 07:38 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Laurens writes:

> Now need to correct that axis to the correct scale, need to change
> range-property for that then?

Better have a look at that XPLOT program. It's pretty
well documented. :-)

http://www.dfanning.com/programs/xplot.pro

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: getting an IDLgrPlot drawn [message #51477 is a reply to message #51476] Fri, 24 November 2006 07:30 Go to previous message
Laurens is currently offline  Laurens
Messages: 41
Registered: May 2006
Member
Laurens wrote:
> David Fanning wrote:
>> Laurens writes:
>>
>>> At first I was kinda embarrassed to ask this but after spending my
>>> complete day at finding a solution which appearantly I didn't find, I
>>> don't know if the embarrassement would be fair :)
>>
>> By the way, if your time is worth anything at all, buy
>> Ronn Kling's excellent introduction to object graphics,
>> _Power Graphics with IDL_. It will save you MANY hours
>> of frustration! :-)
>>
>> http://www.kilvarock.com/books/powergraphics.htm
>>
>> Cheers,
>>
>> David
>>
> thnx for the tip! Will ask the boss if that's doable ;)
>
> Now need to correct that axis to the correct scale, need to change
> range-property for that then?
> Hmz, maybe a solid introduction to obj_graph would be bad hehe :)
>
> GrtZ, Laurens
>
> p.s. if your ::::: key is giving problems, why not use the old-style
> alt-058 haha :D
would / wouldn't, what's the difference anyway :D
Re: getting an IDLgrPlot drawn [message #51478 is a reply to message #51477] Fri, 24 November 2006 07:27 Go to previous message
Laurens is currently offline  Laurens
Messages: 41
Registered: May 2006
Member
David Fanning wrote:
> Laurens writes:
>
>> At first I was kinda embarrassed to ask this but after spending my
>> complete day at finding a solution which appearantly I didn't find, I
>> don't know if the embarrassement would be fair :)
>
> By the way, if your time is worth anything at all, buy
> Ronn Kling's excellent introduction to object graphics,
> _Power Graphics with IDL_. It will save you MANY hours
> of frustration! :-)
>
> http://www.kilvarock.com/books/powergraphics.htm
>
> Cheers,
>
> David
>
thnx for the tip! Will ask the boss if that's doable ;)

Now need to correct that axis to the correct scale, need to change
range-property for that then?
Hmz, maybe a solid introduction to obj_graph would be bad hehe :)

GrtZ, Laurens

p.s. if your ::::: key is giving problems, why not use the old-style
alt-058 haha :D
Re: getting an IDLgrPlot drawn [message #51479 is a reply to message #51478] Fri, 24 November 2006 07:22 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Laurens writes:

> Without having looked at your xplot example the "normalizing" is done
> through;
>
> info.Plot->getProperty, XRANGE = xrange, YRANGE = yrange
>
> info.Plot->setProperty, XCOORD_CONV = norm_coord(xrange)
> info.Plot->setProperty, YCOORD_CONV = norm_coord(yrange)
>
> I assume that's good enough? Will check your xplot example in a minute...

I found NORM_COORD to be sufficient if your axis always
starts at 0. If it starts somewhere else, NORM_COORD lets
you down. That's why I wrote NORMALIZE.

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: getting an IDLgrPlot drawn [message #51480 is a reply to message #51479] Fri, 24 November 2006 07:20 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Laurens writes:

> By the way; i'm getting redirected to http://www.w3.org/Protocols/ when
> trying that url?

My damn :::::::: key is giving me problems!
My keyboard seems to be wearing out faster than I am. :-(

http://www.dfanning.com/programs/xplot.pro

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: getting an IDLgrPlot drawn [message #51481 is a reply to message #51480] Fri, 24 November 2006 07:15 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Laurens writes:

> At first I was kinda embarrassed to ask this but after spending my
> complete day at finding a solution which appearantly I didn't find, I
> don't know if the embarrassement would be fair :)

By the way, if your time is worth anything at all, buy
Ronn Kling's excellent introduction to object graphics,
_Power Graphics with IDL_. It will save you MANY hours
of frustration! :-)

http://www.kilvarock.com/books/powergraphics.htm

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: getting an IDLgrPlot drawn [message #51482 is a reply to message #51481] Fri, 24 November 2006 07:16 Go to previous message
Laurens is currently offline  Laurens
Messages: 41
Registered: May 2006
Member
Laurens wrote:
> David Fanning wrote:
>> Laurens writes:
>>
>>> Now, when I execute this code, I don't get what I want. I get some
>>> strange lines, of which you can view the result at
>>> http://sophorus.mine.nu/idlgrplot_weird.jpg.
>>
>> Humm. Well, I think the problem is that you have a misunderstanding
>> of what you are doing with the Viewplane rectangle. It seems
>> to be you think this might be the size of the window used to
>> view the plot. In fact, it is establishing the coordinate
>> system you plan to use for viewing the plot. Two different
>> things.
>>
>> When I first started with object graphics (and even now, come
>> to think of it) I preferred to set up my coordinate system to
>> go from 0 to 1 (what we refer to in direct graphics as a normalized
>> coordinate system). I was familiar with that system, I knew how to lay
>> things out in a window using
>> that system, etc. But what that means is that all your data,
>> then, has to be scaled so that it fits into that system.
>> Since I did this over and over again, I simply wrote a small
>> routine to do this for me, which I named NORMALIZE.
>>
>> You can see how I would construct a simple plot like you
>> want in the program XPLOT, which you can find on my web
>> page:
>>
>> http//www.dfanning.com/programs/xplot.pro
>>
>> Notice that I don't bother with a scene object. It is really not
>> necessary unless you plan to have multiple plots in the
>> same window.
>>
>> Cheers,
>>
>> David
>>
>> P.S. The weird lines in your output indicate a mismatch
>> between the data in the plot and the coordinate system
>> you have chosen. Most people don't see anything in this
>> situation, so you are MUCH luckier than most! :-)
>
> By the way; i'm getting redirected to http://www.w3.org/Protocols/ when
> trying that url?
OMG :| So stupid haha, forgot the colon ;)
Re: getting an IDLgrPlot drawn [message #51483 is a reply to message #51481] Fri, 24 November 2006 07:14 Go to previous message
Laurens is currently offline  Laurens
Messages: 41
Registered: May 2006
Member
David Fanning wrote:
> Laurens writes:
>
>> Now, when I execute this code, I don't get what I want. I get some
>> strange lines, of which you can view the result at
>> http://sophorus.mine.nu/idlgrplot_weird.jpg.
>
> Humm. Well, I think the problem is that you have a misunderstanding
> of what you are doing with the Viewplane rectangle. It seems
> to be you think this might be the size of the window used to
> view the plot. In fact, it is establishing the coordinate
> system you plan to use for viewing the plot. Two different
> things.
>
> When I first started with object graphics (and even now, come
> to think of it) I preferred to set up my coordinate system to
> go from 0 to 1 (what we refer to in direct graphics as a
> normalized coordinate system). I was familiar with that
> system, I knew how to lay things out in a window using
> that system, etc. But what that means is that all your data,
> then, has to be scaled so that it fits into that system.
> Since I did this over and over again, I simply wrote a small
> routine to do this for me, which I named NORMALIZE.
>
> You can see how I would construct a simple plot like you
> want in the program XPLOT, which you can find on my web
> page:
>
> http//www.dfanning.com/programs/xplot.pro
>
> Notice that I don't bother with a scene object. It is really
> not necessary unless you plan to have multiple plots in the
> same window.
>
> Cheers,
>
> David
>
> P.S. The weird lines in your output indicate a mismatch
> between the data in the plot and the coordinate system
> you have chosen. Most people don't see anything in this
> situation, so you are MUCH luckier than most! :-)

By the way; i'm getting redirected to http://www.w3.org/Protocols/ when
trying that url?
Re: getting an IDLgrPlot drawn [message #51484 is a reply to message #51483] Fri, 24 November 2006 07:12 Go to previous message
Laurens is currently offline  Laurens
Messages: 41
Registered: May 2006
Member
I noticed :) Got a line from another ng-posting,

info.View->SetProperty, VIEWPLANE_RECT = [-0.1, -0.1, 1.2, 1.2]

which fixed a lot :)
I actually see a line being drawn and if that's not enough, I also see
an axis (though its ugly huge big, and just goes from 0 to 1 which
doesn't correspond to my data).

Without having looked at your xplot example the "normalizing" is done
through;

info.Plot->getProperty, XRANGE = xrange, YRANGE = yrange

info.Plot->setProperty, XCOORD_CONV = norm_coord(xrange)
info.Plot->setProperty, YCOORD_CONV = norm_coord(yrange)

I assume that's good enough? Will check your xplot example in a minute...

So Viewplane is not the actual pixels but just from 0.0 to
1.0....hmz...could make sense i guess...


GrtZ, Laurens

I'm so glad I was lucky...feels good to be lucky, though doesn't feel
good to be lucky and don't get nothing back for it hehe :)

David Fanning wrote:
> Laurens writes:
>
>> Now, when I execute this code, I don't get what I want. I get some
>> strange lines, of which you can view the result at
>> http://sophorus.mine.nu/idlgrplot_weird.jpg.
>
> Humm. Well, I think the problem is that you have a misunderstanding
> of what you are doing with the Viewplane rectangle. It seems
> to be you think this might be the size of the window used to
> view the plot. In fact, it is establishing the coordinate
> system you plan to use for viewing the plot. Two different
> things.
>
> When I first started with object graphics (and even now, come
> to think of it) I preferred to set up my coordinate system to
> go from 0 to 1 (what we refer to in direct graphics as a
> normalized coordinate system). I was familiar with that
> system, I knew how to lay things out in a window using
> that system, etc. But what that means is that all your data,
> then, has to be scaled so that it fits into that system.
> Since I did this over and over again, I simply wrote a small
> routine to do this for me, which I named NORMALIZE.
>
> You can see how I would construct a simple plot like you
> want in the program XPLOT, which you can find on my web
> page:
>
> http//www.dfanning.com/programs/xplot.pro
>
> Notice that I don't bother with a scene object. It is really
> not necessary unless you plan to have multiple plots in the
> same window.
>
> Cheers,
>
> David
>
> P.S. The weird lines in your output indicate a mismatch
> between the data in the plot and the coordinate system
> you have chosen. Most people don't see anything in this
> situation, so you are MUCH luckier than most! :-)
Re: getting an IDLgrPlot drawn [message #51486 is a reply to message #51484] Fri, 24 November 2006 07:04 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Laurens writes:

> Now, when I execute this code, I don't get what I want. I get some
> strange lines, of which you can view the result at
> http://sophorus.mine.nu/idlgrplot_weird.jpg.

Humm. Well, I think the problem is that you have a misunderstanding
of what you are doing with the Viewplane rectangle. It seems
to be you think this might be the size of the window used to
view the plot. In fact, it is establishing the coordinate
system you plan to use for viewing the plot. Two different
things.

When I first started with object graphics (and even now, come
to think of it) I preferred to set up my coordinate system to
go from 0 to 1 (what we refer to in direct graphics as a
normalized coordinate system). I was familiar with that
system, I knew how to lay things out in a window using
that system, etc. But what that means is that all your data,
then, has to be scaled so that it fits into that system.
Since I did this over and over again, I simply wrote a small
routine to do this for me, which I named NORMALIZE.

You can see how I would construct a simple plot like you
want in the program XPLOT, which you can find on my web
page:

http//www.dfanning.com/programs/xplot.pro

Notice that I don't bother with a scene object. It is really
not necessary unless you plan to have multiple plots in the
same window.

Cheers,

David

P.S. The weird lines in your output indicate a mismatch
between the data in the plot and the coordinate system
you have chosen. Most people don't see anything in this
situation, so you are MUCH luckier than most! :-)
--
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: getting an IDLgrPlot drawn
Next Topic: Re: PLOT and colors

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

Current Time: Fri Oct 10 14:51:51 PDT 2025

Total time taken to generate the page: 0.00579 seconds