Eric Firing wrote:
> John Hunter wrote:
>> On Wed, Jul 23, 2008 at 10:05 PM, Ryan May <[EMAIL PROTECTED]> wrote:
>>
>>> <grumble> Ok, it fixes the problem if I pass dpi=72 to savefig(). 
>>> Curiously,
>>> passing dpi=72 to Figure() does not have the same effect.  So now how 
>>> do I
>>
>> That is because "savefig" has its own dpi, which overrides the figure
>> dpi.  Tee ideas is that you typically want a different dpi for the UI
>> window and for the harcopy
>>
>>> fix it?  I'm really not sure what's going wrong here.  If I had to 
>>> guess,
>>> it's a problem between figure size being in inches while I'm drawing in
>>> pixels (still don't know how that works, because there's no way those 
>>> barbs
>>> are 9 pixels long).
>>
>> I'm not familiar enough with the windbarb code to know where the "9
>> pixel" thing that is bothering you is creeping in, I'm just saying
>> that using an identity transform means you are drawing in canvas
>> (pixel) space and not accounting for dpi.  The Figure instance has a
>> "dpi_scale_transform" that is designed to handle dpi scaling, and
>> updates itself when the figure dpi is changed so you don't have to
>> handle the callbacks.  Take a look at this and see if you can
>> incorporate it.  If you have troubles, Michael or I can advise
>> further.
>>
>> If you clarify the "9 pixel" problem that is bothering you, I may be
>> able to help more sooner...
> 
> Part of the problem is the horrible and misleading sizes arg in 
> PolyCollections, probably a hangover (yes, a headache) from supporting a 
> Matlab-compatible argument in scatter.  I can try to straighten this out 
> and clarify the situation after the release, not before.  I will add an 
> alternative kwarg to scatter at the same time, and hope the old usage 
> gradually dies out.

That might be part of it, I'm not sure.  My problem is that I have 
length set to 7 in the code.  That implies that when I draw, the 
distance along the y-axis between where I start and where I end is 7 
units (which is then rotated).  What gets shown on my screen (when the 
BarbCollection transform is set to IdentityTransform()) is not possibly 
7 pixels long.  My gnome-panel bar is 22 pixels high, and that looks 
like a pretty good fit to how long things are actually in the figure I 
see on screen.  This is at my default figure dpi of 72.

What else is confusing is how that relates to DPI.  When I change the 
figure's dpi, using set_dpi, (and redraw), I get physically *bigger* 
barbs.  To me, if I'm actually specifying pixels, there's no way that 
they should get bigger when I change the DPI.

Then I also can't figure out what the PS backend is doing.  If PS is 
hardcoded to 72 DPI, why does passing dpi=72 to savefig() have any effect?

I found the fig.dpi_scale_trans.  However, this then makes things too 
big on the on screen figure when I use this as the tranform for the 
BarbCollection.

Thoughts?

Ryan

-- 
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel

Reply via email to