SourceForge logo
SourceForge logo
Menu

matplotlib-devel — matplotlib developers

You can subscribe to this list here.

2003 Jan
Feb
Mar
Apr
May
Jun
Jul
Aug
Sep
Oct
(1)
Nov
(33)
Dec
(20)
2004 Jan
(7)
Feb
(44)
Mar
(51)
Apr
(43)
May
(43)
Jun
(36)
Jul
(61)
Aug
(44)
Sep
(25)
Oct
(82)
Nov
(97)
Dec
(47)
2005 Jan
(77)
Feb
(143)
Mar
(42)
Apr
(31)
May
(93)
Jun
(93)
Jul
(35)
Aug
(78)
Sep
(56)
Oct
(44)
Nov
(72)
Dec
(75)
2006 Jan
(116)
Feb
(99)
Mar
(181)
Apr
(171)
May
(112)
Jun
(86)
Jul
(91)
Aug
(111)
Sep
(77)
Oct
(72)
Nov
(57)
Dec
(51)
2007 Jan
(64)
Feb
(116)
Mar
(70)
Apr
(74)
May
(53)
Jun
(40)
Jul
(519)
Aug
(151)
Sep
(132)
Oct
(74)
Nov
(282)
Dec
(190)
2008 Jan
(141)
Feb
(67)
Mar
(69)
Apr
(96)
May
(227)
Jun
(404)
Jul
(399)
Aug
(96)
Sep
(120)
Oct
(205)
Nov
(126)
Dec
(261)
2009 Jan
(136)
Feb
(136)
Mar
(119)
Apr
(124)
May
(155)
Jun
(98)
Jul
(136)
Aug
(292)
Sep
(174)
Oct
(126)
Nov
(126)
Dec
(79)
2010 Jan
(109)
Feb
(83)
Mar
(139)
Apr
(91)
May
(79)
Jun
(164)
Jul
(184)
Aug
(146)
Sep
(163)
Oct
(128)
Nov
(70)
Dec
(73)
2011 Jan
(235)
Feb
(165)
Mar
(147)
Apr
(86)
May
(74)
Jun
(118)
Jul
(65)
Aug
(75)
Sep
(162)
Oct
(94)
Nov
(48)
Dec
(44)
2012 Jan
(49)
Feb
(40)
Mar
(88)
Apr
(35)
May
(52)
Jun
(69)
Jul
(90)
Aug
(123)
Sep
(112)
Oct
(120)
Nov
(105)
Dec
(116)
2013 Jan
(76)
Feb
(26)
Mar
(78)
Apr
(43)
May
(61)
Jun
(53)
Jul
(147)
Aug
(85)
Sep
(83)
Oct
(122)
Nov
(18)
Dec
(27)
2014 Jan
(58)
Feb
(25)
Mar
(49)
Apr
(17)
May
(29)
Jun
(39)
Jul
(53)
Aug
(52)
Sep
(35)
Oct
(47)
Nov
(110)
Dec
(27)
2015 Jan
(50)
Feb
(93)
Mar
(96)
Apr
(30)
May
(55)
Jun
(83)
Jul
(44)
Aug
(8)
Sep
(5)
Oct
Nov
(1)
Dec
(1)
2016 Jan
Feb
Mar
(1)
Apr
May
Jun
(2)
Jul
Aug
(3)
Sep
(1)
Oct
(3)
Nov
Dec
2017 Jan
Feb
(5)
Mar
Apr
May
Jun
Jul
(3)
Aug
Sep
(7)
Oct
Nov
Dec
2018 Jan
Feb
Mar
Apr
May
Jun
Jul
(2)
Aug
Sep
Oct
Nov
Dec
S M T W T F S
1
2
(6)
3
(6)
4
(9)
5
(3)
6
(4)
7
8
(8)
9
(4)
10
11
(4)
12
(2)
13
(4)
14
(3)
15
(1)
16
(1)
17
(6)
18
(3)
19
20
(2)
21
(3)
22
(4)
23
(2)
24
(5)
25
(1)
26
27
(3)
28
(3)
29
(3)
30
(1)
31
(2)




Showing 3 results of 3

From: Nicholas Y. <su...@su...> - 2005年05月29日 15:45:16
Attachments: patch
I sent this message sometime on Friday but as it doesn't seem to have made it to the sourceforge list yet I'm assuming it's not going to and trying again.
On Thu, 2005年05月26日 at 21:15 -0500, John Hunter wrote:
> >>>>> "Nicholas" == Nicholas Young <su...@su...> writes:
> 
> Nicholas> Hi, I made a suggestion for improving imshow performance
> Nicholas> for plotting an image already in byte string form a
> Nicholas> while ago; some of the results are currently in CVS. I
> Nicholas> seems that other changes made to CVS at the same time or
> Nicholas> since mean that the floating point buffer source code is
> Nicholas> now much faster and I'd suggest taking anything sourced
> Nicholas> from my code back out.
> 
> Maybe that explains why I was never able to get the same performance
> benefits you were seeing.... But I was able to get 1.5x - 2.5x faster
> with your patch, which is pretty damned good. And the memory
> benefit of your patch could be substantial as well. Why pull it?
When I first tried the new CVS code (other than my own) I was rather
rushed trying to get a paper finished and tested with too small an image
and thus saw too small a speedup for it to be worth it. I'm also using
non-contiguous arrays which make the relative speed increase smaller. I
also didn't think the interface was particularly user friendly.
I'm now sure why my code was faster (a mixture of data copying using
optimised functions and no need do floating point to integer conversion)
and have written some new code which is slightly faster than the old and
has a nicer interface (patch to CVS attached).
> What are your latest profiling numbers?
Profiling with my latest version and comparing to CVS I get:
Running with 1024x1024:
Starting array:
 Array set up: resident stack size: 37408, size: 12571
 Tests done: resident stack size: 41536, size: 13596
 Elapsed: 7.674
Starting byte:
 Byte set up: resident stack size: 12876, size: 6429
 Tests done: resident stack size: 12880, size: 6428
 Elapsed: 0.521
Fractional improvement: 13.724
Running with 2048x2048:
Starting array:
 Array set up: resident stack size: 143956, size: 39197
 Tests done: resident stack size: 156252, size: 42269
 Elapsed: 29.577
Starting byte:
 Byte set up: resident stack size: 37464, size: 12573
 Tests done: resident stack size: 37464, size: 12572
 Elapsed: 2.098
Fractional improvement: 13.100
Running with 4096x4096:
Starting array:
 Array set up: resident stack size: 561756, size: 143646
 Tests done: resident stack size: 609388, size: 155963
 Elapsed: 127.401
Starting byte:
 Byte set up: resident stack size: 66376, size: 37178
 Tests done: resident stack size: 132280, size: 37177
 Elapsed: 8.526
Fractional improvement: 13.943
> Your patch came in just at the time I was leaving for Paris for a
> meeting, after which I experienced a rather nasty total hard drive
> failure that set me back in my mpl maintenance. I am not sure I am
> ready to give up on the ideas you introduced.... Can you remind me --
> did I manage to incorporate all of the matplotlib.axes and
> matplotlib.image patches I needed to take advantage of your patches to
> the _image extension code?
I think it's partly in there in a non-functional form, the patch I've
attached removes it and adds a new function to the Axes class called
directshow. This accepts the same syntax as imshow (where relevant)
rather than adding options to imshow; I chose to do this as my old
syntax for passing through imshow wasn't that easy to understand didn't
makes the different functionality clear. This function calls a class
call DirectImage which inherits from AxesImage.
I've also rewritten my c++ image object creation function called
frombyte to take an unsigned byte array as input rather than a buffer.
By using the std::memcopy function rather than a loop for copying the
speed advantage of passing data in as a buffer disappears and using
arrays is generally more intuitive. The function still only takes x*y*4
arrays as input at the moment as the processor time decrease from not
using loops to copy is fairly significant.
Nick
From: Jeff W. <js...@fa...> - 2005年05月29日 13:19:15
Attachments: ortho_test.png
Eric Firing wrote:
> John,
>
> The attached diff contains a bugfix for the masking problem that Jeff 
> found:
>
> diff -Naur cntr.c_as_sent cntr.c > cntr_bugfix.diff
>
> where cntr.c_as_sent is the old version, cntr.c is the corrected version.
>
> I was simply not transferring the information correctly from the mask 
> to the "reg" array that cntr.c uses; I was setting a value, and then 
> accidentally overwriting it with what should have been an initialization.
>
> With this patch, masked arrays should be handled no better and no 
> worse than before the change from gcntr.c to cntr.c; as far as I know, 
> masking works perfectly for line contours, and it works correctly for 
> filled contours under many but not all circumstances. I tried two 
> workarounds for the latter problem:
>
> 1) in line 1359 of cntr.c, change the nchunk variable from 30 to a 
> much smaller value.
> long nchunk = 30; /* hardwired for now */
> This causes the generation of many small polygons, so it may slow 
> things down quite a bit, and it causes the boundaries to look a little 
> glitchy on the screen (gtkagg); but I haven't done timing tests, and I 
> haven't tried other backends.
>
> 2) change the end of ContourSupport._contour_args(), in contour.py:
>
> self.ax.set_xlim((ma.minimum(x), ma.maximum(x)))
> self.ax.set_ylim((ma.minimum(y), ma.maximum(y)))
> # Workaround for cntr.c bug wrt masked interior regions:
> #if filled:
> # z = ma.masked_array(z.filled(-1e38))
> # It's not clear this is any better than the original bug.
> return (x, y, z, lev)
>
> The workaround is to uncomment the "if filled:" block. This method 
> also works, but can leave some artifacts around the boundary of the 
> bad region.
>
> I am not recommending that either of these workarounds be added to 
> CVS, but if some individual runs into major trouble because of the 
> bug, then either of these methods could be used as a stopgap on an 
> individual basis.
>
> Eric
>
Eric: Thanks - contour indeed now seems to work perfectly with masked 
arrays, but I still have problems with contourf (see attached 
ortho_test.png). Unfortunately, neither of your suggested workarounds 
help, the first makes no difference and the second makes it much worse. 
-Jeff
-- 
Jeffrey S. Whitaker Phone : (303)497-6313
NOAA/OAR/CDC R/CDC1 FAX : (303)497-6449
325 Broadway Web : http://www.cdc.noaa.gov/~jsw
Boulder, CO, USA 80305-3328 Office: Skaggs Research Cntr 1D-124
From: Eric F. <ef...@ha...> - 2005年05月29日 02:27:38
Attachments: cntr_bugfix.diff
John,
The attached diff contains a bugfix for the masking problem that Jeff found:
diff -Naur cntr.c_as_sent cntr.c > cntr_bugfix.diff
where cntr.c_as_sent is the old version, cntr.c is the corrected version.
I was simply not transferring the information correctly from the mask to 
the "reg" array that cntr.c uses; I was setting a value, and then 
accidentally overwriting it with what should have been an initialization.
With this patch, masked arrays should be handled no better and no worse 
than before the change from gcntr.c to cntr.c; as far as I know, masking 
works perfectly for line contours, and it works correctly for filled 
contours under many but not all circumstances. I tried two workarounds 
for the latter problem:
1) in line 1359 of cntr.c, change the nchunk variable from 30 to a much 
smaller value.
 long nchunk = 30; /* hardwired for now */
This causes the generation of many small polygons, so it may slow things 
down quite a bit, and it causes the boundaries to look a little glitchy 
on the screen (gtkagg); but I haven't done timing tests, and I haven't 
tried other backends.
2) change the end of ContourSupport._contour_args(), in contour.py:
 self.ax.set_xlim((ma.minimum(x), ma.maximum(x)))
 self.ax.set_ylim((ma.minimum(y), ma.maximum(y)))
 # Workaround for cntr.c bug wrt masked interior regions:
 #if filled:
 # z = ma.masked_array(z.filled(-1e38))
 # It's not clear this is any better than the original bug.
 return (x, y, z, lev)
The workaround is to uncomment the "if filled:" block. This method also 
 works, but can leave some artifacts around the boundary of the bad region.
I am not recommending that either of these workarounds be added to CVS, 
but if some individual runs into major trouble because of the bug, then 
either of these methods could be used as a stopgap on an individual basis.
Eric
John Hunter wrote:
>>>>>>"Jeff" == Jeff Whitaker <js...@fa...> writes:
> 
> 
> Jeff> The basemap toolkit relies on the 'badmask' parameter in
> Jeff> contour/contourf to mask out areas outside the desired map
> Jeff> projection region in matplotlib 0.80. It works quite
> Jeff> well. Unfortunately, the new masked array support in CVS
> Jeff> doesn't (I get all kinds of weird artifacts, especially for
> Jeff> contourf but also for contour). Can the old badmask
> Jeff> functionality be added back in for 0.81, at least
> Jeff> temporarily until the masked array support stabilizes?
> 
> I don't have anything to add to this, I'm just replying so I can CC
> Eric Firing, who added the masked array support to contour, because I
> don't know if he is on the devel list.
> 
> JDH

Showing 3 results of 3

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 によって変換されたページ (->オリジナル) /