SourceForge logo
SourceForge logo
Menu

matplotlib-users — Discussion related to using matplotlib

You can subscribe to this list here.

2003 Jan
Feb
Mar
Apr
May
(3)
Jun
Jul
Aug
(12)
Sep
(12)
Oct
(56)
Nov
(65)
Dec
(37)
2004 Jan
(59)
Feb
(78)
Mar
(153)
Apr
(205)
May
(184)
Jun
(123)
Jul
(171)
Aug
(156)
Sep
(190)
Oct
(120)
Nov
(154)
Dec
(223)
2005 Jan
(184)
Feb
(267)
Mar
(214)
Apr
(286)
May
(320)
Jun
(299)
Jul
(348)
Aug
(283)
Sep
(355)
Oct
(293)
Nov
(232)
Dec
(203)
2006 Jan
(352)
Feb
(358)
Mar
(403)
Apr
(313)
May
(165)
Jun
(281)
Jul
(316)
Aug
(228)
Sep
(279)
Oct
(243)
Nov
(315)
Dec
(345)
2007 Jan
(260)
Feb
(323)
Mar
(340)
Apr
(319)
May
(290)
Jun
(296)
Jul
(221)
Aug
(292)
Sep
(242)
Oct
(248)
Nov
(242)
Dec
(332)
2008 Jan
(312)
Feb
(359)
Mar
(454)
Apr
(287)
May
(340)
Jun
(450)
Jul
(403)
Aug
(324)
Sep
(349)
Oct
(385)
Nov
(363)
Dec
(437)
2009 Jan
(500)
Feb
(301)
Mar
(409)
Apr
(486)
May
(545)
Jun
(391)
Jul
(518)
Aug
(497)
Sep
(492)
Oct
(429)
Nov
(357)
Dec
(310)
2010 Jan
(371)
Feb
(657)
Mar
(519)
Apr
(432)
May
(312)
Jun
(416)
Jul
(477)
Aug
(386)
Sep
(419)
Oct
(435)
Nov
(320)
Dec
(202)
2011 Jan
(321)
Feb
(413)
Mar
(299)
Apr
(215)
May
(284)
Jun
(203)
Jul
(207)
Aug
(314)
Sep
(321)
Oct
(259)
Nov
(347)
Dec
(209)
2012 Jan
(322)
Feb
(414)
Mar
(377)
Apr
(179)
May
(173)
Jun
(234)
Jul
(295)
Aug
(239)
Sep
(276)
Oct
(355)
Nov
(144)
Dec
(108)
2013 Jan
(170)
Feb
(89)
Mar
(204)
Apr
(133)
May
(142)
Jun
(89)
Jul
(160)
Aug
(180)
Sep
(69)
Oct
(136)
Nov
(83)
Dec
(32)
2014 Jan
(71)
Feb
(90)
Mar
(161)
Apr
(117)
May
(78)
Jun
(94)
Jul
(60)
Aug
(83)
Sep
(102)
Oct
(132)
Nov
(154)
Dec
(96)
2015 Jan
(45)
Feb
(138)
Mar
(176)
Apr
(132)
May
(119)
Jun
(124)
Jul
(77)
Aug
(31)
Sep
(34)
Oct
(22)
Nov
(23)
Dec
(9)
2016 Jan
(26)
Feb
(17)
Mar
(10)
Apr
(8)
May
(4)
Jun
(8)
Jul
(6)
Aug
(5)
Sep
(9)
Oct
(4)
Nov
Dec
2017 Jan
(5)
Feb
(7)
Mar
(1)
Apr
(5)
May
Jun
(3)
Jul
(6)
Aug
(1)
Sep
Oct
(2)
Nov
(1)
Dec
2018 Jan
Feb
Mar
Apr
(1)
May
Jun
Jul
Aug
Sep
Oct
Nov
Dec
2020 Jan
Feb
Mar
Apr
May
(1)
Jun
Jul
Aug
Sep
Oct
Nov
Dec
2025 Jan
(1)
Feb
Mar
Apr
May
Jun
Jul
Aug
Sep
Oct
Nov
Dec
S M T W T F S

1
(10)
2
(17)
3
(14)
4
(28)
5
(23)
6
(12)
7
(3)
8
(11)
9
(29)
10
(31)
11
(9)
12
(35)
13
(3)
14
(9)
15
(16)
16
(14)
17
(10)
18
(7)
19
(3)
20
21
(4)
22
(6)
23
(14)
24
(16)
25
(10)
26
(5)
27
(4)
28
(8)
29
(19)
30
(21)




Showing results of 383

<< < 1 2 3 4 5 6 .. 16 > >> (Page 4 of 16)
From: John H. <jd...@gm...> - 2009年06月24日 16:39:22
On Tue, Jun 23, 2009 at 8:59 AM, Kaushik
Ghose<Kau...@hm...> wrote:
> Matplotlib made it past the nomination stage and is one of the finalists in the
> 'best project for academia' category. Don't forget to register your vote!
>
> http://sourceforge.net/community/cca09/vote/
Thanks Gaushik -- I also put a link in the sidebar on our homepage
that you can click on to vote. The link below will preselect mpl to
make your voting a little easier :-)
http://sf.net/community/cca09/vote/?f=379
From: guillaume r. <gra...@wy...> - 2009年06月24日 14:52:26
Hi list :)
I'm having troubles with windows vista and the wxpython toolbar.
it works fine on linux (not tested on any other windows//mac os)
I just see a gray bar where the toolbar should be.
I do something like this:
from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as
FigureCanvas
from matplotlib.figure import Figure
 self.fig=Figure(figsize=(width, height),dpi=dpi)
 self.canvas = FigureCanvas(parent,-1,self.fig)
 self.toolbar = NavigationToolbar2Wx(self.canvas)
 self.toolbar.Realize()
 self.SetToolBar(self.toolbar)
 self.toolbar.update()
(I can paste more code if relevant)
I'm wondering what I'm doing wrong?
----
This message contains confidential information and may contain information that is legally privileged. If you have received this message by mistake, please immediately notify us and delete the original message. Thank you. 
Ce message contient des informations confidentielles. S'il vous est parvenu par erreur, merci de bien vouloir nous en aviser par retour, de n'en faire aucun usage et de n'en garder aucune copie.
----
From: Mariette <jma...@to...> - 2009年06月24日 14:13:24
Hi and thanks for the answer !!
no more trouble :)
Jerome
Sandro Tosi a écrit :
> On Mon, Jun 22, 2009 at 13:33,
> jmariette<Jer...@to...> wrote:
> 
>> Hi everybody,
>> I have some probleme with Matplot/numpy !
>> I'm using matplot v0.91.2 and I'm trying to get the hist function working !!
>> 
>
> a rather old version of matplotlib (that's the name of the project):
> we are at 0.98.5.3; try to upgrade and see if the situation improves.
> Also, you don't specify the Numpy version (even if I think it's not
> relevant here).
>
> 
>> I'm using the sample code of matplot:
>> 
>
> with this same code and 0.98.5.3 I got the image attached
>
> 
>> With the same matplot lib but a different version of numpy I get 2 different
>> number of bins !!! How is that possible ???
>> using the 1.0.4 version of numpy, I get len(n) = 50 and len(bins) = 50 ...
>> what sounds pretty right to me !! but using the version 1.2.1 (the last one
>> I guess) I got len(n) = 50 and len(bins) = 51 What looks weird, doesn't it
>> ???
>>
>> do you guys have an explanation ??
>> Anybody faced the same problem ?
>> 
>
> try to update matplotlib.
>
> Writing note: your usage of several '?' and '!' could lead to upset
> people, me for example. one char is enough to express the concept, no
> need to repeat since it means you're screaming and "order" us to
> reply, which is never the case on OSS projects users mailinglist.
>
> Regards,
> 
>
> ------------------------------------------------------------------------
>
From: Art <gre...@gm...> - 2009年06月24日 14:11:39
Is there a way to create a line plot similar to Mathematica's
PlotFilling->Axis option for ListPlot?
It is a plot of a vector as a line plot, but for each point, there is a
vertical line dropped down to the axis. It is demonstrated on the following
link:
http://reference.wolfram.com/mathematica/ref/Filling.html
With the example given:
ListPlot[Table[{k,
 PDF[BinomialDistribution[50, p], k]}, {p, {0.3, 0.5, 0.8}}, {k, 0,
 50}], Filling -> Axis]
Thanks!
From: Jeff W. <js...@fa...> - 2009年06月24日 14:10:47
Pierre GM wrote:
> On Jun 23, 2009, at 6:01 PM, Jeff Whitaker wrote:
> 
>> Pierre: Doing what you suggest (having Basemap.__init__ 
>> automatically set self.ax to the current axes) will break pickling, 
>> so I can't do that.
>> 
>
> Oh, I'm sorry for the misunderstanding: I never suggested that 
> Basemap.ax should be set at creation (apart from Basemap.ax=None). 
> Instead, I suggested that it would be set when a drawing method is 
> called that requires access to the underlying Axes (basically, all the 
> plotting methods).
> That way, as soon as something is plotted, we associate the basemap 
> instance with one particular Axes instance and we stick to it by 
> default. We can always break the link by changing basemap.ax (that is, 
> associate to another Axes instance), but we don't have the surprise 
> of using the last Axes instance by default.
> 
OK, Pierre. Now I understand. That sounds reasonable, and I don't 
think it will break any existing code.
> Now, the more I think about it, the more I'd prefer to separate 
> Basemaps from Axes. Right now, self.ax assures the connection in a way 
> I find frustrating. I'd prefer getting rid of Basemap.ax and force 
> 'ax' to be defined all the time.
> 
Don't exactly know what you mean here - make the ax keyword to the 
drawing methods mandatory?
> Alternatively, we could consider having 2 separate objects: a 
> Basemap that stores all the projection information but has *NO* 
> plotting methods, and a MapAxes that inherits from Axes and requires a 
> specific Basemap attribute at creation. The current plotting routines 
> would be associated with the MapAxes object.
> 
Hmm. I see how this could work, but what would be the added benefit 
(beyond what we would get by implementing your first suggestion)?
-Jeff
Hello, and desparate salutations...
So, I'm on mac osx 10.4.11, trying to complete an upgrade from python 2.5 to python 2.6. I believe I have numpy, tables also installed to the correct match for python 2.6. I've been using "easy_install", which was reasonably easy until I reached this stage. My attempt to use easy_install on matplotlib generated the following disheartening results, see listing below. I begin to fear that matplotlib is not supporting the easy_install approach, and that the "best match" offered by easy_install is simply doomed.
How can I back up? I was working with python 2.5, but there was a problem with pylab there as well.
Any constructive suggestions would be appreciated.
Bob
robert-lillys-computer:/System/Library/Frameworks/Python.framework/Versions/Current robertlilly$ easy_install matplotlib
Searching for matplotlib
Reading http://pypi.python.org/simple/matplotlib/
Reading http://matplotlib.sourceforge.net
Reading https://sourceforge.net/project/showfiles.php?group_id=80706&package_id=278194
Reading https://sourceforge.net/project/showfiles.php?group_id=80706&package_id=82474
Reading http://sourceforge.net/project/showfiles.php?group_id=80706
Best match: matplotlib 0.91.1
Downloading http://pypi.python.org/packages/source/m/matplotlib/matplotlib-0.91.1.tar.gz#md5=56a9344b077b5accbc4823be19f69dd6
Processing matplotlib-0.91.1.tar.gz
Running matplotlib-0.91.1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-JeJYqz/matplotlib-0.91.1/egg-dist-tmp-P91oPS
/tmp/easy_install-JeJYqz/matplotlib-0.91.1/setupext.py:67: DeprecationWarning: the sets module is deprecated
 from sets import Set
============================================================================
BUILDING MATPLOTLIB
 matplotlib: 0.91.1
 python: 2.6.2 (r262:71600, Apr 16 2009, 09:17:39) [GCC
 4.0.1 (Apple Computer, Inc. build 5250)]
 platform: darwin
REQUIRED DEPENDENCIES
 numpy: 1.3.0
 freetype2: found, but unknown version (no pkg-config)
OPTIONAL BACKEND DEPENDENCIES
 libpng: found, but unknown version (no pkg-config)
 * Could not find 'libpng' headers in any of
 * '/usr/local/include', '/usr/include',
 * '/sw/include', '.'
 Tkinter: Tkinter: 70220, Tk: 8.4, Tcl: 8.4
 wxPython: no
 * wxPython not found
 Gtk+: no
 * Building for Gtk+ requires pygtk; you must be able
 * to "import gtk" in your build/install environment
 Qt: no
 Qt4: no
 Cairo: no
OPTIONAL DATE/TIMEZONE DEPENDENCIES
 datetime: present, version unknown
 dateutil: matplotlib will provide
 pytz: matplotlib will provide
OPTIONAL USETEX DEPENDENCIES
/tmp/easy_install-JeJYqz/matplotlib-0.91.1/setupext.py:491: DeprecationWarning: os.popen4 is deprecated. Use the subprocess module.
 stdin, stdout = os.popen4('dvipng -version')
 dvipng: 1.9
/tmp/easy_install-JeJYqz/matplotlib-0.91.1/setupext.py:504: DeprecationWarning: os.popen4 is deprecated. Use the subprocess module.
 stdin, stdout = os.popen4(command)
 ghostscript: 8.57
/tmp/easy_install-JeJYqz/matplotlib-0.91.1/setupext.py:513: DeprecationWarning: os.popen4 is deprecated. Use the subprocess module.
 stdin, stdout = os.popen4('latex -version')
 latex: 3.141592
/tmp/easy_install-JeJYqz/matplotlib-0.91.1/setupext.py:525: DeprecationWarning: os.popen4 is deprecated. Use the subprocess module.
 stdin, stdout = os.popen4('pdftops -v')
EXPERIMENTAL CONFIG PACKAGE DEPENDENCIES
 configobj: matplotlib will provide
 enthought.traits: matplotlib will provide
[Edit setup.cfg to suppress the above messages]
============================================================================
warning: no files found matching 'NUMARRAY_ISSUES'
warning: no files found matching 'MANIFEST'
warning: no files found matching 'matplotlibrc'
warning: no files found matching 'lib/matplotlib/toolkits'
no previously-included directories found matching 'examples/_tmp_*'
src/_image.cpp:5:17: error: png.h: No such file or directory
src/_image.cpp:5:17: error: png.h: No such file or directory
src/_image.cpp: In member function 'Py::Object Image::write_png(const Py::Tuple&)':
src/_image.cpp:646: error: 'png_structp' was not declared in this scope
src/_image.cpp:646: error: expected `;' before 'png_ptr'
src/_image.cpp:647: error: 'png_infop' was not declared in this scope
src/_image.cpp:647: error: expected `;' before 'info_ptr'
src/_image.cpp:648: error: aggregate 'png_color_8_struct sig_bit' has incomplete type and cannot be defined
src/_image.cpp:649: error: 'png_uint_32' was not declared in this scope
src/_image.cpp:649: error: expected `;' before 'row'
src/_image.cpp:652: error: 'png_bytep' was not declared in this scope
src/_image.cpp:652: error: 'row_pointers' was not declared in this scope
src/_image.cpp:652: error: expected type-specifier before 'png_bytep'
src/_image.cpp:652: error: expected `;' before 'png_bytep'
src/_image.cpp:654: error: 'row' was not declared in this scope
src/_image.cpp:660: error: type '<type error>' argument given to 'delete', expected pointer
src/_image.cpp:665: error: 'png_ptr' was not declared in this scope
src/_image.cpp:665: error: 'PNG_LIBPNG_VER_STRING' was not declared in this scope
src/_image.cpp:665: error: 'png_create_write_struct' was not declared in this scope
src/_image.cpp:669: error: type '<type error>' argument given to 'delete', expected pointer
src/_image.cpp:673: error: 'info_ptr' was not declared in this scope
src/_image.cpp:673: error: 'png_create_info_struct' was not declared in this scope
src/_image.cpp: In member function 'Py::Object Image::write_png(const Py::Tuple&)':
src/_image.cpp:646: error: 'png_structp' was not declared in this scope
src/_image.cpp:677: error: 'png_destroy_write_struct' was not declared in this scope
src/_image.cpp:646: error: expected `;' before 'png_ptr'src/_image.cpp:678: error: type '<type error>' argument given to 'delete', expected pointer
src/_image.cpp:647: error: 'png_infop' was not declared in this scope
src/_image.cpp:647: error: expected `;' before 'info_ptr'
src/_image.cpp:648: error: aggregate 'png_color_8_struct sig_bit' has incomplete type and cannot be defined
src/_image.cpp:649: error: 'png_uint_32' was not declared in this scope
src/_image.cpp:649: error: expected `;' before 'row'
src/_image.cpp:652: error: 'png_bytep' was not declared in this scope
src/_image.cpp:652: error: 'row_pointesrc/_image.cpp:685: error: 'png_destroy_write_struct' was not declared in this scope
src/_image.cpp:686: error: type '<type error>' argument given to 'delete', expected pointer
src/_image.cpp:690: error: 'png_init_io' was not declared in this scope
rs' was not declared in this scope
src/_image.cpp:693: error: 'PNG_COLOR_TYPE_RGB_ALPHA' was not declared in this scope
src/_image.cpp:652: error: expected type-specifier before 'png_bytep'
src/_image.cpp:693: error: 'PNG_INTERLACE_NONE' was not declared in this scope
src/_image.cpp:694: error: 'PNG_COMPRESSION_TYPE_BASE' was not declared in this scope
src/_image.cpp:694: error: 'PNG_FILTER_TYPE_BASE' was not declared in this scope
src/_image.cpp:652: error: expected `;' before 'png_bytep'
src/_image.cpp:694: error: 'png_set_IHDR' was not declared in this scope
src/_image.cpp:654: error: 'row' was not declared in this scope
src/_image.cpp:703: error: 'png_set_sBIT' was not declared in this scope
src/_image.cpp:705: error: 'png_write_info' was not declared in this scope
src/_image.cpp:706: error: 'png_write_image' was not declared in this scope
src/_image.cpp:707: error: 'png_write_end' was not declared in this scope
src/_image.cpp:708: error: 'png_destroy_write_struct' was not declared in this scope
src/_image.cpp:711: error: type '<type error>' argument given to 'delete', expected pointer
src/_image.cpp:660: error: type '<type error>' argument given to 'delete', expected pointer
src/_image.cpp:665: error: 'png_ptr' was not declared in this scope
src/_image.cpp:665: error: 'PNG_LIBPNG_VER_STRING' was not declared in this scope
src/_image.cpp:665: error: 'png_create_write_struct' was not declared in this scope
src/_image.cpp:669: error: type '<type error>' argument given to 'delete', expected pointer
src/_image.cpp:673: error: 'info_ptr' was not declared in this scope
src/_image.cpp:673: error: 'png_create_info_struct' was not declared in this scope
src/_image.cpp:677: error: 'png_destroy_write_struct' was not declared in this scope
src/_image.cpp:678: error: type '<type error>' argument given to 'delete', expected pointer
src/_image.cpp:685: error: 'png_destroy_write_struct' was not declared in this scope
src/_image.cpp:686: error: type '<type error>' argument given to 'delete', expected pointer
src/_image.cpp:690: error: 'png_init_io' was not declared in this scope
src/_image.cpp:693: error: 'PNG_COLOR_TYPE_RGB_ALPHA' was not declared in this scope
src/_image.cpp:693: error: 'PNG_INTERLACE_NONE' was not declared in this scope
src/_image.cpp:694: error: 'PNG_COMPRESSION_TYPE_BASE' was not declared in this scope
src/_image.cpp:694: error: 'PNG_FILTER_TYPE_BASE' was not declared in this scope
src/_image.cpp:694: error: 'png_set_IHDR' was not declared in this scope
src/_image.cpp:703: error: 'png_set_sBIT' was not declared in this scope
src/_image.cpp:705: error: 'png_write_info' was not declared in this scope
src/_image.cpp:706: error: 'png_write_image' was not declared in this scope
src/_image.cpp:707: error: 'png_write_end' was not declared in this scope
src/_image.cpp:708: error: 'png_destroy_write_struct' was not declared in this scope
src/_image.cpp:711: error: type '<type error>' argument given to 'delete', expected pointer
src/_image.cpp: In member function 'Py::Object _image_module::readpng(const Py::Tuple&)':
src/_image.cpp:860: error: 'png_byte' was not declared in this scope
src/_image.cpp:860: error: expected `;' before 'header'
src/_image.cpp:866: error: 'header' was not declared in this scope
src/_image.cpp:868: error: 'header' was not declared in this scope
src/_image.cpp:868: error: 'png_sig_cmp' was not declared in this scope
src/_image.cpp:873: error: 'png_structp' was not declared in this scope
src/_image.cpp:873: error: expected `;' before 'png_ptr'
src/_image.cpp:875: error: 'png_ptr' was not declared in this scope
src/_image.cpp:878: error: 'png_infop' was not declared in this scope
src/_image.cpp:878: error: expected `;' before 'info_ptr'
src/_image.cpp:879: error: 'info_ptr' was not declared in this scope
src/_image.cpp:882: error: 'png_ptr' was not declared in this scope
src/_image.cpp:882: error: 'png_jmpbuf' was not declared in this scope
src/_image.cpp:885: error: 'png_ptr' was not declared in this scope
src/_image.cpp:885: error: 'png_init_io' was not declared in this scope
src/_image.cpp:886: error: 'png_set_sig_bytes' was not declared in this scope
src/_image.cpp:888: error: 'info_ptr' was not declared in this scope
src/_image.cpp:888: error: 'png_read_info' was not declared in this scope
src/_image.cpp:890: error: 'png_uint_32' was not declared in this scope
src/_image.cpp:890: error: expected `;' before 'width'
src/_image.cpp:891: error: expected `;' before 'height'
src/_image.cpp:894: error: 'PNG_COLOR_TYPE_GRAY' was not declared in this scope
src/_image.cpp:895: error: 'PNG_COLOR_TYPE_GRAY_ALPHA' was not declared in this scope
src/_image.cpp:896: error: 'png_set_gray_to_rgb' was not declared in this scope
src/_image.cpp:897: error: 'PNG_COLOR_TYPE_PALETTE' was not declared in this scope
src/_image.cpp:898: error: 'png_set_palette_to_rgb' was not declared in this scope
src/_image.cpp:902: error: 'png_set_strip_16' was not declared in this scope
src/_image.cpp:905: error: 'png_set_interlace_handling' was not declared in this scope
src/_image.cpp:906: error: 'png_read_update_info' was not declared in this scope
src/_image.cpp:908: error: 'PNG_COLOR_TYPE_RGBA' was not declared in this scope
src/_image.cpp:909: error: 'PNG_COLOR_TYPE_RGB' was not declared in this scope
src/_image.cpp: In member function 'Py::Object _image_module::readpng(const Py::Tuple&)':
src/_image.cpp:860: error: 'png_byte' was not declared in this scopesrc/_image.cpp:915: error: 'png_jmpbuf' was not declared in this scope
src/_image.cpp:860: error: expected `;' before 'header'
src/_image.cpp:918: error: 'png_bytep' was not declared in this scope
src/_image.cpp:918: error: 'row_pointers' was not declared in this scope
src/_image.cpp:918: error: expected type-specifier before 'png_bytep'
src/_image.cpp:918: error: expected `;' before 'png_bytep'
src/_image.cpp:919: error: expected `;' before 'row'
src/_image.cpp:921: error: 'row' was not declared in this scope
src/_image.cpp:921: error: 'height' was not declared in this scope
src/_image.cpp:922: error: expected type-specifier before 'png_byte'
src/_image.cpp:922: error: expected `;' before 'png_byte'
src/_image.cpp:924: error: 'png_read_image' was not declared in this scope
src/_image.cpp:866: error: 'header' was not declared in this scope
src/_image.cpp:868: error: 'header' was not declared in this scope
src/_image.cpp:868: error: 'png_sig_cmp' was not declared in this scope
src/_image.cpp:929: error: 'height' was not declared in this scope
src/_image.cpp:930: error: 'width' was not declared in this scope
src/_image.cpp:873: error: 'png_structp' was not declared in this scope
src/_image.cpp:873: error: expected `;' before 'png_ptr'
src/_image.cpp:875: error: 'png_ptr' was not declared in this scope
src/_image.cpp:936: error: expected `;' before 'y'
src/_image.cpp:936: error: 'y' was not declared in this scopesrc/_image.cpp:878: error: 'png_infop' was not declared in this scope
src/_image.cpp:878: error: expected `;' before 'info_ptr'
src/_image.cpp:938: error: expected `;' before 'x'
src/_image.cpp:879: error: 'info_ptr' was not declared in this scope
src/_image.cpp:938: error: 'x' was not declared in this scope
src/_image.cpp:940: error: 'ptr' was not declared in this scope
src/_image.cpp:882: error: 'png_ptr' was not declared in this scope
src/_image.cpp:882: error: 'png_jmpbuf' was not declared in this scope
src/_image.cpp:885: error: 'png_ptr' was not declared in this scope
src/_image.cpp:885: error: 'png_init_io' was not declared in this scope
src/_image.cpp:886: error: 'png_set_sig_bytes' was not declared in this scope
src/_image.cpp:888: error: 'info_ptr' was not declared in this scope
src/_image.cpp:888: error: 'png_read_info' was not declared in this scopesrc/_image.cpp:951: error: 'png_read_end' was not declared in this scope
src/_image.cpp:890: error: 'png_uint_32' was not declared in this scope
src/_image.cpp:890: error: expected `;' before 'width'
src/_image.cpp:891: error: expected `;' before 'height'
src/_image.cpp:952: error: 'png_infopp_NULL' was not declared in this scope
src/_image.cpp:894: error: 'PNG_COLOR_TYPE_GRAY' was not declared in this scope
src/_image.cpp:952: error: 'png_destroy_read_struct' was not declared in this scope
src/_image.cpp:895: error: 'PNG_COLOR_TYPE_GRAY_ALPHA' was not declared in this scope
src/_image.cpp:896: error: 'png_set_gray_to_rgb' was not declared in this scope
src/_image.cpp:897: error: 'PNG_COLOR_TYPE_PALETTE' was not declared in this scope
src/_image.cpp:898: error: 'png_set_palette_to_rgb' was not declared in this scope
src/_image.cpp:902: error: 'png_set_strip_16' was not declared in this scope
src/_image.cpp:905: error: 'png_set_interlace_handling' was not declared in this scope
src/_image.cpp:906: error: 'png_read_update_info' was not declared in this scope
src/_image.cpp:908: error: 'PNG_COLOR_TYPE_RGBA' was not declared in this scope
src/_image.cpp:909: error: 'PNG_COLOR_TYPE_RGB' was not declared in this scope
src/_image.cpp:956: error: type '<type error>' argument given to 'delete', expected pointersrc/_image.cpp:915: error: 'png_jmpbuf' was not declared in this scope
src/_image.cpp:918: error: 'png_bytep' was not declared in this scope
src/_image.cpp:918: error: 'row_pointers' was not declared in this scope
src/_image.cpp:918: error: expected type-specifier before 'png_bytep'
src/_image.cpp:918: error: expected `;' before 'png_bytep'
src/_image.cpp:919: error: expected `;' before 'row'
src/_image.cpp:921: error: 'row' was not declared in this scope
src/_image.cpp:921: error: 'height' was not declared in this scope
src/_image.cpp:922: error: expected type-specifier before 'png_byte'
src/_image.cpp:922: error: expected `;' before 'png_byte'
src/_image.cpp:924: error: 'png_read_image' was not declared in this scope
src/_image.cpp:929: error: 'height' was not declared in this scope
src/_image.cpp:930: error: 'width' was not declared in this scope
src/_image.cpp:936: error: expected `;' before 'y'
src/_image.cpp:936: error: 'y' was not declared in this scope
src/_image.cpp:938: error: expected `;' before 'x'
src/_image.cpp:938: error: 'x' was not declared in this scope
src/_image.cpp:940: error: 'ptr' was not declared in this scope
src/_image.cpp:951: error: 'png_read_end' was not declared in this scope
src/_image.cpp:952: error: 'png_infopp_NULL' was not declared in this scope
src/_image.cpp:952: error: 'png_destroy_read_struct' was not declared in this scope
src/_image.cpp:956: error: type '<type error>' argument given to 'delete', expected pointer
lipo: can't figure out the architecture type of: /var/tmp//ccd4MhN1.out
error: Setup script exited with error: command 'gcc' failed with exit status 1
Exception OSError: (2, 'No such file or directory', 'src/image.cpp') in <bound method CleanUpFile.__del__ of <setupext.CleanUpFile instance at 0x2226df0>> ignored
Exception OSError: (2, 'No such file or directory', 'src/transforms.cpp') in <bound method CleanUpFile.__del__ of <setupext.CleanUpFile instance at 0x2226710>> ignored
Exception OSError: (2, 'No such file or directory', 'src/backend_agg.cpp') in <bound method CleanUpFile.__del__ of <setupext.CleanUpFile instance at 0x22268c8>> ignored
From: Gökhan S. <gok...@gm...> - 2009年06月24日 02:23:00
Hello,
As shown in this screenshot
http://img195.imageshack.us/img195/9186/timeseries.png I am trying to plot a
timeseries using mpl. There is a minute detail that bothers me. I couldn't
figure out how to hide the timezone information on my xlabel (here is CST)
After loading the data, I use mpl's num2data funtion to create datetime
objects from second-from-number elements. I get a nice looking figure with
autofmt_xdate() but I do not know what should I do to hide the extra
unneeded information.
In [2]: time_adj = array([num2date(1 + int(Time[i])/86400.0) for i in
range(len(Time))])
In [3]: len time_adj
------> len(time_adj)
Out[3]: 3763
In [4]: time_adj[0]
Out[4]: datetime.datetime(1, 1, 1, 13, 13, 46, tzinfo=<UTC>)
In [5]: fig = figure()
In [6]: ax1 = fig.add_subplot(111)
In [7]: ax1.plot(time_adj, dccnConc)
Out[7]: [<matplotlib.lines.Line2D object at 0xaed078c>]
In [8]: fig.autofmt_xdate()
Thanks,
Gökhan
From: Pierre GM <pgm...@gm...> - 2009年06月23日 23:45:47
On Jun 23, 2009, at 6:01 PM, Jeff Whitaker wrote:
>>
> Pierre: Doing what you suggest (having Basemap.__init__ 
> automatically set self.ax to the current axes) will break pickling, 
> so I can't do that.
Oh, I'm sorry for the misunderstanding: I never suggested that 
Basemap.ax should be set at creation (apart from Basemap.ax=None). 
Instead, I suggested that it would be set when a drawing method is 
called that requires access to the underlying Axes (basically, all the 
plotting methods).
That way, as soon as something is plotted, we associate the basemap 
instance with one particular Axes instance and we stick to it by 
default. We can always break the link by changing basemap.ax (that is, 
associate to another Axes instance), but we don't have the surprise 
of using the last Axes instance by default.
Now, the more I think about it, the more I'd prefer to separate 
Basemaps from Axes. Right now, self.ax assures the connection in a way 
I find frustrating. I'd prefer getting rid of Basemap.ax and force 
'ax' to be defined all the time.
Alternatively, we could consider having 2 separate objects: a 
Basemap that stores all the projection information but has *NO* 
plotting methods, and a MapAxes that inherits from Axes and requires a 
specific Basemap attribute at creation. The current plotting routines 
would be associated with the MapAxes object.
From: Jeff W. <js...@fa...> - 2009年06月23日 22:01:17
Pierre GM wrote:
>
> On Jun 23, 2009, at 8:27 AM, Jeff Whitaker wrote:
>>
>> Pierre: The reason I did it that way was so that the basemap 
>> instance could be created independent of any axes instances. For 
>> instance, you can create a basemap instance before an axes instance 
>> is created, or you read in a basemap instance from a pickle. If a 
>> axes instance is associated with a Basemap instance, you can't save 
>> it in a pickle.
>
> I understand that, I use pickled basemaps all the time. It's a great 
> feature, by the way, thanks a lot.
>
>> If I understand you correctly, you are suggesting that when the 
>> basemap instance is created, the "ax" attribute be set to plt.gca() 
>> if no axes instance is passed in through the kwarg, instead of just 
>> setting it to None.
>> In that case, an axes instance will be created and assigned to the 
>> Basemap instance if one doesn't already exist.
>
> That's the gist of it, yes. My point is that as soon something is 
> drawn, the basemap should be linked to an Axes instance. The link 
> could be overwritten later.
>
>> I guess I don't see any compelling reason for that, since you can 
>> always assign an axes instance to the Basemap instance later (via 
>> "map.ax = plt.gca()".
>> I'd rather have this done explicitly by the user, than have it 
>> happen automatically, with potentially surprising results.
>
> Well, talking about surprising results, the experience I was relating 
> in the original message: I load a basemap from a pickle, plot some 
> contours on it (therefore, a new Axes is created), add a colorbar (a 
> second Axes is created) and then draw a mapscale. I expect the 
> mapscale to be drawn on the axes associated with the basemap, because 
> I'm using one of the basemap's methods to plot the mapscale. With the 
> current implementation, the scale gets drawn on the colorbar.
>
> So yes, I could explicitly link the basemap to the first Axes myself. 
> I still think my suggestion would be far less confusing, but I won't 
> lose sleep over it. In any case, I think the snippet I put in the 
> latest message could simplify the code (just drop the line setting 
> self.ax to ax)...
>
>
>
>
>
>
Pierre: Doing what you suggest (having Basemap.__init__ automatically 
set self.ax to the current axes) will break pickling, so I can't do 
that. I think the next best thing is just to set it manually. I know 
the colorbar behavior is annoying, but I think it's just something you 
have to live with if you use the pylab interface.
-Jeff
-- 
Jeffrey S. Whitaker Phone : (303)497-6313
Meteorologist FAX : (303)497-6449
NOAA/OAR/PSD R/PSD1 Email : Jef...@no...
325 Broadway Office : Skaggs Research Cntr 1D-113
Boulder, CO, USA 80303-3328 Web : http://tinyurl.com/5telg
From: Patrick M. <pat...@gm...> - 2009年06月23日 19:34:31
This isn't the most current version, but it is a build from the SVN
branch a while ago.
http://code.patricktmarsh.com/builds/py2.5_mpl-0.98.6svn.win32.exe
The machine I used to build this took a dive so I no longer have a
working development environment so I can't build a more current .exe
for you. Maybe in a week or two I'll have more time, but based on my
schedule, I doubt it.
Patrick
---
Patrick Marsh
Graduate Research Assistant
School of Meteorology
University of Oklahoma
http://www.patricktmarsh.com
On Tue, Jun 23, 2009 at 11:45 AM, Ryan Wagner<rw...@vn...> wrote:
> I hate to ask this question. Is there somewhere I can download the latest
> svn release compiled for Windows? I have been completely unsuccessful in
> compiling MPL for windows and rely on the binaries, but I need to work with
> the mplot3D functionality. From what I’ve seen on Linux, it looks great! TIA
>
> -Ryan
>
>
>
> ------------------------------------------------------------------------------
> Are you an open source citizen? Join us for the Open Source Bridge
> conference!
> Portland, OR, June 17-19. Two days of sessions, one day of unconference:
> 250ドル.
> Need another reason to go? 24-hour hacker lounge. Register today!
> http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
From: Gary P. <gar...@gm...> - 2009年06月23日 19:09:16
On Tue, Jun 23, 2009 at 12:45 PM, Ryan Wagner<rw...@vn...> wrote:
> I hate to ask this question. Is there somewhere I can download the latest
> svn release compiled for Windows? I have been completely unsuccessful in
> compiling MPL for windows and rely on the binaries, but I need to work with
> the mplot3D functionality. From what I’ve seen on Linux, it looks great! TIA
>
> -Ryan
An option to consider: run Linux in a virtual machine on a Windows
host. I have a similar situation (unrelated to MPL) and that's what I
do. Works great for me. I've tried VMware, VirtualBox, and
AndLinux. All work, but I alternate between VirtualBox (probably
because that's the one I tried first) and AndLinux.
VirtualBox was *very easy* to set up, and it Just Works (ymmv).
AndLinux is an intriguing option; it's not a Linux emulator (if that's
the right word). It runs a Linux kernel as a Windows process, so it
behaves as if it were a Windows app. Similar apparent behavior is
available in VirtualBox; I think they call it "seamless mode".
AndLinux is a little bit harder to set up than VirtualBox. I did some
**very rough** speed checks. AndLinux seems to run numpy programs at
about 80% of native Windows speed. VirtualBox is about 10% slower
than AndLinux. (That was *one* test on *one* script.) Networking
works fine in both. I've compiled Sage, and ran a Sage notebook
webserver from both VirtualBox and AndLinux, accessing the server from
another machine. Everything works.
-gary
From: Ryan W. <rw...@vn...> - 2009年06月23日 16:59:35
I hate to ask this question. Is there somewhere I can download the latest svn release compiled for Windows? I have been completely unsuccessful in compiling MPL for windows and rely on the binaries, but I need to work with the mplot3D functionality. From what I've seen on Linux, it looks great! TIA
-Ryan
From: Gökhan S. <gok...@gm...> - 2009年06月23日 16:16:08
 Note: Cross-posting on IPy devel and Matplotlib-users list.
Hello,
My 8 hours sleep have helped me solve the riddle of IPython pylab entry from
a regular Python script. Although it is funky and experimental, it works
just as I have been seeking it to work for months :)
Here take a look at this piece of code:
(Again, the following lines must be modified in /IPython/Shell.py to start
with pylab each time a request is made for IPython instantiation. To me a
line can be added into ipy_user_config such as always_pylab =True )
 #user_opts = set([s.replace('-','') for s in argv[:3]]) user_opts =
set(['pylab'])
#!/usr/bin/env python
#import matplotlib.pyplot as plt
#import numpy as np
import IPython
ipy = IPython.Shell.start(user_ns=locals())
a = arange(10) ###<-- I am in IPython -pylab at this point no need
for np.arange
plot(a) ###<-- or plt.plot(a)
ipy.mainloop()
Later, when I drop into the IPy shell I can go ahead and manipulate my
figure appropriately. Now whos() works also :)
Gökhan
From: Nils W. <nw...@ia...> - 2009年06月23日 15:30:02
Attachments: script-autocrop.scm
On 2009年6月10日 16:32:08 -0400
 Jae-Joon Lee <lee...@gm...> wrote:
> I guess I misunderstood your intention.
> As you posted the message in the mpl list, I assumed 
>that you want to
> crop out the boundary of the mpl figure, which seems to 
>be not the
> case.
> Sorry for the noise.
> 
> -JJ
> 
Hi,
I found a way to run gimp (gimp2.2) in batch mode.
gimp --batch-interpreter plug_in_script_fu_eval -i -d -b 
'(script-autocrop "/home/nwagner/test.png")' '(gimp-quit 
0)'
Now I would like to run gimp from python using subprocess, 
popen2 or os.system.
How do I call gimp with the arguments from python ?
Nils
 
From: Ole S. <ole...@gm...> - 2009年06月23日 14:10:06
Hi,
could anyone reproduce this problem and/or has a solution for it? Is
there anything wrong with my code?
Best regards
Ole
Ole Streicher <ole...@gm...> writes:
> Hi Darren,
>
> Darren Dale <dsd...@gm...> writes:
>> I am really busy with other things, and can't offer suggestions unless
>> you post a short, simple, standalone script that demonstrates the
>> problem.
>
> Sure:
> --------------------------------8<-----------------------------------------
> import random
> import sys
>
> from PyQt4 import QtGui, QtCore
> from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas
> from matplotlib.figure import Figure,SubplotParams
>
> class DiagramWidget(QtGui.QWidget):
> def __init__(self, parent):
> QtGui.QWidget.__init__(self, parent)
> layout = QtGui.QVBoxLayout(self)
> self.setLayout(layout)
> self.diagram = InnerDiagramWidget(self)
> self.scrollbar = QtGui.QScrollBar(QtCore.Qt.Horizontal, self)
> layout.addWidget(self.diagram)
> layout.addWidget(self.scrollbar)
>
> def resizeEvent(self, event):
> print 'figure resize to', event.size()
> QtGui.QWidget.resizeEvent(self, event)
>
> class InnerDiagramWidget(FigureCanvas):
> def __init__(self, parent):
> fig = Figure()
> self.axes = fig.add_subplot(111)
> range = xrange(10000)
> l = [ random.randint(-5, 5) for i in range ]
> self.axes.plot(range, l, drawstyle='steps')
> FigureCanvas.__init__(self, fig)
> self.setParent(parent)
> FigureCanvas.setSizePolicy(self,
> QtGui.QSizePolicy.Expanding,
> QtGui.QSizePolicy.Expanding)
> FigureCanvas.updateGeometry(self)
>
> def resizeEvent(self, event):
> print 'scroll resize to', event.size()
> FigureCanvas.resizeEvent(self, event)
>
> a = QtGui.QApplication(sys.argv)
> w = QtGui.QMainWindow()
> w.setCentralWidget(DiagramWidget(w))
> w.show()
> a.exec_()
> --------------------------------8<-----------------------------------------
>
> To see the problem undisturbed, you may remove the "resizeEvent()"
> functions.
>
> Best regards
>
> Ole
From: Kaushik G. <Kau...@hm...> - 2009年06月23日 14:01:01
Hi Gang,
Matplotlib made it past the nomination stage and is one of the finalists in the 
'best project for academia' category. Don't forget to register your vote!
http://sourceforge.net/community/cca09/vote/
You can skip votes for categories you are not interested in if you like, but you 
can not revote, and can not change a vote once you submit.
Best
-Kaushik
From: Jeff W. <js...@fa...> - 2009年06月23日 13:00:44
Pierre GM wrote:
> All (and Jeff W. in particular),
>
> It's the time of the year where I have to draw maps in batch. I wrote 
> a script to process some data recorded at various stations, 
> interpolate the data on a grid, draw the corresponding contours on a 
> basemap, add a colorbar, and end with adding some extra information on 
> the map (scale, stations positions...).
>
> Nothing too fancy, but I ran into a problem with the last few steps. 
> As I do not give an explicit 'ax' parameter to any of the basemap 
> related methods (.contourf, .plot, .drawmapscale...), I have to rely 
> on the defaults: use self.ax if it is not None, gca() otherwise. 
> However, drawing a colorbar in midprocess switches the focus to the 
> colorbar, and the extra information I was talking about gets plotted 
> on the colorbar.
>
> Which brings me to the famous question: is it a bug or a feature ? Is 
> there any rational in *not* setting the 'ax' attribute to gca() when 
> sit hasn't been set yet and no 'ax' parameter has been specifically 
> given as input of a method ?
> 
Pierre: The reason I did it that way was so that the basemap instance 
could be created independent of any axes instances. For instance, you 
can create a basemap instance before an axes instance is created, or you 
read in a basemap instance from a pickle. If a axes instance is 
associated with a Basemap instance, you can't save it in a pickle. If I 
understand you correctly, you are suggesting that when the basemap 
instance is created, the "ax" attribute be set to plt.gca() if no axes 
instance is passed in through the kwarg, instead of just setting it to 
None. In that case, an axes instance will be created and assigned to 
the Basemap instance if one doesn't already exist. I guess I don't see 
any compelling reason for that, since you can always assign an axes 
instance to the Basemap instance later (via "map.ax = plt.gca()". I'd 
rather have this done explicitly by the user, than have it happen 
automatically, with potentially surprising results. 
-Jeff
> Thanks a lot in advance for any explanation:
> P.
>
>
> [As a workaround, I modified my local sources by adding a ._check_ax 
> method as below, and used :
> ax = ax or self._check_ax(ax)
> or
> ax = kwargs.pop('ax', None) or self._check_ax()
> depending on the context
>
> def _check_ax(self, ax=None):
> """
> Returns the axis on which to draw.
> By default, returns self.ax. If this latter is None, set it to 
> gca().
> """
> #
> if ax is None:
> if self.ax is None:
> try:
> ax = plt.gca()
> except:
> import matplotlib.pyplot as plt
> ax = plt.gca()
> self.ax = ax
> return self.ax
> return ax
>
> ------------------------------------------------------------------------------
> Are you an open source citizen? Join us for the Open Source Bridge conference!
> Portland, OR, June 17-19. Two days of sessions, one day of unconference: 250ドル.
> Need another reason to go? 24-hour hacker lounge. Register today!
> http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
From: Sandro T. <mat...@gm...> - 2009年06月23日 10:34:06
Attachments: image.png
On Mon, Jun 22, 2009 at 13:33,
jmariette<Jer...@to...> wrote:
>
> Hi everybody,
> I have some probleme with Matplot/numpy !
> I'm using matplot v0.91.2 and I'm trying to get the hist function working !!
a rather old version of matplotlib (that's the name of the project):
we are at 0.98.5.3; try to upgrade and see if the situation improves.
Also, you don't specify the Numpy version (even if I think it's not
relevant here).
> I'm using the sample code of matplot:
with this same code and 0.98.5.3 I got the image attached
> With the same matplot lib but a different version of numpy I get 2 different
> number of bins !!! How is that possible ???
> using the 1.0.4 version of numpy, I get len(n) = 50 and len(bins) = 50 ...
> what sounds pretty right to me !! but using the version 1.2.1 (the last one
> I guess) I got len(n) = 50 and len(bins) = 51 What looks weird, doesn't it
> ???
>
> do you guys have an explanation ??
> Anybody faced the same problem ?
try to update matplotlib.
Writing note: your usage of several '?' and '!' could lead to upset
people, me for example. one char is enough to express the concept, no
need to repeat since it means you're screaming and "order" us to
reply, which is never the case on OSS projects users mailinglist.
Regards,
-- 
Sandro Tosi (aka morph, morpheus, matrixhasu)
My website: http://matrixhasu.altervista.org/
Me at Debian: http://wiki.debian.org/SandroTosi
From: Antonino I. <tri...@gm...> - 2009年06月23日 10:12:01
HI to the list,
I'm playing with blit animations in a gtk window. Looking at MPL
examples I came up with a working example (attached) that shows a sin
wave with a play toggle button and a "scale" button that changes the
axis limits. In order to plot the first frame (before play is clicked)
and to correctly implement the scale action I've written the "refresh"
method that follows:
 def refresh(self):
 # This explicit draw is needed to draw the grid and to save a clean
 # background
 self.canvas.draw()
 self.background = self.canvas.copy_from_bbox(self.ax.bbox)
 # This draw is needed to draw the stand-still plot (first frame)
 self.line.set_animated(False)
 self.canvas.draw()
 self.line.set_animated(True)
 # NOTE: Saving the background here would save the line too so I have
 # to call canvas.draw() two times
This (quite redundant) implementation works. However, (QUESTION 1) is
it expected that the following straightforward implementation:
 def refresh(self):
 self.line.set_animated(False)
 self.canvas.draw()
 self.line.set_animated(True)
 self.background = self.canvas.copy_from_bbox(self.ax.bbox)
saves in background also the line? So in this case I would have the
animation superimposed to the first frame? Seems like a bug...
Is there a better way to achieve the same result?
Furthermore, I want to attach the refresh method to some events in
order to refresh the plot event if play is not active. For example
zooming or panning with the matplotlib toolbar buttons makes the plot
disappear. (QUESTION 2) Is there such event I can use to have the line
plotted? Or is better to implement this changing from an animated to a
still state? In this latter case once I plot with animated=False I'm
not able anymore to save a clean background without the line (event
using the line.set_animated(True) method before copying the bg).
When we have solved this file could be a nice reference example.
Thanks,
 ~ Antonio
From: Tony S Yu <to...@MI...> - 2009年06月23日 03:29:32
On Jun 22, 2009, at 2:57 PM, Jae-Joon Lee wrote:
> The easiest solution I can think of is doing some monkey patching.
>
>
> import matplotlib.pyplot as plt
> import matplotlib.transforms as transforms
> import numpy as np
> fig = plt.figure()
> ax = fig.add_subplot(111)
> x = [0.25, 0.75, 0.25, 0.75]
> y = [0.25, 0.25, 0.75, 0.75]
> r = 0.1 * np.ones(4)
> col = plt.scatter(x, y, np.pi*r**2)
>
>
> from matplotlib.collections import RegularPolyCollection
> class RegularPolyCollection2(RegularPolyCollection):
> def get_transform(self):
> ax = self.axes
>
> sc_x = ax.bbox.width / ax.viewLim.width
> sc_y = ax.bbox.height / ax.viewLim.height
>
> return transforms.Affine2D().scale(sc_x, sc_y)
>
> col.__class__ = RegularPolyCollection2
>
> plt.axis('equal')
> plt.show()
Thanks Jae-Joon! This is exactly what I was looking for.
-Tony
From: Pierre GM <pgm...@gm...> - 2009年06月23日 01:05:18
All (and Jeff W. in particular),
It's the time of the year where I have to draw maps in batch. I wrote 
a script to process some data recorded at various stations, 
interpolate the data on a grid, draw the corresponding contours on a 
basemap, add a colorbar, and end with adding some extra information on 
the map (scale, stations positions...).
Nothing too fancy, but I ran into a problem with the last few steps. 
As I do not give an explicit 'ax' parameter to any of the basemap 
related methods (.contourf, .plot, .drawmapscale...), I have to rely 
on the defaults: use self.ax if it is not None, gca() otherwise. 
However, drawing a colorbar in midprocess switches the focus to the 
colorbar, and the extra information I was talking about gets plotted 
on the colorbar.
Which brings me to the famous question: is it a bug or a feature ? Is 
there any rational in *not* setting the 'ax' attribute to gca() when 
sit hasn't been set yet and no 'ax' parameter has been specifically 
given as input of a method ?
Thanks a lot in advance for any explanation:
P.
[As a workaround, I modified my local sources by adding a ._check_ax 
method as below, and used :
ax = ax or self._check_ax(ax)
or
ax = kwargs.pop('ax', None) or self._check_ax()
depending on the context
 def _check_ax(self, ax=None):
 """
 Returns the axis on which to draw.
 By default, returns self.ax. If this latter is None, set it to 
gca().
 """
 #
 if ax is None:
 if self.ax is None:
 try:
 ax = plt.gca()
 except:
 import matplotlib.pyplot as plt
 ax = plt.gca()
 self.ax = ax
 return self.ax
 return ax
From: Sandro T. <mat...@gm...> - 2009年06月22日 19:33:47
Hi Jae-Joon
On Mon, Jun 22, 2009 at 21:14, Jae-Joon Lee<lee...@gm...> wrote:
> Without actual code, it is difficult to figure out what the real problem is.
sorry I didn't attach a complete example but I would have to strip down a lot :)
> Anyhow, did you check the below animation example?
>
> http://matplotlib.sourceforge.net/examples/animation/animation_blit_gtk.html
yes, but I didn't have the illumination; until now :)
> In the example, the grid is static (i.e., not animated). If what you
that's perfect, I do not want it to be anymated.
> want is to have the grid animated, then an explicit draw_artist call
> is required (note that grid is drawn by axis).
yeah, I want it to be only on Y (only horizonatal lines).
The solution is:
 self.ax = self.fig.add_subplot(111)
...
 self.ax.grid(True)
 self.canvas.draw() # <-- this was missing
 self.bg = self.canvas.copy_from_bbox(self.ax.bbox)
adding an explicit draw() call let the grid() be drawn and then the
result is what's expected.
Thanks a lot!
Cheers,
-- 
Sandro Tosi (aka morph, morpheus, matrixhasu)
My website: http://matrixhasu.altervista.org/
Me at Debian: http://wiki.debian.org/SandroTosi
From: Jae-Joon L. <lee...@gm...> - 2009年06月22日 19:14:43
Without actual code, it is difficult to figure out what the real problem is.
Anyhow, did you check the below animation example?
http://matplotlib.sourceforge.net/examples/animation/animation_blit_gtk.html
In the example, the grid is static (i.e., not animated). If what you
want is to have the grid animated, then an explicit draw_artist call
is required (note that grid is drawn by axis).
Regards,
-JJ
On Sun, Jun 21, 2009 at 11:54 AM, Sandro Tosi<mat...@gm...> wrote:
> Hello,
> I'm using blit to animate my plot, and I'd like to add a grid on it
> but I failed at it.
>
> What I do is:
>
> 1. prepare Figure, Axes, etc without plotting anything
> 2. save teh background with
>   self.bg = self.canvas.copy_from_bbox(self.ax.bbox)
>
> (on graph update)
>
> 3. restore background with
>   self.canvas.restore_region(self.bg)
> 4. <line>.set_ydata(...)
> 5. self.ax.draw_artist(self.<line>)
> 6. self.canvas.blit(self.ax.bbox)
>
> Now, I tried to place a "self.ax.grid(True)" in almost every possible
> position, but never a grid came out :(
>
> What is the right approach to solve it? Thanks in advance
>
> Regards,
> --
> Sandro Tosi (aka morph, morpheus, matrixhasu)
> My website: http://matrixhasu.altervista.org/
> Me at Debian: http://wiki.debian.org/SandroTosi
>
> ------------------------------------------------------------------------------
> Are you an open source citizen? Join us for the Open Source Bridge conference!
> Portland, OR, June 17-19. Two days of sessions, one day of unconference: 250ドル.
> Need another reason to go? 24-hour hacker lounge. Register today!
> http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
From: Jae-Joon L. <lee...@gm...> - 2009年06月22日 18:57:42
Tony,
My understanding is that (which might be wrong) drawing collections
involves (at least) 2 transforms. The first transform is (mostly) for
scaling, and the second transform is for offset. And this seems to be
true for PolygonCollection (which scatter creates) as far as I can
see.
set_transform() method sets the transform for scaling, which means
that (0,0) should transform to (0,0). Otherwise the polygon is not
drawn where you intended.
And, obviously transData does NOT, which I think is the root of the problem.
Unfortunately, the current PolygonCollection class does not seem to
have any support for what you want. On the other hand, it seems that
EllipseCollection lets you specify the ellipse size in data
coordinate.
The easiest solution I can think of is doing some monkey patching.
import matplotlib.pyplot as plt
import matplotlib.transforms as transforms
import numpy as np
fig = plt.figure()
ax = fig.add_subplot(111)
x = [0.25, 0.75, 0.25, 0.75]
y = [0.25, 0.25, 0.75, 0.75]
r = 0.1 * np.ones(4)
col = plt.scatter(x, y, np.pi*r**2)
from matplotlib.collections import RegularPolyCollection
class RegularPolyCollection2(RegularPolyCollection):
 def get_transform(self):
 ax = self.axes
 sc_x = ax.bbox.width / ax.viewLim.width
 sc_y = ax.bbox.height / ax.viewLim.height
 return transforms.Affine2D().scale(sc_x, sc_y)
col.__class__ = RegularPolyCollection2
plt.axis('equal')
plt.show()
Alternatively, you may modify your code to use EllipseCollection (if
what you want are just cricles).
I hope this solution fits your need.
Regards,
-JJ
On Thu, Jun 18, 2009 at 7:24 PM, Tony S Yu<to...@mi...> wrote:
> I'd like to plot a collection and scale the size of the collection
> elements in relation to the data. My guess is that I need to use the
> data transformation (ax.transData) since I would like the size of the
> collection elements altered when zooming in/out.
>
> Unfortunately, my attempt has led to weird results: the collection
> offsets are shifted from the desired coordinates when using
> ax.transData. Weirder still: the collection elements move *relative to
> the data coordinates* when panning the figure.
>
> I suspect that setting the collection transform to ax.transData is
> somehow applying some part of the transform twice. Does anyone know
> what I'm doing wrong here and how I can fix this?
>
> Thanks!
> -Tony
>
> Attached is a toy example of what I'm trying to do. The radii of the
> circles are plotted correctly, but notice the x, y coordinates don't
> match the circle centers in the plot. Also, try panning the plot and
> watch as the circles move relative to the tick marks.
>
>
> >>> import matplotlib.pyplot as plt
> >>> import matplotlib.transforms as transforms
> >>> import numpy as np
> >>> fig = plt.figure()
> >>> ax = fig.add_subplot(111)
> >>> x = [0.25, 0.75, 0.25, 0.75]
> >>> y = [0.25, 0.25, 0.75, 0.75]
> >>> r = 0.1 * np.ones(4)
> >>> col = plt.scatter(x, y, np.pi*r**2)
> >>> pts2pixels = transforms.Affine2D().scale(72.0/fig.dpi)
> >>> col.set_transform(pts2pixels + ax.transData)
> >>> plt.axis('equal')
> >>> plt.show()
>
> ------------------------------------------------------------------------------
> Crystal Reports - New Free Runtime and 30 Day Trial
> Check out the new simplified licensing option that enables unlimited
> royalty-free distribution of the report engine for externally facing
> server and web deployment.
> http://p.sf.net/sfu/businessobjects
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
From: keflavich <kef...@gm...> - 2009年06月22日 17:37:39
Anyone else have ideas on how to display large images?
Thanks,
Adam
-- 
View this message in context: http://www.nabble.com/Segmentation-fault-using-imshow-on-large-image-tp23207792p24152022.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
8 messages has been excluded from this view by a project administrator.

Showing results of 383

<< < 1 2 3 4 5 6 .. 16 > >> (Page 4 of 16)
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 によって変換されたページ (->オリジナル) /