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
(8)
2
(11)
3
(4)
4
(6)
5
(13)
6
(30)
7
(21)
8
(9)
9
(19)
10
(4)
11
(5)
12
(14)
13
(19)
14
(22)
15
(12)
16
(15)
17
(14)
18
(1)
19
(1)
20
(11)
21
(9)
22
(18)
23
(39)
24
(12)
25
(7)
26
(13)
27
(18)
28
(3)
29
(5)
30
(12)
31
(10)

Showing 11 results of 11

From: John H. <jd...@gm...> - 2008年10月20日 13:06:51
On Mon, Oct 20, 2008 at 6:33 AM, Pete <sne...@gm...> wrote:
> Has anyone had any luck compiling Matplotlib using cygwin?
> Out of the box I get the following: (I have numpy, tcl/tk and libpng1.2
> installed)
>
> ~/matpl/matplotlib-0.98.3$ python setup.py build
> ============================================================================
> BUILDING MATPLOTLIB
> matplotlib: 0.98.3
> python: 2.5.1 (r251:54863, May 18 2007, 16:56:43) [GCC
> 3.4.4 (cygming special, gdc 0.12, using dmd 0.125)]
> platform: cygwin
>
> REQUIRED DEPENDENCIES
> numpy: 1.2.0
> freetype2: 9.18.3
>
> OPTIONAL BACKEND DEPENDENCIES
> libpng: found, but unknown version (no pkg-config)
> * Could not find 'libpng' headers in any of
> * '/usr/include', '.'
> Traceback (most recent call last):
> File "setup.py", line 125, in <module>
> if check_for_tk() or (options['build_tkagg'] is True):
> File "/cygdrive/c/linuxshare/matpl/matplotlib-0.98.3/setupext.py", line
> 841, in check_for_tk
> explanation = add_tk_flags(module)
> File "/cygdrive/c/linuxshare/matpl/matplotlib-0.98.3/setupext.py", line
> 1084, in add_tk_flags
> result = parse_tcl_config(tcl_lib_dir, tk_lib_dir)
> File "/cygdrive/c/linuxshare/matpl/matplotlib-0.98.3/setupext.py", line
> 946, in parse_tcl_config
> tk_lib = tk_vars.get("default", "TK_LIB_SPEC")[1:-1].split()[0][2:]
> IndexError: list index out of range
This is probably something you will have to debug yourself, since it
is dependent on the TK you have installed on your system, but it is
fairly easy to do. Edit setupext.py, store the results of
 tmp = tk_vars.get("default", "TK_LIB_SPEC")[1:-1].split()
 print tmp
and see what is returned. The setup code is trying to index into
this data structure, and what is coming back is not what is expected.
It would be helpful to see what is coming back.
Note this call happens in a large try except block, so you could add
your exception (IndexError) to the list of exceptions that are caught,
which will return None from this function. This will keep your build
from crashing. Alternatively, if you know you want some backend like
gtkagg or wxagg and don't need tkagg, you can turn this off by copying
setup.cfg.template to setup.cfg and manually customizing the backends
which are built.
But the ideal will be to fix the tk config bug and send us a patch .
JDH
>
>
> Any help or ideas appreciated!
> Thanks,
> Pete
>
> -------------------------------------------------------------------------
> 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-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
From: Alan G I. <ai...@am...> - 2008年10月20日 13:05:16
> Mathew Yeates wrote:
>> Is there an easy way to find the locations in rectangle1 that are 
>> covered by rectangle2? I couldn't find this anywhere.
On 10/20/2008 7:46 AM Jeff Whitaker apparently wrote:
> Mathew: There's nothing included in matplotlib - I recommend Shapely 
> (http://trac.gispython.org/lab/wiki/Shapely). It's an interface to the 
> GEOS library, which you already have since you have basemap. Basemap 
> includes it's own private interface to GEOS, but Shapely has a much 
> better (although slower), well documented API.
But with ordinary rectangles (with sides parallel
to the axes), if you can extract their
coordinates/size, the analytical problem is trivial:
use this info to get the overlap along each axis.
If the rectangles share a common transform,
this is still pretty easy. So you may be able
to avoid a more general solution.
I've interpreted the question one way: "covered"
might suggest you additionally need the z-order.
Cheers,
Alan Isaac
From: Dave_Evo <dsp...@gm...> - 2008年10月20日 13:04:33
Yes, I can write to the disk and the python directory, I installed Python
myself in the directory without need for any other administrator privileges. 
I also tried re-applying read/write status in properties but still the same
error...
Dave
I'm not a regular Windows user, so I'm probably not of much help, but...
It's trying to write a default .matplotlibrc file to C:\ Is that 
directory writable, by the user that is running matplotlib?
Mike
-- 
View this message in context: http://www.nabble.com/Can%27t-Import-Pylab-on-XP---runtime-error.-tp20034693p20067484.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Pete <sne...@gm...> - 2008年10月20日 12:55:59
Has anyone had any luck compiling Matplotlib using cygwin?
Out of the box I get the following: (I have numpy, tcl/tk and libpng1.2
installed)
~/matpl/matplotlib-0.98.3$ python setup.py build
============================================================================
BUILDING MATPLOTLIB
 matplotlib: 0.98.3
 python: 2.5.1 (r251:54863, May 18 2007, 16:56:43) [GCC
 3.4.4 (cygming special, gdc 0.12, using dmd 0.125)]
 platform: cygwin
REQUIRED DEPENDENCIES
 numpy: 1.2.0
 freetype2: 9.18.3
OPTIONAL BACKEND DEPENDENCIES
 libpng: found, but unknown version (no pkg-config)
 * Could not find 'libpng' headers in any of
 * '/usr/include', '.'
Traceback (most recent call last):
 File "setup.py", line 125, in <module>
 if check_for_tk() or (options['build_tkagg'] is True):
 File "/cygdrive/c/linuxshare/matpl/matplotlib-0.98.3/setupext.py", line
841, in check_for_tk
 explanation = add_tk_flags(module)
 File "/cygdrive/c/linuxshare/matpl/matplotlib-0.98.3/setupext.py", line
1084, in add_tk_flags
 result = parse_tcl_config(tcl_lib_dir, tk_lib_dir)
 File "/cygdrive/c/linuxshare/matpl/matplotlib-0.98.3/setupext.py", line
946, in parse_tcl_config
 tk_lib = tk_vars.get("default", "TK_LIB_SPEC")[1:-1].split()[0][2:]
IndexError: list index out of range
Any help or ideas appreciated!
Thanks,
Pete
From: John H. <jd...@gm...> - 2008年10月20日 12:52:53
On Mon, Oct 20, 2008 at 6:57 AM, Jakub Urban <ur...@ip...> wrote:
> C:\Python25\lib\site-packages\matplotlib\legend.pyc in
> _update_positions(self, r
> enderer)
> 521 ydata = y*np.ones(handle.get_xdata().shape, float)
> 522 handle.set_ydata(ydata+h/2.)
> --> 523 handle._legmarker.set_ydata(ydata+h/2.)
> 524 elif isinstance(handle, Rectangle):
> 525 handle.set_y(y+1/4*h)
>
> AttributeError: 'Line2D' object has no attribute '_legmarker'
I'm prettu sure this is fixed in svn. If you don't have access to a
svn build, edit
 C:\Python25\lib\site-packages\matplotlib\legend.py
and replace line 523 with
 if hasattr(handle, '_legmarker'):
 handle._legmarker.set_ydata(ydata+h/2.)
Hope this helps,
JDH
From: Terrence B. <met...@gm...> - 2008年10月20日 12:32:11
Hello, I would like to know what I can do to fix this problem.
Administrator@LIFEBOOK /cygdrive/c/downloads/matplotlib-0.98.3 : python 
setup.py build
============================================================================ 
BUILDING MATPLOTLIB
 matplotlib: 0.98.3
 python: 2.5.2 Stackless 3.1b3 060516 (release25-maint, Oct
 1 2008, 19:33:07) [GCC 3.4.4 (cygming special, gdc
 0.12, using dmd 0.125)]
 platform: cygwin
REQUIRED DEPENDENCIES
 numpy: 1.2.0
 freetype2: 9.18.3
OPTIONAL BACKEND DEPENDENCIES
 libpng: 1.2.12
Traceback (most recent call last):
 File "setup.py", line 125, in <module>
 if check_for_tk() or (options['build_tkagg'] is True):
 File "/cygdrive/c/downloads/matplotlib-0.98.3/setupext.py", line 841, 
in check_for_tk
 explanation = add_tk_flags(module)
 File "/cygdrive/c/downloads/matplotlib-0.98.3/setupext.py", line 1084, 
in add_tk_flags
 result = parse_tcl_config(tcl_lib_dir, tk_lib_dir)
 File "/cygdrive/c/downloads/matplotlib-0.98.3/setupext.py", line 946, 
in parse_tcl_config
 tk_lib = tk_vars.get("default", "TK_LIB_SPEC")[1:-1].split()[0][2:]
IndexError: list index out of range
Administrator@LIFEBOOK /cygdrive/c/downloads/matplotlib-0.98.3 :
From: Jakub U. <ur...@ip...> - 2008年10月20日 12:30:39
 Hello everybody!
I'm trying to make a contour plot and add a legend for it. The code is
basically
---
from numpy import *
from matplotlib.pyplot import *
# put anything into x,y,z arrays
ctr = contour(x,y,z) # plots ok contours of z(x,y)
ctr.collections[0].set_label('z')
legend()
show()
---
The legend() command produces an error (see below). What's wrong with this?
Thanks for any help
Jakub
(Python 2.5 + matplotlib 0.98.3 on Win32, the same on Fedora 8)
---
ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line statement', (184, 0))
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
C:\Documents and Settings\jurban\<ipython console> in <module>()
C:\Python25\lib\site-packages\matplotlib\pyplot.pyc in legend(*args,
**kwargs)
 2388
 2389 ret = gca().legend(*args, **kwargs)
-> 2390 draw_if_interactive()
 2391 return ret
 2392 if Axes.legend.__doc__ is not None:
C:\Python25\lib\site-packages\matplotlib\backends\backend_tkagg.pyc in
draw_if_i
nteractive()
 59 figManager = Gcf.get_active()
 60 if figManager is not None:
---> 61 figManager.show()
 62
 63
C:\Python25\lib\site-packages\matplotlib\backends\backend_tkagg.pyc in
show(self
)
 389 if sys.platform=='win32' : self.window.update()
 390 else:
--> 391 self.canvas.draw()
 392 self._shown = True
 393
C:\Python25\lib\site-packages\matplotlib\backends\backend_tkagg.pyc in
draw(self
)
 212
 213 def draw(self):
--> 214 FigureCanvasAgg.draw(self)
 215 tkagg.blit(self._tkphoto, self.renderer._renderer,
colormode=2)
 216 self._master.update_idletasks()
C:\Python25\lib\site-packages\matplotlib\backends\backend_agg.pyc in
draw(self)
 259
 260 self.renderer = self.get_renderer()
--> 261 self.figure.draw(self.renderer)
 262
 263 def get_renderer(self):
C:\Python25\lib\site-packages\matplotlib\figure.pyc in draw(self, renderer)
 757
 758 # render the axes
--> 759 for a in self.axes: a.draw(renderer)
 760
 761 # render the figure text
C:\Python25\lib\site-packages\matplotlib\axes.pyc in draw(self, renderer,
infram
e)
 1521
 1522 for zorder, i, a in dsu:
-> 1523 a.draw(renderer)
 1524
 1525 renderer.close_group('axes')
C:\Python25\lib\site-packages\matplotlib\legend.pyc in draw(self, renderer)
 195 if not self.get_visible(): return
 196 renderer.open_group('legend')
--> 197 self._update_positions(renderer)
 198 if self._drawFrame:
 199 if self.shadow:
C:\Python25\lib\site-packages\matplotlib\legend.pyc in
_update_positions(self, r
enderer)
 521 ydata = y*np.ones(handle.get_xdata().shape, float)
 522 handle.set_ydata(ydata+h/2.)
--> 523 handle._legmarker.set_ydata(ydata+h/2.)
 524 elif isinstance(handle, Rectangle):
 525 handle.set_y(y+1/4*h)
AttributeError: 'Line2D' object has no attribute '_legmarker'
From: Jeff W. <js...@fa...> - 2008年10月20日 12:29:11
Mathew Yeates wrote:
> Is there an easy way to find the locations in rectangle1 that are 
> covered by rectangle2? I couldn't find this anywhere.
>
> Mathew
> 
Mathew: There's nothing included in matplotlib - I recommend Shapely 
(http://trac.gispython.org/lab/wiki/Shapely). It's an interface to the 
GEOS library, which you already have since you have basemap. Basemap 
includes it's own private interface to GEOS, but Shapely has a much 
better (although slower), well documented API.
-Jeff
-- 
Jeffrey S. Whitaker Phone : (303)497-6313
NOAA/OAR/CDC R/PSD1 FAX : (303)497-6449
325 Broadway Boulder, CO, USA 80305-3328
From: Kurt M. <mu...@pr...> - 2008年10月20日 10:47:50
Hi,
In an aerodynamic environment.
I need to plot multiple curves in one grid.
A standard view would be the coefficients of:
1) lift vs. angle-of-attack
2) lift vs. drag
3) pitching-moment vs. angle-of-attack
all three curves can be out of multiple data-sets (polars).
This 3 curves need to be in one grid to be able
to compare the values.
(other combinations of coefficients are also widely used
in this environment.)
Some people use eg. Tecplot for this purpose.
Basic requirements are:
- multiple curves in one grid
- multiple x-axis (lower/upper-side of grid)
- multiple y-axis (left/right-side of grid)
- adjusted grid (major/minor grid/ticks)
- some interactivity
- Environment (Python, wxPython)
Questions:
- Can this be done in matplotlib?
- How? (any pointers)
- Are there other possibilities?
Thank you very much for any advice
Grüessli
-- 
Kurt Müller:
kur...@ae...
From: Terrence B. <met...@gm...> - 2008年10月20日 09:44:08
Hello, I would like to know what I can do to fix this problem.
Administrator@LIFEBOOK /cygdrive/c/downloads/matplotlib-0.98.3 : python 
setup.py build
============================================================================
BUILDING MATPLOTLIB
 matplotlib: 0.98.3
 python: 2.5.2 Stackless 3.1b3 060516 (release25-maint, Oct
 1 2008, 19:33:07) [GCC 3.4.4 (cygming special, gdc
 0.12, using dmd 0.125)]
 platform: cygwin
REQUIRED DEPENDENCIES
 numpy: 1.2.0
 freetype2: 9.18.3
OPTIONAL BACKEND DEPENDENCIES
 libpng: 1.2.12
Traceback (most recent call last):
 File "setup.py", line 125, in <module>
 if check_for_tk() or (options['build_tkagg'] is True):
 File "/cygdrive/c/downloads/matplotlib-0.98.3/setupext.py", line 841, 
in check_for_tk
 explanation = add_tk_flags(module)
 File "/cygdrive/c/downloads/matplotlib-0.98.3/setupext.py", line 1084, 
in add_tk_flags
 result = parse_tcl_config(tcl_lib_dir, tk_lib_dir)
 File "/cygdrive/c/downloads/matplotlib-0.98.3/setupext.py", line 946, 
in parse_tcl_config
 tk_lib = tk_vars.get("default", "TK_LIB_SPEC")[1:-1].split()[0][2:]
IndexError: list index out of range
Administrator@LIFEBOOK /cygdrive/c/downloads/matplotlib-0.98.3 :
From: bwgoudey <bwg...@gm...> - 2008年10月20日 02:20:38
I'm looking to create a type of rectangle that draws with a cross from corner
to corner, all as a single class type. To do this, I've created a subtype of
the rectange class, that records what the current axis is and tries to draw
two lines to it in the draw function. When displayting the graph, initially
the cross is not shown, but if I zoom/pan the graph, the cross appears. Can
anyone see where my problem lies and possibly present a solution?
Cheers
 Ben
from matplotlib.lines import Line2D
from matplotlib.patches import Rectangle
from pylab import figure, show
class CrossRect(Rectangle):
 def __init__(self, ax, *args, **kwargs):
 Rectangle.__init__(self, *args, **kwargs)
 self.ax = ax
 def draw(self, renderer):
 Rectangle.draw(self, renderer)
 self._draw_cross()
 def _draw_cross(self):
 x=self.get_x()
 y=self.get_y()
 forward_slash=Line2D((x, x+self.get_width()), (y,
y+self.get_height()))
 back_slash=Line2D((x, x+self.get_width()), (y+self.get_height(), y))
 self.ax.add_line(forward_slash)
 self.ax.add_line(back_slash)
fig = figure()
ax = fig.add_subplot(111, autoscale_on=True)
left, width, bottom, height = 5, 5, 5, 5
rect = CrossRect(ax, (left, bottom), width, height, fill=False)
ax.add_patch(rect)
ax.set_xlim(3,12)
ax.set_ylim(3,12)
show()
-- 
View this message in context: http://www.nabble.com/Creating-custom-rectangle-tp20062265p20062265.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

Showing 11 results of 11

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