Hi Phil, The main reason is that was the simplest algorithm I could come up with when I wrote the code. I'm happy to concede there may be better ways to do it, and I'd be equally happy to receive a patch to fix it.
Andrew On Wed, Nov 14, 2012 at 06:37:30AM -0800, phil rosenberg wrote: > I've just found another issue with plvect. When using autoscaling of the > vectors of data which uses a transformation it is very easy for there to be > multiple points with very small, non-zero, differences?in some of their x or > y values. This causes the scale parameter to be ridiculously small and when > using an interactive driver the arrows are then smaller than 1 pixel and are > not plotted. > ? > Is there any reason why plvect scans the whole dataset to find the minimum dx > and dy rather than just checking nearest neighbours in a smarter way (i.e, > for y differences in the y direction and x differences in the x direction)? > ? > Phil? > > ________________________________ > From: Andrew Ross <[email protected]> > To: phil rosenberg <[email protected]> > Cc: "[email protected]" <[email protected]> > Sent: Wednesday, 14 November 2012, 10:11 > Subject: Re: [Plplot-devel] poor vectors when using wxwidgets > > > Phil, > > Thanks for the patch. Before applying I decided to try the same thing > on other drivers. > > xwin - behaves the same as wxwidgets, i.e. it rescales the plot to fit > the page and distorts vectors (also text too so this is not a sensible > thing to do with xwin) > > qtwidget - maintains the aspect ratio of the plot and scales it to fit > in the window > > xcairo - makes no attempt to rescale the plot, so it may or may not > still fit in the window if the window size is changed. > > All this behaviour is rather inconsistent. It would be nice if the > main interactive drivers behaved in a similar way. What should that > behaviour be? > > Andrew > > On Tue, Nov 13, 2012 at 05:04:10PM -0800, phil rosenberg wrote: > > It turns out I've managed to solve my own problem. The wxWidgets driver was > > calling plP_setphy with constant values irrespective of the actual width > > and height of the window. I've replaced the constants with dev->width and > > dev->height which were assigned from pls->xlength and pls->ylength (which > > are int turn set by either a user or default call to plspage). I could see > > an argument for using higher resolution for AGG which has subpixel > > accuracy, but at least with this patch the distortions have been removed. > > ? > > This fixes the arrows and axes distances. > > ? > > Patch attached - tested on all three wxwidget backends. > > ? > > Phil > >? > > > > ________________________________ > >? From: phil rosenberg <[email protected]> > > To: "[email protected]" > > <[email protected]> > > Sent: Tuesday, 13 November 2012, 23:20 > > Subject: poor vectors when using wxwidgets > >? > > > > Hi > > I've just been looking at using the plvect function to add vectors to a > > plot. Unfortunately they are not coming out well. Attached is a simple > > example with [1,1] vectors plotted at every integer from 0-9 in x and y. > > You can see that the arrow heads are distorted. I've traced this through > > the code and found that it's because the? plot is scaled independantly in x > > and y in the wxWidgets driver (in this case in wxPLDevGC::DrawPolyline() ). > > This scaling AFTER the rotation of the arrow causes distortion. > > > > I'm not fully familiar with the plplot transformations from world to device > > coordinates, but I thought that this should be performed by plP_wcpcx()? > > Does anyone have any idea what could be going wrong here so I'm not > > debugging from scratch? Am I doing something wrong during initialisation? > > > > By the way, I thik this is related to another problem that I've experienced > > (but hadn't gotten round to reporting) where my y axis title moves further > > and further away from the y axis as I make my plot window wider. > > > > Any help much appreciated. > > > > Phil > > > > ------------------------------------------------------------------------------ > > Monitor your physical, virtual and cloud infrastructure from a single > > web console. Get in-depth insight into apps, servers, databases, vmware, > > SAP, cloud infrastructure, etc. Download 30-day Free Trial. > > Pricing starts from $795 for 25 servers or applications! > > http://p.sf.net/sfu/zoho_dev2dev_nov > > > _______________________________________________ > > Plplot-devel mailing list > > [email protected] > > https://lists.sourceforge.net/lists/listinfo/plplot-devel > ------------------------------------------------------------------------------ > Monitor your physical, virtual and cloud infrastructure from a single > web console. Get in-depth insight into apps, servers, databases, vmware, > SAP, cloud infrastructure, etc. Download 30-day Free Trial. > Pricing starts from $795 for 25 servers or applications! > http://p.sf.net/sfu/zoho_dev2dev_nov > _______________________________________________ > Plplot-devel mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/plplot-devel ------------------------------------------------------------------------------ Monitor your physical, virtual and cloud infrastructure from a single web console. Get in-depth insight into apps, servers, databases, vmware, SAP, cloud infrastructure, etc. Download 30-day Free Trial. Pricing starts from $795 for 25 servers or applications! http://p.sf.net/sfu/zoho_dev2dev_nov _______________________________________________ Plplot-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/plplot-devel
