SourceForge logo
SourceForge logo
Menu

matplotlib-devel

From: Eric F. <ef...@ha...> - 2010年04月18日 00:41:48
Jeff,
Basemap methods like plot() include a "draw_if_interactive" command, 
followed by a call to the set_axes_limits() method, which ends with
 # force draw if in interactive mode.
 if is_interactive():
 figManager = _pylab_helpers.Gcf.get_active()
 figManager.canvas.draw()
It seems to me that you could eliminate all those "draw_if_interactive" 
blocks from plot etc., and replace the end block of set_axes_limits() with
 if is_interactive():
 import matplotlib.pyplot as plt
 plt.draw_if_interactive()
The advantages would be reduced clutter in the drawing methods, and 
consistent use of draw_if_interactive. I think the latter would make 
interactive running of functions and subclasses built on basemap more 
efficient by reducing redundant draw operations.
It also looks like at least most of the operations in set_axes_limits 
really need to be done only once (although I have not checked this 
carefully). Instead of repeating them with every call to a plotting 
method, the basemap instance could keep a list of hashes of axes objects 
on which the operations have already been run, and use that to prevent 
duplication.
Nothing urgent here--just some ideas that occur to me while working with 
basemap. If you think any are worth pursuing, and you want me to take a 
shot at it, let me know.
Eric
From: Jeff W. <js...@fa...> - 2010年04月19日 09:53:13
Eric Firing wrote:
> Jeff,
>
> Basemap methods like plot() include a "draw_if_interactive" command, 
> followed by a call to the set_axes_limits() method, which ends with
>
> # force draw if in interactive mode.
> if is_interactive():
> figManager = _pylab_helpers.Gcf.get_active()
> figManager.canvas.draw()
>
> It seems to me that you could eliminate all those "draw_if_interactive" 
> blocks from plot etc., and replace the end block of set_axes_limits() with
>
> if is_interactive():
> import matplotlib.pyplot as plt
> plt.draw_if_interactive()
>
> The advantages would be reduced clutter in the drawing methods, and 
> consistent use of draw_if_interactive. I think the latter would make 
> interactive running of functions and subclasses built on basemap more 
> efficient by reducing redundant draw operations.
>
> It also looks like at least most of the operations in set_axes_limits 
> really need to be done only once (although I have not checked this 
> carefully). Instead of repeating them with every call to a plotting 
> method, the basemap instance could keep a list of hashes of axes objects 
> on which the operations have already been run, and use that to prevent 
> duplication.
>
> Nothing urgent here--just some ideas that occur to me while working with 
> basemap. If you think any are worth pursuing, and you want me to take a 
> shot at it, let me know.
>
> Eric
>
>
> 
Eric: You are right, that could be done much more efficiently. I'm 
stuck in the U.K. waiting for the volcanic dust to clear, so if you want 
to take a shot at it go ahead.
-Jeff
From: Eric F. <ef...@ha...> - 2010年04月22日 03:02:56
Jeff Whitaker wrote:
> Eric Firing wrote:
>> Jeff,
>>
>> Basemap methods like plot() include a "draw_if_interactive" command, 
>> followed by a call to the set_axes_limits() method, which ends with
>>
>> # force draw if in interactive mode.
>> if is_interactive():
>> figManager = _pylab_helpers.Gcf.get_active()
>> figManager.canvas.draw()
>>
>> It seems to me that you could eliminate all those 
>> "draw_if_interactive" blocks from plot etc., and replace the end block 
>> of set_axes_limits() with
>>
>> if is_interactive():
>> import matplotlib.pyplot as plt
>> plt.draw_if_interactive()
>>
>> The advantages would be reduced clutter in the drawing methods, and 
>> consistent use of draw_if_interactive. I think the latter would make 
>> interactive running of functions and subclasses built on basemap more 
>> efficient by reducing redundant draw operations.
>>
>> It also looks like at least most of the operations in set_axes_limits 
>> really need to be done only once (although I have not checked this 
>> carefully). Instead of repeating them with every call to a plotting 
>> method, the basemap instance could keep a list of hashes of axes 
>> objects on which the operations have already been run, and use that to 
>> prevent duplication.
>>
>> Nothing urgent here--just some ideas that occur to me while working 
>> with basemap. If you think any are worth pursuing, and you want me to 
>> take a shot at it, let me know.
>>
>> Eric
>>
>>
>> 
> Eric: You are right, that could be done much more efficiently. I'm 
> stuck in the U.K. waiting for the volcanic dust to clear, so if you want 
> to take a shot at it go ahead.
> 
> -Jeff
> 
Jeff,
I made the changes, and removed a few obsolete bits.
I hope you are cleared to fly soon, if you have not already departed.
Eric
From: Jeff W. <js...@fa...> - 2010年04月22日 05:59:43
Eric Firing wrote:
> Jeff Whitaker wrote:
>> Eric Firing wrote:
>>> Jeff,
>>>
>>> Basemap methods like plot() include a "draw_if_interactive" command, 
>>> followed by a call to the set_axes_limits() method, which ends with
>>>
>>> # force draw if in interactive mode.
>>> if is_interactive():
>>> figManager = _pylab_helpers.Gcf.get_active()
>>> figManager.canvas.draw()
>>>
>>> It seems to me that you could eliminate all those 
>>> "draw_if_interactive" blocks from plot etc., and replace the end 
>>> block of set_axes_limits() with
>>>
>>> if is_interactive():
>>> import matplotlib.pyplot as plt
>>> plt.draw_if_interactive()
>>>
>>> The advantages would be reduced clutter in the drawing methods, and 
>>> consistent use of draw_if_interactive. I think the latter would 
>>> make interactive running of functions and subclasses built on 
>>> basemap more efficient by reducing redundant draw operations.
>>>
>>> It also looks like at least most of the operations in 
>>> set_axes_limits really need to be done only once (although I have 
>>> not checked this carefully). Instead of repeating them with every 
>>> call to a plotting method, the basemap instance could keep a list of 
>>> hashes of axes objects on which the operations have already been 
>>> run, and use that to prevent duplication.
>>>
>>> Nothing urgent here--just some ideas that occur to me while working 
>>> with basemap. If you think any are worth pursuing, and you want me 
>>> to take a shot at it, let me know.
>>>
>>> Eric
>>>
>>>
>>> 
>> Eric: You are right, that could be done much more efficiently. I'm 
>> stuck in the U.K. waiting for the volcanic dust to clear, so if you 
>> want to take a shot at it go ahead.
>>
>> -Jeff
>>
>
> Jeff,
>
> I made the changes, and removed a few obsolete bits.
>
> I hope you are cleared to fly soon, if you have not already departed.
>
> Eric
Eric: I'm still here - hope to get out on Sat at the earliest. Thanks 
for making those changes - I'm sure they will help a lot for interactive 
use and animations.
-Jeff
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /