Re: IDLgrPlot Axis scaling bug? [message #51649] |
Fri, 01 December 2006 06:54 |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Laurens writes:
> David, I don't have an iPod, only an iPlot :P What now? :)
Well, now you are in big, big trouble. :-)
Cheers,
David
P.S. When I get in this situation, I always thrown the Peter
Kater, R. Carlos Nakai "Migration" CD on. The cut "Quietude"
always brings me back to the center. I HIGHLY recommend it!
--
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: IDLgrPlot Axis scaling bug? [message #51650 is a reply to message #51649] |
Fri, 01 December 2006 06:45  |
Laurens
Messages: 41 Registered: May 2006
|
Member |
|
|
David Fanning wrote:
> Laurens writes:
>
>> Got to get it a bit better accurately now with the crosshair, by using
>>
>> xs = Normalize([0,self.xsize_widget])
>> ys = Normalize([0,self.ysize_widget])
>>
>> instead of those read out range values....but it isn't perfect yet...
>
> I think you are beginning to suffer from Object Graphics
> Syndrome. This is most often characterized by throwing
> reason to the wind and grasping at any nearby straw in the
> effort to get SOMETHING to work! Treatment usually includes
> putting soothing music on the iPod and taking 10 deep
> breaths. Hope you feel better soon! :-)
>
> Cheers,
>
> David
David, I don't have an iPod, only an iPlot :P What now? :)
|
|
|
Re: IDLgrPlot Axis scaling bug? [message #51651 is a reply to message #51650] |
Fri, 01 December 2006 06:44  |
Laurens
Messages: 41 Registered: May 2006
|
Member |
|
|
David Fanning wrote:
> Laurens writes:
>
>> in the above example, i want to follow the cursor with a red cross,
>> visible by lines drawn all over the plot (one horizontal, one vertical).
>> I managed to do this by adding two IDLgrPolyline objects to the model,
>> I've already fetched any movement of the cursor, but somehow - and it
>> makes me think it has to do with that resizing / scaling again - the
>> positions of the lines don't match the position of the cursor :(
>>
>> Screenshot:
>>
>> http://sophorus.mine.nu/IDLgrPolyline.jpg
>>
>> Code:
>>
>> self.xLine = Obj_New('IDLgrPolyline')
>> self.yLine = Obj_New('IDLgrPolyline')
>> self.Model->Add, self.xLine
>> self.Model->Add, self.yLine
>> self.xAxis->GetProperty, CRange=xrange
>> self.yAxis->GetProperty, CRange=yrange
>>
>> xs = Normalize(xrange)
>> ys = Normalize(yrange)
>>
>> self.xLine->SetProperty, XCoord_Conv=xs
>> self.yLine->SetProperty, YCoord_Conv=ys
>
> Isn't this backwards? Don't you want this:
>
> self.xLine->SetProperty, YCoord_Conv=ys
> self.yLine->SetProperty, XCoord_Conv=xs
>
> I'd probably scale both lines in BOTH directions. Why not?
>
> Cheers,
>
> David
>
err, you're right :) working too long without coffee it seems :)
|
|
|
Re: IDLgrPlot Axis scaling bug? [message #51652 is a reply to message #51651] |
Fri, 01 December 2006 06:38  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Laurens writes:
> Got to get it a bit better accurately now with the crosshair, by using
>
> xs = Normalize([0,self.xsize_widget])
> ys = Normalize([0,self.ysize_widget])
>
> instead of those read out range values....but it isn't perfect yet...
I think you are beginning to suffer from Object Graphics
Syndrome. This is most often characterized by throwing
reason to the wind and grasping at any nearby straw in the
effort to get SOMETHING to work! Treatment usually includes
putting soothing music on the iPod and taking 10 deep
breaths. Hope you feel better soon! :-)
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: IDLgrPlot Axis scaling bug? [message #51653 is a reply to message #51652] |
Fri, 01 December 2006 06:33  |
Laurens
Messages: 41 Registered: May 2006
|
Member |
|
|
David Fanning wrote:
> Laurens writes:
>
>> Ok all done so far; tiny little problem now is that when the data is
>> scaled in a bit huge way (i guess), the text on the axes isn't readable
>> anymore; it just squeezes it up...
>> see http://sophorus.mine.nu/idlgrplot_axis.jpg for an example of what I
>> mean. Appearantly, some part of the scaling process isn't going well I
>> guess?
>
> The problem with object graphics, as you are learning, is
> that you have to do *everything* yourself. (What!? You said
> you wanted power, right?) I would try setting the
> RECOMPUTE_DIMENSIONS keyword on all of your text objects
> to a different value (I'd try 1 first, then 2 if this
> doesn't work). And there was a problem with this kind
> of scaling that was fixed in IDL 6.1. What version of
> IDL are you using?
>
> Cheers,
>
> David
version 6.3, as far as I know that's the latest (and the greatest :P)
one, right?
Got to get it a bit better accurately now with the crosshair, by using
xs = Normalize([0,self.xsize_widget])
ys = Normalize([0,self.ysize_widget])
instead of those read out range values....but it isn't perfect yet...
Cheers,
Laurens
|
|
|
Re: IDLgrPlot Axis scaling bug? [message #51654 is a reply to message #51653] |
Fri, 01 December 2006 06:32  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Laurens writes:
> in the above example, i want to follow the cursor with a red cross,
> visible by lines drawn all over the plot (one horizontal, one vertical).
> I managed to do this by adding two IDLgrPolyline objects to the model,
> I've already fetched any movement of the cursor, but somehow - and it
> makes me think it has to do with that resizing / scaling again - the
> positions of the lines don't match the position of the cursor :(
>
> Screenshot:
>
> http://sophorus.mine.nu/IDLgrPolyline.jpg
>
> Code:
>
> self.xLine = Obj_New('IDLgrPolyline')
> self.yLine = Obj_New('IDLgrPolyline')
> self.Model->Add, self.xLine
> self.Model->Add, self.yLine
> self.xAxis->GetProperty, CRange=xrange
> self.yAxis->GetProperty, CRange=yrange
>
> xs = Normalize(xrange)
> ys = Normalize(yrange)
>
> self.xLine->SetProperty, XCoord_Conv=xs
> self.yLine->SetProperty, YCoord_Conv=ys
Isn't this backwards? Don't you want this:
self.xLine->SetProperty, YCoord_Conv=ys
self.yLine->SetProperty, XCoord_Conv=xs
I'd probably scale both lines in BOTH directions. Why not?
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: IDLgrPlot Axis scaling bug? [message #51656 is a reply to message #51654] |
Fri, 01 December 2006 06:25  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Laurens writes:
> Ok all done so far; tiny little problem now is that when the data is
> scaled in a bit huge way (i guess), the text on the axes isn't readable
> anymore; it just squeezes it up...
> see http://sophorus.mine.nu/idlgrplot_axis.jpg for an example of what I
> mean. Appearantly, some part of the scaling process isn't going well I
> guess?
The problem with object graphics, as you are learning, is
that you have to do *everything* yourself. (What!? You said
you wanted power, right?) I would try setting the
RECOMPUTE_DIMENSIONS keyword on all of your text objects
to a different value (I'd try 1 first, then 2 if this
doesn't work). And there was a problem with this kind
of scaling that was fixed in IDL 6.1. What version of
IDL are you using?
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: IDLgrPlot Axis scaling bug? [message #51657 is a reply to message #51656] |
Fri, 01 December 2006 06:22  |
Laurens
Messages: 41 Registered: May 2006
|
Member |
|
|
Laurens wrote:
> First of all; jezus, what **** is spamming this usefull newsgroup ??
>
> Second, after my post about getting IDLgrPlot to work, the tips of david
> and his example did get it to work as it should be, though thinking in
> viewplane terms takes a bright moment ;)
> Now the viewplane is going [-0.15, -0.15, 1.22, 1.22] while the scaling
> with davids Normalize function just uses [0,0,1,1].
> So, for the plot and the axisses, 0,0,1,1 is used, while the bigger
> viewplane is needed for the axes to correctly be viewed, right?
>
> Ok all done so far; tiny little problem now is that when the data is
> scaled in a bit huge way (i guess), the text on the axes isn't readable
> anymore; it just squeezes it up...
> see http://sophorus.mine.nu/idlgrplot_axis.jpg for an example of what I
> mean. Appearantly, some part of the scaling process isn't going well I
> guess?
>
> With kind dutch regards :)
>
> Laurens
Actually, i was asking this in order to figure out something else which
i thought was the best way to proove the fact that there is in fact some
effort put into it :) but since it might be just faster to ask directly
(and of course would put even more value in this newsgroup ;)) lets try
it directly:
in the above example, i want to follow the cursor with a red cross,
visible by lines drawn all over the plot (one horizontal, one vertical).
I managed to do this by adding two IDLgrPolyline objects to the model,
I've already fetched any movement of the cursor, but somehow - and it
makes me think it has to do with that resizing / scaling again - the
positions of the lines don't match the position of the cursor :(
Screenshot:
http://sophorus.mine.nu/IDLgrPolyline.jpg
Code:
self.xLine = Obj_New('IDLgrPolyline')
self.yLine = Obj_New('IDLgrPolyline')
self.Model->Add, self.xLine
self.Model->Add, self.yLine
self.xAxis->GetProperty, CRange=xrange
self.yAxis->GetProperty, CRange=yrange
xs = Normalize(xrange)
ys = Normalize(yrange)
self.xLine->SetProperty, XCoord_Conv=xs
self.yLine->SetProperty, YCoord_Conv=ys
scaledX = mean(event.x) ;what scaling to use?
scaledY = mean(event.y)
self.xLine->SetProperty, Color=[255,0,0], Thick=1, DATA=[[scaledX, 0,
0], [scaledX, 100, 0]]
self.yLine->SetProperty, Color=[255,0,0], Thick=1, DATA=[[0, scaledY,
0], [100, scaledY, 0]]
self->Draw
--------------------------------------------
I assume i'm just not thinking the right way (one again :)), someone
that could point me in the right way?
Thnx in advance...again ;)
Laurens
|
|
|