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





Showing results of 446

<< < 1 .. 7 8 9 10 11 .. 18 > >> (Page 9 of 18)
From: Alan G I. <ai...@am...> - 2008年06月19日 13:54:31
On 2008年6月19日, Scott Sinclair apparently wrote:
> canvas = FigureCanvas(fig)
What is the relationship between a figure and a canvas?
My impression is the following. You can do all your
drawing on a figure. When you want to render the figure
(e.g., to screen, or printing to file), and not until then, 
you need a canvas. A canvas will therefore always be 
associated with a particular backend.
But when one creates a figure canvas, the canvas registers 
itself with the figure. What does the figure get out of this?
(E.g., if we want the figure to draw itself to the canvas,
the canvas could always pass itself to the figure. Right?)
Thank you,
Alan Isaac
From: Jose Gómez-D. <jgo...@gm...> - 2008年06月19日 13:48:05
Hi,
On Thursday 19 June 2008 00:16:39 KURT PETERS wrote:
> array = gd.ReadAsArray()
> AttributeError: 'NoneType' object has no attribute 'ReadAsArray'
>
> Anyone know what the problem is? Do I need something else?
Did you download the Denver DEM from USGS? From testgdal.py:
# download from 
# http://edcftp.cr.usgs.gov/pub/data/DEM/250/D/denver-w.gz
It should work after that...
Cheers,
Jose
-- 
NERC Centre for Terrestrial Carbon Dynamics,
Department of Geography, University College London
Gower Street, London WC1E 6BT, UK
From: Jose Gómez-D. <j.g...@ge...> - 2008年06月19日 13:45:50
Hi,
On Thursday 19 June 2008 00:16:39 KURT PETERS wrote:
> array = gd.ReadAsArray()
> AttributeError: 'NoneType' object has no attribute 'ReadAsArray'
>
> Anyone know what the problem is? Do I need something else?
Did you download the Denver DEM from USGS? From testgdal.py:
# download from 
# http://edcftp.cr.usgs.gov/pub/data/DEM/250/D/denver-w.gz
It should work after that...
Cheers,
Jose
-- 
NERC Centre for Terrestrial Carbon Dynamics,
Department of Geography, University College London
Gower Street, London WC1E 6BT, UK
From: Scott S. <sin...@uk...> - 2008年06月19日 10:59:01
>>> David Goldsmith <d_l...@ya...> 06/19/08 9:39 AM >>>
Hi! I'm having trouble figuring out how to plot an array as an image with the OO interface - please help (e.g., w/ an example). Thanks,
DG
>>>
>From the examples http://matplotlib.sourceforge.net/matplotlib_examples_0.98.0.zip
../examples/api/agg_oo.py
--------------------------------------------
#!/usr/bin/env python
"""
A pure OO (look Ma, no pylab!) example using the agg backend
"""
from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas
from matplotlib.figure import Figure
fig = Figure()
canvas = FigureCanvas(fig)
ax = fig.add_subplot(111)
ax.plot([1,2,3])
ax.set_title('hi mom')
ax.grid(True)
ax.set_xlabel('time')
ax.set_ylabel('volts')
canvas.print_figure('test')
--------------------------------------------
You can replace the call to ax.plot() with a call to ax.imshow() or ax.pcolor()
Hope that gets you going.
Cheers,
Scott
Please find our Email Disclaimer here: http://www.ukzn.ac.za/disclaimer/
From: Friedrich H. <fri...@gm...> - 2008年06月19日 10:16:47
Hello,
I want to adjust the x position of my ylabel, like
 subplot(111)
 ylabel('YLabel', x=-.25, y=.75)
the 'y=.75' argument is applied but the 'x=-.2' argument has no affect.
But why? Have you any idea to do this?
Thank you,
 Friedrich
Hello,
I am running matplotlib applications over VNC and during the
initialization segment, I always see the above error. It doesn't seem
to cause any problems, but I am curious what is causing it. Does
anyone have an idea? This happens using the Qt4Agg backend at least.
It seems to occur right when I first call ax.plot(...)
Thanks,
Glenn
From: Andrew S. <str...@as...> - 2008年06月19日 08:33:10
rex wrote:
> Andrew Straw <str...@as...> [2008年06月05日 09:42]:
> 
>> For i386:
>>
>> http://debs.astraw.com/hardy/python-matplotlib_0.98.0-0ads2_i386.deb
>>
>> For amd64:
>>
>> http://debs.astraw.com/hardy/python-matplotlib_0.98.0-0ads2_amd64.deb
>>
>> For all arch:
>>
>> http://debs.astraw.com/hardy/python-matplotlib-data_0.98.0-0ads2_all.deb
>> http://debs.astraw.com/hardy/python-matplotlib-doc_0.98.0-0ads2_all.deb
>> 
>
> I tried to install on Debian Lenny with Python 2.5 and it fails with:
>
> python-matplotlib depends on python-wxgtk2.8
>
> wxgtk2.8 doesn't seem to be available for Python 2.5 and Lenny at:
>
> http://apt.wxwidgets.org/dists/
>
> Any ideas, short of building from source?
> 
That's probably your best bet at this point -- my repo is for Ubuntu
Hardy. It looks like you can get the Debian experimental package of
wxwidgets 2.8 at
http://packages.debian.org/hu/source/experimental/wxwidgets2.8 . I have
no idea why this isn't in unstable or testing yet -- a few minutes of
googling didn't find anything.
-Andrew
From: David G. <d_l...@ya...> - 2008年06月19日 07:39:39
Hi! I'm having trouble figuring out how to plot an array as an image with the OO interface - please help (e.g., w/ an example). Thanks,
DG
 
From: rex <re...@no...> - 2008年06月19日 07:20:28
Andrew Straw <str...@as...> [2008年06月05日 09:42]:
>For i386:
>
>http://debs.astraw.com/hardy/python-matplotlib_0.98.0-0ads2_i386.deb
>
>For amd64:
>
>http://debs.astraw.com/hardy/python-matplotlib_0.98.0-0ads2_amd64.deb
>
>For all arch:
>
>http://debs.astraw.com/hardy/python-matplotlib-data_0.98.0-0ads2_all.deb
>http://debs.astraw.com/hardy/python-matplotlib-doc_0.98.0-0ads2_all.deb
I tried to install on Debian Lenny with Python 2.5 and it fails with:
python-matplotlib depends on python-wxgtk2.8
wxgtk2.8 doesn't seem to be available for Python 2.5 and Lenny at:
http://apt.wxwidgets.org/dists/
Any ideas, short of building from source?
Thanks,
-rex
-- 
From: Ryan M. <rm...@gm...> - 2008年06月19日 01:26:34
Yves Revaz wrote:
> Hi all,
> 
> When I use:
> 
> colorbar(orientation='horizontal')
> 
> the color bar is drawn on the bottom of the corresponding graph.
> Which option will draw the colorbar on the top of the graph ?
I think (correct me if I'm wrong devs) you'll have to use the cax 
keyword argument to manually specifiy the position of the axes in which 
to draw the colorbar. You'll also need to adjust the position of the 
plot using figure.subplots_adjust. Like this maybe:
import numpy as np
import matplotlib.pyplot as plt
data = np.random.randn(30,30)
plt.pcolor(data)
fig = plt.gcf()
fig.subplots_adjust(top=0.85)
ax = fig.add_axes([0.12, 0.9, 0.8, 0.05])
plt.colorbar(cax=ax, orientation='horizontal')
Hope this helps,
Ryan
-- 
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma
From: KURT P. <pet...@ms...> - 2008年06月18日 23:16:48
I installed the latest gdal with all the latest basemaps and tried to run 
the testgdal.py program in examples. I get this error:
Traceback (most recent call last):
 File "C:\Documents and Settings\kpeters\My 
Documents\basemap-0.99\examples\testgdal.py", line 19, in <module>
 array = gd.ReadAsArray()
AttributeError: 'NoneType' object has no attribute 'ReadAsArray'
Anyone know what the problem is? Do I need something else?
Kurt
From: Christopher B. <Chr...@no...> - 2008年06月18日 22:06:59
Michael Droettboom wrote:
> Ok -- well, I'm genuinely sorry for wasting your time.
No waste. As I said, I'm investigating Graphics Context for other things 
anyway.
> Paul Kienzle made a change back in February that changed where 
> wx.Yield() gets called, that by side-effect seems to have fixed the 
> clipping slowness.
cool!
> One inherent slowness between Wx and WxAgg is that Wx needs to create a 
> wx.GraphicsPath using a Python loop over the data.
Yes, I suspect that is the biggest problem.
> With the Agg 
> backend, we just pass NumPy arrays (without any copies) to the Agg 
> backend. Perhaps wxPython needs to grow a similar interface...
I think it does, and with the numpy array protocol, it may. There is a 
Google Summer of Code project that may address this. If it doesn't get 
done there, it may get done for another SoC project that I"m mentoring, 
where we need better GraphicsContext performance with numpy arrays.
> As for your toy example, I don't see it getting significantly slower as 
> the number of points increases, but it does crash completely when I plot 
> more than about 11000 points (this is on RHEL4 with a locally-built 
> wxPython-2.8.6.1.) I have updated it to emulate what matplotlib does 
> more closely (use CreatePath etc.)
Does is it still crash with your version? 11000 points really isn't that 
many.
> Lastly, be sure to do an SVN update on matplotlib -- there was a 
> clipping bug in the Wx backend that I have fixed.
thanks for the tip, and even more so, all your work on this.
-Chris
-- 
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chr...@no...
From: Curtis J. <cu...@th...> - 2008年06月18日 19:43:03
Nice. Thanks. I had tried to do something similar, but kept getting
a curved line between each data point.
Also, I too got errors with a previous versions of matplotlib, but 0.98 works.
If someone were willing to add Radar plots to the matplotlib
functionality, would this be wanted by the users or maintainers?
Thanks,
Curtis
On Tue, Jun 17, 2008 at 4:18 PM, Tony S Yu <to...@mi...> wrote:
>
> On Jun 15, 2008, at 11:54 AM, Curtis Jensen wrote:
>
>> There was recently a post on Radar/Spider plotting
>>
>> (http://sourceforge.net/mailarchive/message.php?msg_id=4845303A.9050204%40epcc.ed.ac.uk).
>> I too am interested in creating Radar plots with matplot. Is there a
>> simple way to do this?
>
> Here's a hack to get part of what you want:
>
> =====
> from matplotlib.projections.polar import PolarAxes
> from pylab import *
>
> # Create 6 points (plus 7th point that matches the first) with coordinates
> r, theta
> N = 6
> theta = 2 * pi * linspace(0, 1, N+1)
> r = rand(N+1)
> r[N] = r[0]
>
> # HACK: force PolarAxes to use 1 line segment to connect specified points
> PolarAxes.RESOLUTION = 1
>
> ax = subplot(111, polar=True)
> c = ax.plot(theta, r, 'r-o')
> show()
> =====
>
> I think this only works on matplotlib 0.98. I tried using rgrids and
> thetagrids to change the labels, but for some reason I was getting a
> TypeError when I called either of those functions.
>
> -Tony
>
From: David Warde-F. <dw...@cs...> - 2008年06月18日 19:42:21
On 18-Jun-08, at 3:17 PM, John Hunter wrote:
> If you are using subplots, you can move them over using
>
> fig = figure()
> fig.subplots_adjust(left=0.2)
Works like a charm! Thanks.
One more related thing: is there any way to retrieve the size of a 
textbox in figure coordinates, something like
ax.get_ymajorticklabels[0].get_width()?
Also, I'm kind of wondering why things like set_text() on that 
doesn't work. In general I haven't had much success with editing the 
properties of objects like this.
David
From: John H. <jd...@gm...> - 2008年06月18日 19:17:56
On Wed, Jun 18, 2008 at 1:54 PM, David Warde-Farley <dw...@cs...> wrote:
> Hi folks,
>
> I'm using 'yticks' to set labels on the y axis, unfortunately they're
> rather long strings occasionally. I was wondering if there's a way to
> tweak the position of the axes within the plot, or better yet to have
> it automatically push the axes over so that the entire labels fit (I
> realize that's a tall order and would be quite happy with a way of
> tweaking it manually).
If you are using subplots, you can move them over using
 fig = figure()
 fig.subplots_adjust(left=0.2)
Alternatively, you can manually position your axes using the "axes"
command rather than the "subplot" command, but the above will probably
work for you. We've done some work on auto-layout but w/o much
success. You can however, make 0.2 (or whatever) the default in your
matplotlibrc file using the parameter (see
http://matplotlib.sf.net/matplotlibrc). For example, you can set the
"left" parameter there with::
 figure.subplot.left : 0.125 # the left side of the subplots of the figure
> Another (small, less important) question: is there a way to disable
> the actual 'ticks' and just have labels present?
The easiest way is to make them invisible::
 ax = subplot(111)
 for line in ax.get_yticklines():
 line.set_visible(False)
JDH
From: David Warde-F. <dw...@cs...> - 2008年06月18日 18:55:35
Hi folks,
I'm using 'yticks' to set labels on the y axis, unfortunately they're 
rather long strings occasionally. I was wondering if there's a way to 
tweak the position of the axes within the plot, or better yet to have 
it automatically push the axes over so that the entire labels fit (I 
realize that's a tall order and would be quite happy with a way of 
tweaking it manually).
I managed to get the 'axesPatch' to move over but unfortunately that 
didn't take the axes (or the labels) with it.
Another (small, less important) question: is there a way to disable 
the actual 'ticks' and just have labels present?
Thanks!
David
From: Michael D. <md...@st...> - 2008年06月18日 17:23:30
Ok -- well, I'm genuinely sorry for wasting your time. The benchmarks I 
was referring to are here:
http://sourceforge.net/mailarchive/message.php?msg_id=4734927C.3060601%40stsci.edu
but it seems on further inspection that they no longer apply.
Paul Kienzle made a change back in February that changed where 
wx.Yield() gets called, that by side-effect seems to have fixed the 
clipping slowness.
http://matplotlib.svn.sourceforge.net/viewvc/matplotlib?view=rev&revision=4943
The new results for simple_plot_fps.py are:
wx (with clipping) -----
wallclock: 6.20115208626
user: 6.19
fps: 16.1260357122
wx (without clipping) ----
wallclock: 6.1539440155
user: 6.14
fps: 16.2497415882
wxagg ----
wallclock: 3.52209401131
user: 2.71
fps: 28.3922006849
So, wxAgg is still clearly faster, but not by orders of magnitude, and 
clipping makes no significant difference (the difference shown here is 
probably noise).
One inherent slowness between Wx and WxAgg is that Wx needs to create a 
wx.GraphicsPath using a Python loop over the data. With the Agg 
backend, we just pass NumPy arrays (without any copies) to the Agg 
backend. Perhaps wxPython needs to grow a similar interface...
An interesting side effect of this is that wx and Cairo backends slow 
down sooner as the number of points increases (see attached plot).
As for your toy example, I don't see it getting significantly slower as 
the number of points increases, but it does crash completely when I plot 
more than about 11000 points (this is on RHEL4 with a locally-built 
wxPython-2.8.6.1.) I have updated it to emulate what matplotlib does 
more closely (use CreatePath etc.)
Lastly, be sure to do an SVN update on matplotlib -- there was a 
clipping bug in the Wx backend that I have fixed.
Thanks for your help.
Cheers,
Mike
Christopher Barker wrote:
>
>
> Michael Droettboom wrote:
>>> so are you working on an example? Or should I?
>> I'm happy to do it, but may not get to it for a few days. My own 
>> test was to run "simple_plot_fps.py" with "handle_clip_rectangle" (in 
>> backend_wx.py) turned on and off. But obviously the wxPython folks 
>> will want a more standalone example.
>
> I've made a standalone example (enclosed). It simply makes a call to
>
> GraphicsContext.DrawLines()
>
> with and without clipping. In this case, it's actually a bit faster 
> clipped (on OS-X). Maybe it's different with Paths -- I haven't dug 
> into the MPL code to see how it's being used there.
>
> Also, the whole thing almost hangs (134 seconds to draw) if I up the 
> number of points to 5000!
>
> Could you alter this to use the drawing calls MPL is actually using, 
> then we can send it on the wxPython list.
>
> -Chris
>
>
-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA
From: Christopher B. <Chr...@no...> - 2008年06月18日 15:53:12
Michael Droettboom wrote:
>> so are you working on an example? Or should I?
> I'm happy to do it, but may not get to it for a few days. My own test 
> was to run "simple_plot_fps.py" with "handle_clip_rectangle" (in 
> backend_wx.py) turned on and off. But obviously the wxPython folks will 
> want a more standalone example.
I've made a standalone example (enclosed). It simply makes a call to
GraphicsContext.DrawLines()
with and without clipping. In this case, it's actually a bit faster 
clipped (on OS-X). Maybe it's different with Paths -- I haven't dug into 
the MPL code to see how it's being used there.
Also, the whole thing almost hangs (134 seconds to draw) if I up the 
number of points to 5000!
Could you alter this to use the drawing calls MPL is actually using, 
then we can send it on the wxPython list.
-Chris
-- 
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chr...@no...
From: Bryan F. <bry...@gm...> - 2008年06月18日 15:01:12
I have an axes instance that I would like to rotate. I see that there is a
rotation keyword for text and would like to do something like that with a
plot.
From: Yves R. <yve...@ep...> - 2008年06月18日 07:51:25
Hi all,
When I use:
colorbar(orientation='horizontal')
the color bar is drawn on the bottom of the corresponding graph.
Which option will draw the colorbar on the top of the graph ?
Thanks,
yves
-- 
 (o o)
--------------------------------------------oOO--(_)--OOo-------
 Yves Revaz
 Laboratory of Astrophysics EPFL
 Observatoire de Sauverny Tel : ++ 41 22 379 24 28
 51. Ch. des Maillettes Fax : ++ 41 22 379 22 05
 1290 Sauverny e-mail : Yve...@ep...
 SWITZERLAND Web : http://www.lunix.ch/revaz/
----------------------------------------------------------------
From: Tony S Yu <to...@MI...> - 2008年06月17日 23:19:13
On Jun 15, 2008, at 11:54 AM, Curtis Jensen wrote:
> There was recently a post on Radar/Spider plotting
> (http://sourceforge.net/mailarchive/message.php?msg_id=4845303A.9050204%40epcc.ed.ac.uk 
> ).
> I too am interested in creating Radar plots with matplot. Is there a
> simple way to do this?
Here's a hack to get part of what you want:
=====
from matplotlib.projections.polar import PolarAxes
from pylab import *
# Create 6 points (plus 7th point that matches the first) with 
coordinates r, theta
N = 6
theta = 2 * pi * linspace(0, 1, N+1)
r = rand(N+1)
r[N] = r[0]
# HACK: force PolarAxes to use 1 line segment to connect specified 
points
PolarAxes.RESOLUTION = 1
ax = subplot(111, polar=True)
c = ax.plot(theta, r, 'r-o')
show()
=====
I think this only works on matplotlib 0.98. I tried using rgrids and 
thetagrids to change the labels, but for some reason I was getting a 
TypeError when I called either of those functions.
-Tony
From: Peter W. <pw...@en...> - 2008年06月17日 22:36:24
On Jun 17, 2008, at 9:42 AM, Bryan Fodness wrote:
> Has anyone had a problem posting to either of these mailing lists. 
> I am a member and have sent a few posts to each of them over the 
> last couple months, but none of them show up in the list. I always 
> receive a 'awaiting moderator approval' email. I have sent an email 
> to the owner about this, but have not received a response.
> Bryan
Hi Bryan,
Are you subscribed to those lists? I just searched the membership 
list and did not see your email address.
Non-subscribers get the "awaiting moderator approval" message, but 
since we get so inundated with spam, none of the admins really go 
through the "pending approval" queue...
-Peter
From: Jörgen S. <jor...@bo...> - 2008年06月17日 20:26:23
John Hunter skrev:
> On Tue, Jun 17, 2008 at 3:00 PM, Jörgen Stenarson
> <jor...@bo...> wrote:
> 
>> I did a svn up and a clean rebuild but still the same error. The error
>> reminded me of the problems a while back when references to the
>> fontfiles were not released. So I have tried to look at the filehandles
>> using procexp but I cannot say if this is the problem, but I don't see
>> any explosion in open file handles. But the crash is so sudden I may not
>> be able to see this.
>>
>> Any thing else I can check at my end?
> 
> I wonder if the reference counting in py_as_array is wrong. The most
> likely culprit is the new function in src/ft2font.cpp. Do we need an
> incref here? Joergen, does it help to comment out
> the PyArray_SimpleNewFromData line and replace it with the commented
> out block below it? I need to dig into the ownership and reference
> policy of these two funcs but I don't have time to do it now.
> 
I tried this but it still crashes. Below is the change I did.
/Jörgen
Py::Object
FT2Image::py_as_array(const Py::Tuple & args) {
 _VERBOSE("FT2Image::as_array");
 args.verify_length(0);
 npy_intp dimensions[2];
 dimensions[0] = get_height(); //numrows
 dimensions[1] = get_width(); //numcols
 /*
 PyArrayObject *A = (PyArrayObject *) PyArray_SimpleNewFromData(2, 
dimensions, PyArray_UBYTE, _buffer);
 */
 PyArrayObject *A = (PyArrayObject *) PyArray_FromDims(2, dimensions, 
PyArray_UBYTE);
 unsigned char *src		= _buffer;
 unsigned char *src_end	= src + (dimensions[0] * dimensions[1]);
 unsigned char *dst		= (unsigned char *)A->data;
 while (src != src_end) {
 *dst++ = *src++;
 }
 return Py::asObject((PyObject*)A);
}
From: John H. <jd...@gm...> - 2008年06月17日 20:07:48
On Tue, Jun 17, 2008 at 3:00 PM, Jörgen Stenarson
<jor...@bo...> wrote:
> I did a svn up and a clean rebuild but still the same error. The error
> reminded me of the problems a while back when references to the
> fontfiles were not released. So I have tried to look at the filehandles
> using procexp but I cannot say if this is the problem, but I don't see
> any explosion in open file handles. But the crash is so sudden I may not
> be able to see this.
>
> Any thing else I can check at my end?
I wonder if the reference counting in py_as_array is wrong. The most
likely culprit is the new function in src/ft2font.cpp. Do we need an
incref here? Joergen, does it help to comment out
the PyArray_SimpleNewFromData line and replace it with the commented
out block below it? I need to dig into the ownership and reference
policy of these two funcs but I don't have time to do it now.
Py::Object
FT2Image::py_as_array(const Py::Tuple & args) {
 _VERBOSE("FT2Image::as_array");
 args.verify_length(0);
 npy_intp dimensions[2];
 dimensions[0] = get_height(); //numrows
 dimensions[1] = get_width(); //numcols
 PyArrayObject *A = (PyArrayObject *) PyArray_SimpleNewFromData(2,
dimensions, PyArray_UBYTE, _buffer);
 /*
 PyArrayObject *A = (PyArrayObject *) PyArray_FromDims(2, dimensions,
PyArray_UBYTE);
 unsigned char *src		= _buffer;
 unsigned char *src_end	= src + (dimensions[0] * dimensions[1]);
 unsigned char *dst		= (unsigned char *)A->data;
 while (src != src_end) {
 *dst++ = *src++;
 }
 */
 return Py::asObject((PyObject*)A);
}
From: Jörgen S. <jor...@bo...> - 2008年06月17日 20:00:46
Michael Droettboom skrev:
> I'm not sure these two issues are related.
> 
I don't think so either but I thought I should mention it anyway.
> Before I look deeper, have you updated from SVN today? I fixed a bug 
> earlier today related to using the STIX fonts (which appears to be where 
> this is crashing) on narrow Unicode Python interpreters (which I believe 
> Win32 Python is).
> 
> Occasionally I get these ob_refcnt assertions when distutils didn't 
> decide to rebuild enough things. Try doing a clean rebuild (if you 
> haven't already).
> 
> Cheers,
> Mike
> 
I did a svn up and a clean rebuild but still the same error. The error 
reminded me of the problems a while back when references to the 
fontfiles were not released. So I have tried to look at the filehandles 
using procexp but I cannot say if this is the problem, but I don't see 
any explosion in open file handles. But the crash is so sudden I may not 
be able to see this.
Any thing else I can check at my end?
/Jörgen
4 messages has been excluded from this view by a project administrator.

Showing results of 446

<< < 1 .. 7 8 9 10 11 .. 18 > >> (Page 9 of 18)
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 によって変換されたページ (->オリジナル) /