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




Showing 3 results of 3

From: Tom D. <tom...@al...> - 2006年02月19日 21:48:22
 I am generating a few hundred graphs and doing so takes on the order of
about 10-15 minutes. Which seems to me rather slow. When I profile my cod=
e
it identifies the calls to get_yticklabels and get_xticklabels as taking
over 90% of the time. This seems strange but my calls to these functions
are merely a sort round about way of setting the font size of the axis tick
labels and suppressing the text for the xticklabels. Is there a more
efficient and cleaner way to do this?
 artist.setp(axes.get_yticklabels(), visible=3DTrue, fontsize=3D7)
 artist.setp(axes.get_xticklabels(), visible=3DFalse)
I am using matplotlib version 0.83.1 and the .png format for my output, if
that helps. Though the profiler seems to suggest that the output is
blazingly fast and it is only these calls to the get_?ticklabels that are
slow.
Hi Michael,
On 19/02/2006, at 1:51 PM, Michael Bentley wrote:
> Hi!
>
>> I have an application that is using PyObjC, matplotlib and scipy to
>> perform some image classification and feature extraction. I am now
>> attempting to use py2app to bundle it up into a single OS X .app.
>
> So I'm wondering -- have you already got a matplotlib backend 
> done? I've just started work on such a project and don't want to 
> duplicate effort.
>
> Lemme know, so I don't waste my time! (that is, if you're willing 
> to share)
>
> -Michael
Yes, I do have this working. I can package up numpy/scipy/matplotlib 
into a .app using py2app, and distribute it. The resulting package is 
rather large and only compresses to 9 MB, but I haven't yet looked 
into what I can exclude from the package or using the Apple-supplied 
Python to reduce size.
I've attached the MatplotlibView class that I made, using code from 
the matplotlib Cocoa backend. (I'm not using the mouse event 
interaction yet, so I haven't tested it.) Just insert a NSView into 
your nib file and set the custom class to MatplotlibView. Then add 
the view as an outlet in your app delegate. (this is "imageView" in 
the following code.)
What I then do in my app delegate is first create the initial look. 
It ends up like this:
 def applicationDidFinishLaunching_(self, notification):
 self.imageView.figure.set_facecolor('w')
 self.imageView.axes.set_axis_off()
 self.imageView.updatePlot()
And then in response to user events, I have a function that updates 
the view:
 def showImage(self):
 axes = self.imageView.axes
 axes.clear()
	...
 if self.displayimage is 'original':
 axes.imshow(self.fullcolourimage, extent=[0,imsizex, 
0,imsizey])
	...
 axes.set_axis_off()
 axes.set_xticks([])
 axes.set_yticks([])
 axes.set_xlim(0, imsizex)
 axes.set_ylim(0, imsizey)
 axes.set_aspect(aspect='equal')
 self.imageView.figure.subplots_adjust 
(left=0,right=1,bottom=0,top=1)
 self.imageView.figure.set_facecolor('w')
 self.imageView.updatePlot()
This will now work fine as long as your app is created using 
"setup.py py2app --alias".
There are a few problems when you want to distribute it and just use 
the standalone "setup.py py2app".
First, in your setup.py you will need to include the matplotlib data 
files:
import matplotlib, glob
mpldata = ''.join([matplotlib.rcParams['datapath'], r'/*'])
matplotlibdata = glob.glob(mpldata)
setup_options['data_files'].append((u'matplotlibdata', matplotlibdata))
This will include the files in your application bundle. When the mpl- 
data directory was moved, the code that allowed any data directory to 
be used was commented out. I am not sure, but I think it applied to 
win32 only anyway. So what you need to do next is edit the matplotlib 
__init__.py, find the lines below "CODE ADDED TO SUPPORT PY2EXE", and 
uncomment them. Remove the "if sys.platorm == 'win32'" (or similar) 
condition as well, to give:
 if sys.frozen: ### Remove "sys.platform == 'win32' and" from here
 path = os.path.join(os.path.split(sys.path[0])[0], 
'matplotlibdata')
 if os.path.isdir(path): return path
 else:
 # Try again assuming sys.path[0] is a dir not a exe
 path = os.path.join(sys.path[0], 'matplotlibdata')
 if os.path.isdir(path): return path
There also seems to be a problem with the way numpy/scipy handles 
being frozen, so you need to actually expand the site-packages.zip 
into a site-packages directory in the same location (and then remove 
the zip). Eg:
unzip -q build/XXX.app/Contents/Resources/Python/site-packages.zip -d 
build/XXX.app/Contents/Resources/Python/site-packages
rm build/Bovillator.app/Contents/Resources/Python/site-packages.zip
And you are done! This should help with you embedding matplotlib into 
an application. I have also developed a mixin class that lets you 
easily add Cocoa bindings to Python code with only one line of code. 
If you want it let me know.
I am also posting this to the matplotlib user mailing list. Since 
these problem issues also might affect others, I will post a shorter 
version detailing these to matplotlib devel and numpy mailing lists.
Cheers,
Josh
From: Steve S. <el...@gm...> - 2006年02月19日 19:24:03
Hi
I'm trying to build 0.86.2 on my Debian box. I changed nothing in 
setup.py that came with the src tar.gz.
	python setup.py build
runs fine but
	sudo python setup.py install
gives
------------------------------------------------------------------------
elcorto@ramrod:~/Install/Matplotlib/matplotlib-0.86.2$ sudo python 
setup.py install
installing data to lib/python2.3/site-packages/matplotlib/mpl-data
pygtk present but import failed
Using default library and include directories for Tcl and Tk because a
Tk window failed to open. You may need to define DISPLAY for Tk to work
so that setup can determine where your libraries are located.
Gtk-WARNING **: cannot open display:
------------------------------------------------------------------------
I found that the pygtk and Tk related messages are produced by 
try/except clauses which try to import gtk and Tkinter, which works in 
the normal interactive python and in a script.
My DISPLAY also set:
$ echo $DISPLAY
:0.0
Any hints are appreciated. Many thanks.
cheers,
steve
-- 
Random number generation is the art of producing pure gibberish as 
quickly as possible.

Showing 3 results of 3

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