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

Attachment: wxwidgets_physical_units.patch
Description: Binary data

------------------------------------------------------------------------------
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

Reply via email to