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






Showing 14 results of 14

From: Jorge S. <jor...@ya...> - 2010年10月05日 23:00:57
Hi,
Today I tried to run some code in my new notebook, but I only got blank figures
and high CPU usage as a result. This code did run on my previous laptop. I can
reproduce this behavior with the following code at the bottom of this message.
The backtrace (also at the bottom this message) points to show() as the cause of
the problem. The reason I have show() at the top is because in my code the call
to plot() is done within a loop (I reuse the same figure for multiple plots). I
still have to check all software versions in detail from the older laptop, but I
wanted to ask here in case this was a known problem. I have ipython from git,
and matplotlib 1.0, this is a 64 bit OS (Ubuntu 10.10). Matplotlib was installed
from source. In the other laptop (Ubuntu 10.4, 32 bits) there's also ipython
from git (although an older revision) and matplotlib 1.0 compiled from source.
Regards,
Jorge
example code showing the problem
----8<-------------------------
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
fig, ax = plt.subplots(1,1)
plt.show()
data = np.random.randn(10)
ax.plot(data)
fig.canvas.draw()
----8<-------------------------
backtrace after hitting CTRL-C
----8<-------------------------
In [2]: run doct/intrinsic-images/test_show.py
^C---------------------------------------------------------------------------
KeyboardInterrupt Traceback (most recent call last)
/home/jscandal/sw/python/doct/intrinsic-images/test_show.py in <module>()
 5 
 6 fig, ax = plt.subplots(1,1)
----> 7 plt.show()
 8 data = np.random.randn(10)
 9 ax.plot(data)
/home/jscandal/lib/python2.6/site-packages/matplotlib/backends/backend_gtk.pyc
in show(mainloop)
 76 if mainloop and gtk.main_level() == 0 and \
 77 len(Gcf.get_all_fig_managers())>0:
---> 78 gtk.main()
 79 
 80 def new_figure_manager(num, *args, **kwargs):
KeyboardInterrupt: 
From: Bror J. <br...@bi...> - 2010年10月05日 22:05:22
Dear all,
I am trying to add a rectangle in a basemap map that reside in a inlined axis. 
I am basing this exercise on the following code:
(from http://old.nabble.com/display-a-filled-lat-lon-basemap-rectangle.-td28169736.html)
from matplotlib.patches import Polygon
import matplotlib.pyplot as plt
from mpl_toolkits.basemap import Basemap
map = Basemap(projection='moll',lon_0=0)
x1,y1 = map(-10,-10)
x2,y2 = map(-10,10)
x3,y3 = map(10,10)
x4,y4 = map(10,-10)
p = Polygon([(x1,y1),(x2,y2),(x3,y3),(x4,y4)],facecolor='red',edgecolor='blue',linewidth=2)
plt.gca().add_patch(p)
map.drawcoastlines()
map.drawmapboundary()
I can change the last part to: 
ax1 = plt.subplot(111)
ax1.add_patch(p)
map.ax = ax1
map.drawcoastlines()
map.drawmapboundary()
Which works fine. What I want is to create an extra axis for the map:
ax1 = plt.subplot(111)
ax2 = plt.axes([0.13,0.07,0.25,0.25])
ax2.add_patch(p)
map.ax = ax2
map.drawcoastlines()
map.drawmapboundary()
 
The map is drawn correctly, but the patch doesn't show up. What am I doing wrong?
Thanks for any help!!!
:-)Bror
From: Waléria A. D. <wal...@gm...> - 2010年10月05日 17:30:22
Benjamin,
You were right, the error was being cause because this '^' .. problem
solved.
Thank you very much
On Tue, Oct 5, 2010 at 11:38 AM, Benjamin Root <ben...@ou...> wrote:
> On Tue, Oct 5, 2010 at 7:25 AM, Waléria Antunes David <
> wal...@gm...> wrote:
>
>> Benjamin,
>>
>> I tried this: x, y, yerr = np.loadtxt(r'C:\date1.dat', unpack=True)
>>
>> but the error continue: http://pastebin.com/UwgKS3s5
>>
>> Thanks,
>> Waleria.
>>
>>
>> On Mon, Oct 4, 2010 at 4:58 PM, Benjamin Root <ben...@ou...> wrote:
>>
>>> On Mon, Oct 4, 2010 at 1:57 PM, Waléria Antunes David <
>>> wal...@gm...> wrote:
>>>
>>>> Hi all,
>>>>
>>>> My problem is this error: http://pastebin.com/bfu29WuF<http://pastebin.com/ZPzdC5c8>
>>>>
>>>> my code: http://pastebin.com/KzwEmucN
>>>>
>>>> What could be?
>>>>
>>>> Thanks
>>>> Waleria
>>>>
>>>
> Waleria,
>
> Good! There is progress. The error indicates that the processing
> successfully loaded the data and that it fails when it tries to save the
> figure. Specifically, it is failing to produce the LaTeX-like labels you
> have made. Looking closer, I see that the carot symbol '^' that you are
> using to get a superscript is a unicode carot symbol, not an ASCII one.
> This causes the formatting parsing to fail. You need to use the ASCII
> symbol ^ to make it work properly.
>
> I hope that helps.
>
> Ben Root
>
>
From: Matthieu B. <mat...@gm...> - 2010年10月05日 15:03:42
Excellent !
Thank you for the future fix! Will this release make it before the
next EPD release?
Matthieu
2010年10月4日 Michael Droettboom <md...@st...>:
> There is a fix for this in SVN in r8712 that will make it into the next
> release.
>
> In the meantime, as a workaround, you can safely delete the font cache
> file in
>
> ~/.matplotlib/fontList.cache
>
> Mike
>
> On 10/04/2010 08:44 AM, Matthieu Brucher wrote:
>> Hello,
>>
>> I ahve several installation of matplotlib on several computers with
>> different OS but the same HOME directory.
>> Matplotlib caches a lot of stuff in ~/.matplotlib, like fonts, but
>> they are not located in the same folder in different computers I use.
>> The issue is that the cache makes matplotlib raise an exception at
>> import time. Would it be possible not to use the cache if the fonts
>> mentioned int he cache are not available?
>>
>> Matthieu
>>
>
>
> --
> Michael Droettboom
> Science Software Branch
> Space Telescope Science Institute
> Baltimore, Maryland, USA
>
>
> ------------------------------------------------------------------------------
> Virtualization is moving to the mainstream and overtaking non-virtualized
> environment for deploying applications. Does it make network security
> easier or more difficult to achieve? Read this whitepaper to separate the
> two and get a better understanding.
> http://p.sf.net/sfu/hp-phase2-d2d
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
-- 
Information System Engineer, Ph.D.
Blog: http://matt.eifelle.com
LinkedIn: http://www.linkedin.com/in/matthieubrucher
From: Benjamin R. <ben...@ou...> - 2010年10月05日 14:49:22
On Tue, Oct 5, 2010 at 6:48 AM, Ensitof <ens...@gm...> wrote:
>
> Dear all,
>
> Please find here a really really stupid script for example purpose..
>
> I was developping some Image processing steps using matplotlib 0.99 and
> everything worked find... However, I upgraded my tools yesterday, and
> installed the 1.0.0 version.
>
> The "imshow" still work fine and gives me the expected figure. BUT the same
> matrix saved in a png file via the "imsave" method is leading to surprising
> results... Looks like the colums and lines are shifted when the png is
> beeing filled. (Clearly visible when comparing the result of imshow and
> opening the produced "test.png" file).
>
> Am I missing something stupid? Did something change between v0.99 and
> v.1.00? I don't think so by looking the doc...
>
> -----------------------------------------
> import numpy as np
> import matplotlib.pyplot as plt
>
>
> test=np.array([[0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,3],[0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3]])
> plt.figure()
> plt.imshow(test)
>
> plt.imsave("test.png",test)
> ------------------------------------------
> Thanks a lot for your help, this is really a problem for my application.
>
> Christophe
>
Christophe,
I do recall an off-by-one-pixel error being fixed at some point, but I don't
remember if that was before or after the version 1.0 release. Have you
tried the latest matplotlib from SVN to see if the problem still persists?
Ben Root
From: John H. <jd...@gm...> - 2010年10月05日 14:43:22
On Mon, Oct 4, 2010 at 10:46 AM, Ademir Francisco da Silva
<Ade...@in...> wrote:
> Hi John ..., I hope everything goes well ...
>
> ( This message is only for you ... )
>
> I have decided to wrote this email to know if you have been working in "
> widget module " ..., as you know by 2 months ago I asked you about this and
> nothing happend since it yet. I have got the latest version of the
> matplotlib and numpy directly of the Christoph's site and after installed
> all of them my insight about it is that nothing changed, so I kindly ask you
> about your advance in resolve those problems. Just see my last 4 emails sent
> to you and matplotlib list.
>
> Summary ...
> ( snippet of my original code - Before they work fine but now the " cursor "
> just disappear and the " on_clicked " is not works )
> widgets.Cursor( axe, useblit = True, color = self.cor[ 477 ][ 1 ], lw = 2 )
> widgets.Button( pyplot.axes( [ .91, .1, .08, .06 ] ), self.textName[ 19 ],
>       color = self.cor[ 403 ][ 1 ], hovercolor = self.cor[ 46 ][ 1 ]
> ).\
>       on_clicked( lambda: pyplot.close( "all" ) )
There is a recent fix in matplotlib svn that fixes the bug you may be
seeing. Specifically, if you do not save the names of the widgets you
are creating, the callbacks can disappear. So you will want to do
something like
 mycursor = widgets.Cursor( axe, useblit = True, color = self.cor[
477 ][ 1 ], lw = 2 )
 mybutton = widgets.Button( pyplot.axes( [ .91, .1, .08, .06 ] ),
self.textName[ 19 ], ...)
Basically, if the names of the classes go out of scope, they are
garbage collected because we are using weak references internally to
make sure callbacks get cleaned up when they go out of scope. So if
you are creating these variables and module level, make sure they are
names with a local variable, and if you are creating them at the class
level, make sure they are saved as an instance variable.
JDH
From: Benjamin R. <ben...@ou...> - 2010年10月05日 14:38:42
On Tue, Oct 5, 2010 at 7:25 AM, Waléria Antunes David <
wal...@gm...> wrote:
> Benjamin,
>
> I tried this: x, y, yerr = np.loadtxt(r'C:\date1.dat', unpack=True)
>
> but the error continue: http://pastebin.com/UwgKS3s5
>
> Thanks,
> Waleria.
>
>
> On Mon, Oct 4, 2010 at 4:58 PM, Benjamin Root <ben...@ou...> wrote:
>
>> On Mon, Oct 4, 2010 at 1:57 PM, Waléria Antunes David <
>> wal...@gm...> wrote:
>>
>>> Hi all,
>>>
>>> My problem is this error: http://pastebin.com/bfu29WuF<http://pastebin.com/ZPzdC5c8>
>>>
>>> my code: http://pastebin.com/KzwEmucN
>>>
>>> What could be?
>>>
>>> Thanks
>>> Waleria
>>>
>>
Waleria,
Good! There is progress. The error indicates that the processing
successfully loaded the data and that it fails when it tries to save the
figure. Specifically, it is failing to produce the LaTeX-like labels you
have made. Looking closer, I see that the carot symbol '^' that you are
using to get a superscript is a unicode carot symbol, not an ASCII one.
This causes the formatting parsing to fail. You need to use the ASCII
symbol ^ to make it work properly.
I hope that helps.
Ben Root
From: Robin <ro...@gm...> - 2010年10月05日 14:26:27
Hi,
I am using EPD 6.2 (32 bit) on a mac.
I would like to use subplot grids (matplotlib.gridspec) which seems to
require mpl 1.0.0.
Is there anyway to install this and use it with EPD? So far I have
tried everything from the installation guide, but whatever I do I get
a bus error in ft2font.
I can't get the wx backend to show up in the config stage (although wx
is installed in EPD).
I have tried building it myself, with the make.osx script, and with
the EPD guide on the installation page, both with gcc 4.0 and gcc 4.2
but everything gives the same bus error.
I'm actually not sure what compiler is used for EPD so perhaps that is
the problem.
Alternatively, is there a way to pick out the subplot grid features
and use them with the epd matplotlib?
If anyone is interested this is the error I get:
Exception Type: EXC_BAD_ACCESS (SIGBUS)
Exception Codes: KERN_PROTECTION_FAILURE at 0x0000000000000000
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Thread 0 Crashed: Dispatch queue: com.apple.main-thread
0 ??? 	0000000000 0 + 0
1 libSystem.B.dylib 	0x96f31108
_Unwind_GetLanguageSpecificData + 24
2 libstdc++.6.dylib 	0x97166d86 __gxx_personality_v0 + 120
3 libgcc_s.1.dylib 	0x0040b476
_Unwind_RaiseException_Phase2 + 102 (unwind.inc:68)
4 libgcc_s.1.dylib 	0x0040b890 _Unwind_Resume + 112
(unwind.inc:238)
5 ft2font.so 	0x04501a98
FT2Font::FT2Font(std::string) + 4776 (ExtensionOldType.hxx:88)
6 ft2font.so 	0x04501fd3
ft2font_module::new_ft2font(Py::Tuple const&) + 515 (ft2font.cpp:1969)
7 ft2font.so 	0x045041b6
Py::ExtensionModule<ft2font_module>::invoke_method_varargs(void*,
Py::Tuple const&) + 102 (ExtensionModule.hxx:184)
8 ft2font.so 	0x0450db87 method_varargs_call_handler + 343
9 org.python.python 	0x000cbfd5 PyEval_EvalFrameEx + 19429
10 org.python.python 	0x000ce14d PyEval_EvalCodeEx + 2109
11 org.python.python 	0x000cc1bc PyEval_EvalFrameEx + 19916
12 org.python.python 	0x000ce14d PyEval_EvalCodeEx + 2109
13 org.python.python 	0x0004b136 function_call + 166
14 org.python.python 	0x00019b05 PyObject_Call + 85
15 org.python.python 	0x0002c0e6 instancemethod_call + 422
16 org.python.python 	0x00019b05 PyObject_Call + 85
17 org.python.python 	0x000c642e PyEval_CallObjectWithKeywords + 78
18 org.python.python 	0x0002efb2 PyInstance_New + 114
19 org.python.python 	0x00019b05 PyObject_Call + 85
20 org.python.python 	0x000ca927 PyEval_EvalFrameEx + 13623
21 org.python.python 	0x000cc956 PyEval_EvalFrameEx + 21862
22 org.python.python 	0x000ce14d PyEval_EvalCodeEx + 2109
23 org.python.python 	0x000ce2d7 PyEval_EvalCode + 87
24 org.python.python 	0x000e5a3c PyImport_ExecCodeModuleEx + 188
25 org.python.python 	0x000e66dc load_source_module + 540
26 org.python.python 	0x000e72fd import_submodule + 301
27 org.python.python 	0x000e7559 load_next + 201
28 org.python.python 	0x000e7f53 PyImport_ImportModuleLevel + 419
29 org.python.python 	0x000c09bf builtin___import__ + 159
30 org.python.python 	0x00019b05 PyObject_Call + 85
31 org.python.python 	0x000c642e PyEval_CallObjectWithKeywords + 78
32 org.python.python 	0x000c99c0 PyEval_EvalFrameEx + 9680
33 org.python.python 	0x000ce14d PyEval_EvalCodeEx + 2109
34 org.python.python 	0x000ce2d7 PyEval_EvalCode + 87
35 org.python.python 	0x000e5a3c PyImport_ExecCodeModuleEx + 188
36 org.python.python 	0x000e66dc load_source_module + 540
37 org.python.python 	0x000e72fd import_submodule + 301
38 org.python.python 	0x000e78a7 ensure_fromlist + 439
39 org.python.python 	0x000e833d PyImport_ImportModuleLevel + 1421
40 org.python.python 	0x000c09bf builtin___import__ + 159
41 org.python.python 	0x00019b05 PyObject_Call + 85
42 org.python.python 	0x000c642e PyEval_CallObjectWithKeywords + 78
43 org.python.python 	0x000c99c0 PyEval_EvalFrameEx + 9680
44 org.python.python 	0x000ce14d PyEval_EvalCodeEx + 2109
45 org.python.python 	0x000ce2d7 PyEval_EvalCode + 87
46 org.python.python 	0x000e5a3c PyImport_ExecCodeModuleEx + 188
47 org.python.python 	0x000e66dc load_source_module + 540
48 org.python.python 	0x000e72fd import_submodule + 301
49 org.python.python 	0x000e78a7 ensure_fromlist + 439
50 org.python.python 	0x000e833d PyImport_ImportModuleLevel + 1421
51 org.python.python 	0x000c09bf builtin___import__ + 159
52 org.python.python 	0x00019b05 PyObject_Call + 85
53 org.python.python 	0x000c642e PyEval_CallObjectWithKeywords + 78
54 org.python.python 	0x000c99c0 PyEval_EvalFrameEx + 9680
55 org.python.python 	0x000ce14d PyEval_EvalCodeEx + 2109
56 org.python.python 	0x000ce2d7 PyEval_EvalCode + 87
57 org.python.python 	0x000e5a3c PyImport_ExecCodeModuleEx + 188
58 org.python.python 	0x000e66dc load_source_module + 540
59 org.python.python 	0x000e72fd import_submodule + 301
60 org.python.python 	0x000e7559 load_next + 201
61 org.python.python 	0x000e7f53 PyImport_ImportModuleLevel + 419
62 org.python.python 	0x000c09bf builtin___import__ + 159
63 org.python.python 	0x00019b05 PyObject_Call + 85
64 org.python.python 	0x000c642e PyEval_CallObjectWithKeywords + 78
65 org.python.python 	0x000c99c0 PyEval_EvalFrameEx + 9680
66 org.python.python 	0x000ce14d PyEval_EvalCodeEx + 2109
67 org.python.python 	0x000cc1bc PyEval_EvalFrameEx + 19916
68 org.python.python 	0x000ce14d PyEval_EvalCodeEx + 2109
69 org.python.python 	0x0004b136 function_call + 166
70 org.python.python 	0x00019b05 PyObject_Call + 85
71 org.python.python 	0x0002c0e6 instancemethod_call + 422
72 org.python.python 	0x00019b05 PyObject_Call + 85
73 org.python.python 	0x000812c7 slot_tp_init + 87
74 org.python.python 	0x0007fcf0 type_call + 176
75 org.python.python 	0x00019b05 PyObject_Call + 85
76 org.python.python 	0x000c9d9c PyEval_EvalFrameEx + 10668
77 org.python.python 	0x000ce14d PyEval_EvalCodeEx + 2109
78 org.python.python 	0x000cc1bc PyEval_EvalFrameEx + 19916
79 org.python.python 	0x000ce14d PyEval_EvalCodeEx + 2109
80 org.python.python 	0x0004b136 function_call + 166
81 org.python.python 	0x00019b05 PyObject_Call + 85
82 org.python.python 	0x0002c0e6 instancemethod_call + 422
83 org.python.python 	0x00019b05 PyObject_Call + 85
84 org.python.python 	0x000ca927 PyEval_EvalFrameEx + 13623
85 org.python.python 	0x000ce14d PyEval_EvalCodeEx + 2109
86 org.python.python 	0x0004b136 function_call + 166
87 org.python.python 	0x00019b05 PyObject_Call + 85
88 org.python.python 	0x0002c0e6 instancemethod_call + 422
89 org.python.python 	0x00019b05 PyObject_Call + 85
90 org.python.python 	0x000c642e PyEval_CallObjectWithKeywords + 78
91 org.python.python 	0x0002efb2 PyInstance_New + 114
92 org.python.python 	0x00019b05 PyObject_Call + 85
93 org.python.python 	0x000ca927 PyEval_EvalFrameEx + 13623
94 org.python.python 	0x000ce14d PyEval_EvalCodeEx + 2109
95 org.python.python 	0x000cc1bc PyEval_EvalFrameEx + 19916
96 org.python.python 	0x000ce14d PyEval_EvalCodeEx + 2109
97 org.python.python 	0x000cc1bc PyEval_EvalFrameEx + 19916
98 org.python.python 	0x000ce14d PyEval_EvalCodeEx + 2109
99 org.python.python 	0x000cc1bc PyEval_EvalFrameEx + 19916
100 org.python.python 	0x000ce14d PyEval_EvalCodeEx + 2109
101 org.python.python 	0x000ce2d7 PyEval_EvalCode + 87
102 org.python.python 	0x000f3068 PyRun_FileExFlags + 168
103 org.python.python 	0x000f3ff3 PyRun_SimpleFileExFlags + 867
104 org.python.python 	0x00105b9b Py_Main + 3371
105 org.python.python 	0x00001fb6 0x1000 + 4022
Cheers
Robin
From: Alessio C. <via...@gm...> - 2010年10月05日 14:07:09
Hi,
I'm trying to make a scatter plot of 2 variables using a thirds as filter to
have different colors.
Let's say I have those data:
x=1,2,3,4
y=2,3,4,5
z=0,1,0,1
Then I want the values of x and y corresponding to those of z=0 to be of a
color and those corresponding to z=1 to be of another color.
This is the code I manage to do until know:
import xlrd
import numpy as np
import matplotlib.pyplot as plt
wb = xlrd.open_workbook('GBL2009.xls')
sh = wb.sheet_by_index(0)
def column_pos():
 first_row=sh.row_values(0)
 net_p=""
 for i in first_row:
 if i=='net_price':
 net_p=first_row.index(i) #In gets the column position
 for i in first_row:
 if i=='material':
 mat_p=first_row.index(i) #In gets the column position
 for i in first_row:
 if i=='qty':
 qty_p=first_row.index(i) #In gets the column position
 print net_p, mat_p, qty_p
 #filtering(net_p, mat_p, qty_p)
 test(net_p, mat_p, qty_p)
 
 
def test(net_p, mat_p, qty_p):
 list=[]
 for rownum in range(sh.nrows):
 if sh.cell(rownum,mat_p).value in (96433890, 96433886):
 list.append(sh.row_values(rownum))
 x=[]
 y=[]
 z=[]
 for i in list:
 x.append(i[qty_p])
 y.append(i[net_p])
 z.append(i[mat_p])
 fig = plt.figure(1, figsize=(5.5,5.5))
 axScatter = plt.subplot(111)
 colors = ('r', 'g', 'b', 'k')
 for c in colors:
 axScatter.scatter(x, y, c=c, marker='s')
 plt.show()
-- 
View this message in context: http://old.nabble.com/Scatter-Plot-with-different-colors-tp29887701p29887701.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Waléria A. D. <wal...@gm...> - 2010年10月05日 12:30:38
Benjamin,
I tried this: x, y, yerr = np.loadtxt(r'C:\date1.dat', unpack=True)
but the error continue: http://pastebin.com/UwgKS3s5
Thanks,
Waleria.
On Mon, Oct 4, 2010 at 4:58 PM, Benjamin Root <ben...@ou...> wrote:
> On Mon, Oct 4, 2010 at 1:57 PM, Waléria Antunes David <
> wal...@gm...> wrote:
>
>> Hi all,
>>
>> My problem is this error: http://pastebin.com/bfu29WuF<http://pastebin.com/ZPzdC5c8>
>>
>> my code: http://pastebin.com/KzwEmucN
>>
>> What could be?
>>
>> Thanks
>> Waleria
>>
>
> Waleria,
>
> I am not entirely familiar with programming python in a Windows
> environment, however, you are attempting to open files with the name:
> 'C:\date1.dat'. The backslash is probably acting as an escape character and
> causing the filename to be interpreted differently from how you expect. Try
> this:
>
> x, y, yerr = np.loadtxt(r'C:\date1.dat', unpack=True)
>
> The 'r' before the string forces python to not interpret any special
> characters in a special way. Also note that I simplified your data loading
> code with the use of the 'unpack=True' keyword argument.
>
> I hope this helps,
> Ben Root
>
>
From: Ensitof <ens...@gm...> - 2010年10月05日 11:49:00
Dear all,
Please find here a really really stupid script for example purpose..
I was developping some Image processing steps using matplotlib 0.99 and
everything worked find... However, I upgraded my tools yesterday, and
installed the 1.0.0 version.
The "imshow" still work fine and gives me the expected figure. BUT the same
matrix saved in a png file via the "imsave" method is leading to surprising
results... Looks like the colums and lines are shifted when the png is
beeing filled. (Clearly visible when comparing the result of imshow and
opening the produced "test.png" file).
Am I missing something stupid? Did something change between v0.99 and
v.1.00? I don't think so by looking the doc...
-----------------------------------------
import numpy as np
import matplotlib.pyplot as plt
 
test=np.array([[0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,3],[0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3]])
plt.figure()
plt.imshow(test)
plt.imsave("test.png",test)
------------------------------------------
Thanks a lot for your help, this is really a problem for my application.
Christophe
-- 
View this message in context: http://old.nabble.com/Problem-with-imsave-in-matplotlib-v1.0-tp29886608p29886608.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Åke K. <ake...@gm...> - 2010年10月05日 10:43:02
The gcc-4.0/4.2 issue was the key to the problem. I did this and matplotlib
got installed without any issue, and I could import pyplot ok.
* First I set 'export CC=gcc-4.0'
* In the same terminal I ran the usual configure/make/make install for
libpng and freetype
* I then rebuilt matplotlib the usual way (python setup.py build, sudo
python setup.py install)
Before rebuilding matplotlib I edited setupext.py the 'darwin' line in the
basedir declaration accordingly:
'darwin' : [],
to
'darwin' : ['/usr/local'],
I don't know if that was necessary but I did it anyway.
Thanks for the help Friedrich. I did actually see that matplotlib was
compiled with gcc-4.0, but it never occured to me that libpng / freetype
should use the same compiler.
On Tue, Oct 5, 2010 at 3:46 AM, Friedrich Romstedt <
fri...@gm...> wrote:
> Yaaa, this was some time ago, I guess you did the following:
>
> * export CC=gcc-4.2
> * export MACOSX_DEPLOYMENT_TARGET=....
> * maybe also modifying the setupext.py
>
> I must say, that Python distutils (or distribute, whatever you use)
> overrides the CC environment variable with the gcc version Python was
> compiled with. If you use python.org Python, this will be gcc-4.0.
> Could be that this is your issue: You compiled freetype with gcc-4.2
> and Python uses gcc-4.0 for compiling matplotlib. Then the matplotlib
> libraries cannot load the gcc-4.2 compiled ones, because they are "too
> new". Encountered this several times on my own computer.
>
> Notice that the setupext.py instructions are still valid. The
> _png.cpp instructions are obsolete for recent versions of matplotlib,
> you can use libpng-1.4 right away.
>
> First, I'll wait for your response if you use python.org Python, and
> then we see what to do next. Don't want to bombard you with
> non-applicable recommendations.
>
> Concerning your message:
>
> 2010年10月3日 Åke Kullenberg <ake...@gm...>:
> > I just installed matplotlib-1.0.0 on my system (Snow Leopard, python
> 2.7),
> > but somehow when I try to import pyplot i get the error below.
> > For reference, I installed matplotlib from source. Prior to that I
> installed
> > libpng-1.4.4 and freetype-2.4.2 the usual way (./configure, make, make
> > install) plus I installed pkgcong as well. After getting the error I
> tried
> > the tips Friedrich R gave in this thread
> > (http://old.nabble.com/Symbol-not-found-td28994434.html) too, but I
> still
> > get the error.
>
> Notice, I'm using Python 2.6, I hope this won't be an issue. Using
> Snow Leopard as well.
>
> > From a few google attempts it seems that it is an issue of dynamic vs
> static
> > linking. I can't say that I know what that is, but I'd be very interested
> in
> > knowing whether I can do anything from my side to sort things out.
>
> Hmm, here maybe you also ran across what I said, just to add that
> afaict make.osx isn't doing static linking, but rather linking against
> newly-installed shared libs. The libs are compiled just by the
> make.osx script. Got this impression when I had an own look into the
> script.
>
> > Here is the error:
> > from matplotlib import ft2font
> > ImportError:
> >
> dlopen(/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/ft2font.so,
> > 2): Symbol not found: _FT_Attach_File
> > Referenced from:
> >
> /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/ft2font.so
> > Expected in: dynamic lookup
>
> Yeah, this looks pretty much like what I said.
>
> Sorry for the confusion with the old threads, I think best will be to
> search the matplotlib archive for recent threads, my replies got
> better with time, as I sorted out things myself. I really feel I
> should write things up for the matplotlib page as far as I came so far
> with my investigations ... And please reply back.
>
> If the external libraries you're using change: Do a new build in a
> new, freshly untared matplotlib directory or sth like that. I found
> that, for some reason, it is necessary to really rebuild the
> matplotlib libraries when a shared library they load is changed. It
> is not sufficient to just replace the external shared library (like
> freetype2) to make it work. My knowledge in linking is not as deep as
> that I could explain the guts why this is so, but you have to do it (I
> had to at least). Keep in mind that dependency checks do not include
> the shared libs matplotlib libraries like ft2font rely on. I can only
> guess that it only applies to the gcc-4.0/4.2 issue. Otherwise shared
> libs would be nearly useless.
>
> Friedrich
>
From: Friedrich R. <fri...@gm...> - 2010年10月05日 10:11:36
2010年10月5日 Friedrich Romstedt <fri...@gm...>:
>> basedirlist is: []
>
> Here is your issue. Please check the archives of the matplotlib-users
> list for the recent threads on compiling and Mac OS X (10.6 in
> particular).
I assumed that you have freetype2 etc. installed with headers (not the
shared libs only). This is necessary since matplotlib compilation
depends on them.
From: Friedrich R. <fri...@gm...> - 2010年10月05日 10:10:15
2010年10月4日 Sanjay Kairam <san...@gm...>:
> Hi there,
>
> I'm having a problem installing matplotlib, I'm guessing that I am missing
> some dependency, but I am having trouble figuring out what the issue is (I
> don't have a ton of experience dealing with python libraries and
> troubleshooting install issues).
>
> I'm using Mac OSX 10.6.4 (Snow Leopard)
> I'm trying to install matplotlib 1.0.0, which I downloaded as a tar.gz file
> from the website.
>
> So, hopefully this won't be too annoying, but here is the full output from
> when I try to install the library - it is very possible that I am doing
> something really stupid, so please be nice! *Thanks so much* for any help
> that anyone can provide.
>
> Terminal Output:
> dnab434de2:matplotlib-1.0.0 skairam$ python setup.py install
> basedirlist is: []
Here is your issue. Please check the archives of the matplotlib-users
list for the recent threads on compiling and Mac OS X (10.6 in
particular).
The thing is that the current distribution of matplotlib doesn't
include the library pathes on Max OS X, but it can be fixed with a
simple edit in setupext.py in the matplotlib/ directory. This is
where you issue $python setup.py build.
You can try macports or similar, when you're not experienced with
building it's maybe more fast, but building freetype2 and libpng-1.4
is afaict quite straightforward. I have no experience with macports,
but the include directory should be '/opt' instead of '/usr/local' in
that case I believe. Sometimes people have problems with
architectures missing in the macports libraries.
There may be issues with compiler compatibility with the macports
libraries too, since Python is compiling gcc-4.0. If they are
compiled gcc-4.2, they will fail to load into matplotlib's ft2font
Python extension. There is unfortunately no way to tell with what
compiler a lib was built without having the logs available. You can
in that case recompile Python with gcc-4.2, your numpy should still be
loadable then, or you compile freetype2 and libpng-1.4 with gcc-4.0
manually. Please tell about your next steps on the list (push the
"answer to all" button ... :-)
I see you did not set MACOSX_DEPLOYMENT_TARGET. Use $export
MACOSX_DEPLOYMENT_TARGET=10.5 or 10.6 even. If you are not planning
to deploy Python .apps or similar to other systems you can safely use
10.6 as the value. Not specifying any value defaults to 10.3 or sth
like that, very early, and you get a lot of warnings.
Ahh, another options to circumvent the edit of setupext.py, maybe a
quite good option, may be to install pkg-config. This litte program
helps finding libraries. But I have no experience with it.
> REQUIRED DEPENDENCIES
>         numpy: 1.5.0
>       freetype2: found, but unknown version (no pkg-config)
>             * WARNING: Could not find 'freetype2' headers in any
>             * of '.', './freetype2'.
Here you see that the libraries aren't found.
> gcc-4.0 -fno-strict-aliasing -fno-common -dynamic -arch ppc -arch i386 -g
> -O2 -DNDEBUG -g -O3 -DPY_ARRAY_UNIQUE_SYMBOL=MPL_ARRAY_API
> -DPYCXX_ISO_CPP_LIB=1
> -I/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/numpy/core/include
> -I.
> -I/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/numpy/core/include/freetype2
> -I./freetype2
> -I/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -c
> src/ft2font.cpp -o build/temp.macosx-10.3-fat-2.6/src/ft2font.o
> In file included from /usr/include/architecture/i386/math.h:626,
>         from /usr/include/math.h:28,
>         from
> /Library/Frameworks/Python.framework/Versions/2.6/include/python2.6/pyport.h:235,
>         from
> /Library/Frameworks/Python.framework/Versions/2.6/include/python2.6/Python.h:58,
>         from ./CXX/WrapPython.h:61,
>         from ./CXX/Extensions.hxx:37,
>         from src/ft2font.h:4,
>         from src/ft2font.cpp:1:
> /usr/include/AvailabilityMacros.h:108:14: warning: #warning Building for
> Intel with Mac OS X Deployment Target < 10.4 is invalid.
This kind of things occur without MACOSX_DEPLOYMENT_TARGET set.
> In file included from src/ft2font.cpp:1:
> src/ft2font.h:14:22: error: ft2build.h: No such file or directory
This is the error where all the other errors arise from.
The rest is just the compiler's way of bailing out ;-)
Friedrich

Showing 14 results of 14

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