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



Showing 7 results of 7

From: Mike N. <mic...@sr...> - 2009年09月23日 23:46:57
I've encountered a segmentation fault using the Agg backend when making 
and saving a png plot. The segmentation fault does not seem to occur 
under different backends (e.g. Cairo).
The sequence of commands amounts to making a plot, setting the limits of 
the plot, then saving the plot as a png using savefig. If the value of 
one of the points is too large, a segmentation fault is generated. 
Obviously the simple work-around is to not plot the out-of-bounds 
points, but the segmentation fault is probably not the desired behavior! 
Below is an example, which generates a segmentation fault on matplotlib 
versions 0.99.0 (run on OS X 10.5.8) and 0.98.5.2 (run on Fedora 11 and 
CentOS 5.3).
Can others reproduce this issue?
Thanks,
Mike Nicolls
import scipy
import matplotlib
matplotlib.use('Agg')
import pylab
if __name__ == '__main__':
 
 xdata,ydata = scipy.rand(2,10)
 xdata[3]=1.0e9 # comment out to avoid seg fault
 
 pylab.figure()
 pylab.plot(xdata,ydata,'k.')
 pylab.xlim((0.0,1.0))
 
 pylab.savefig('test.png')
From: Christopher B. <Chr...@no...> - 2009年09月23日 21:37:24
Teemu Rinne wrote:
> from matplotlib import ft2font
> ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.5/ 
> lib/python
> 2.5/site-packages/matplotlib/ft2font.so, 2): Library not loaded: / 
> Users/jdhunter
> /devbuild/lib/libfreetype.6.dylib
> Am I missing something or is this 0.99.1 OSX package somehow broken?
I think it's broken -- it's looking for a libfreetype in the:
Users/jdhunter/devbuild/lib/
dir, which you're pretty unlikely to have!
John, did you mean to have only static lbs in your devbuild/lib dir, 
which I think would work?
-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: Gökhan S. <gok...@gm...> - 2009年09月23日 21:02:38
On Wed, Sep 23, 2009 at 3:51 PM, Mark Bakker <ma...@gm...> wrote:
> Hello list,
> I recently started using Eclipse with Pydev. I like it a lot but have not
> been able to get interactive plotting going (which otherwise works fine).
>
> My file is simple:
>
> from pylab import *
>
> ion()
>
> plot([1,2,3])
>
>
>
You need to issue a show() here. Thus the plotting window will hang on the
screen until you close it.
Eclipse Platform
Version: 3.5.0
Build id: I20090611-1540
PyDev for Eclipse 1.5.0.1251989166
org.python.pydev.feature.feature.group
> When I run this form within Eclipse, I do see a graphing window open up but
> then it disappears again when it is done, before I can even look at it.
>
> Any suggestions on how to keep the graphing window open?
>
> Thanks,
>
> Mark
>
>
>
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay
> ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
> http://p.sf.net/sfu/devconf
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
-- 
Gökhan
From: Mark B. <ma...@gm...> - 2009年09月23日 20:51:58
Hello list,
I recently started using Eclipse with Pydev. I like it a lot but have not
been able to get interactive plotting going (which otherwise works fine).
My file is simple:
from pylab import *
ion()
plot([1,2,3])
When I run this form within Eclipse, I do see a graphing window open up but
then it disappears again when it is done, before I can even look at it.
Any suggestions on how to keep the graphing window open?
Thanks,
Mark
From: Teemu R. <tee...@he...> - 2009年09月23日 20:36:27
Hi,
I tried to install 0.99.1 [I installed 0.99 a few days ago. I hoped 
that with 0.99.1 I'd get rid of problems with using imshow with 
masked_array and set_bad(alpha=0.0)]:
Python 2.5.2 (r252:60911, Feb 22 2008, 07:57:53)
[GCC 4.0.1 (Apple Computer, Inc. build 5363)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
 >>> from pylab import *
Traceback (most recent call last):
 File "<stdin>", line 1, in <module>
 File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ 
python2.5/site-pac
kages/pylab.py", line 1, in <module>
 from matplotlib.pylab import *
 File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ 
python2.5/site-pac
kages/matplotlib/pylab.py", line 206, in <module>
 from matplotlib import mpl # pulls in most modules
 File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ 
python2.5/site-pac
kages/matplotlib/mpl.py", line 2, in <module>
 from matplotlib import axis
 File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ 
python2.5/site-pac
kages/matplotlib/axis.py", line 10, in <module>
 import matplotlib.font_manager as font_manager
 File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ 
python2.5/site-pac
kages/matplotlib/font_manager.py", line 52, in <module>
 from matplotlib import ft2font
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.5/ 
lib/python
2.5/site-packages/matplotlib/ft2font.so, 2): Library not loaded: / 
Users/jdhunter
/devbuild/lib/libfreetype.6.dylib
 Referenced from: /Library/Frameworks/Python.framework/Versions/2.5/ 
lib/python2
.5/site-packages/matplotlib/ft2font.so
 Reason: image not found
Am I missing something or is this 0.99.1 OSX package somehow broken?
Cheers,
Teemu Rinne
Dept Psychology
University of Helsinki
From: butterw <bu...@gm...> - 2009年09月23日 19:27:36
Hi,
pickers work great to make matplotlib plots more interactive/general user
friendly.
On the subject of the legend_picker.py example, I was wondering if it was
possible to combine both a legend picker and a line picker in the same plot.
>From what I gather they will both use the same onpick event callback. 
So my question is : How do I discriminate between a pick on the legend from
a pick on a line ? The event.artist is a line2D in both cases. 
 
John Hunter-4 wrote:
> 
> On Mon, Aug 3, 2009 at 11:38 PM, Gökhan Sever<gok...@gm...>
> wrote:
>> Hello,
>>
>> I was wondering if it is possible to hide some data on figures using a
>> say
>> right click option to any of the legend entry and make it temporarily
>> hidden/visible to better analyse the rest of the data?
>>
>> Check this screenshot for example:
>>
>> http://img25.imageshack.us/img25/9427/datahiding.png
>>
>> The red data clutters the rest of the figure, and I would like to be able
>> to
>> hide it temporarily so that I can investigate the other two relations
>> more
>> easily.
>>
>> Any ideas? or alternative solutions?
> 
> It's a nice idea, and should be doable with the pick interface we have
> for all mpl artists. Unfortunately, there were a few problems in the
> legend implementation which blocked the pick events from hitting the
> proxy lines they contained. I just made a few changes to mpl svn HEAD
> to support this, and added a new example.
> 
> examples/event_handling/legend_picking.py
> 
> which I'll include below. JJ could you review the changes to legend.py?
> 
> Instructions for checking out svn are at::
> 
> 
> http://matplotlib.sourceforge.net/faq/installing_faq.html#install-from-svn
> 
> Here is the example:
> 
> """
> Enable picking on the legend to toggle the legended line on and off
> """
> import numpy as np
> import matplotlib.pyplot as plt
> 
> t = np.arange(0.0, 0.2, 0.1)
> y1 = 2*np.sin(2*np.pi*t)
> y2 = 4*np.sin(2*np.pi*2*t)
> 
> fig = plt.figure()
> ax = fig.add_subplot(111)
> 
> line1, = ax.plot(t, y1, lw=2, color='red', label='1 hz')
> line2, = ax.plot(t, y2, lw=2, color='blue', label='2 hz')
> 
> leg = ax.legend(loc='upper left', fancybox=True, shadow=True)
> leg.get_frame().set_alpha(0.4)
> 
> 
> lines = [line1, line2]
> lined = dict()
> for legline, realine in zip(leg.get_lines(), lines):
> legline.set_picker(5) # 5 pts tolerance
> lined[legline] = realine
> 
> def onpick(event):
> legline = event.artist
> realline = lined[legline]
> vis = realline.get_visible()
> realline.set_visible(not vis)
> fig.canvas.draw()
> 
> fig.canvas.mpl_connect('pick_event', onpick)
> 
> plt.show()
> 
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008
> 30-Day 
> trial. Simplify your report design, integration and deployment - and focus
> on 
> what you do best, core application coding. Discover what's new with 
> Crystal Reports now. http://p.sf.net/sfu/bobj-july
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
> 
-- 
View this message in context: http://www.nabble.com/Hiding-data-via-legend-tp24802219p25531267.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Cédrick F. <ced...@fr...> - 2009年09月23日 12:59:36
Hi,
I have the same problem as Andrew Kelly
I did the example code below (from coords_demo.py) to reproduce the bug :
#!/usr/bin/env python
"""
An example of how to interact with the plotting canvas by connecting
to move and click events
"""
import sys
from pylab import *
t = arange(0.0, 1.0, 0.01)
s = sin(2*pi*t)
ax = subplot(111)
ax.set_xscale('log')
#ax.plot(t,s)
ax.axhline(0.5, 0, 1)
def on_move(event):
 # get the x and y pixel coords
 x, y = event.x, event.y
 
 if event.inaxes:
 ax = event.inaxes # the axes instance
 print 'data coords', event.xdata, event.ydata
 lst = ax.hitlist(event)
 
def on_click(event):
 # get the x and y coords, flip y from top to bottom
 x, y = event.x, event.y
 if event.button==1:
 if event.inaxes is not None:
 print 'data coords', event.xdata, event.ydata
binding_id = connect('motion_notify_event', on_move)
connect('button_press_event', on_click)
if "test_disconnect" in sys.argv:
 print "disconnecting console coordinate printout..."
 disconnect(binding_id)
show()
Regards,
Cédrick

Showing 7 results of 7

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