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





Showing 6 results of 6

From: Valentino G. <vgg...@uc...> - 2010年05月05日 22:37:42
I am trying to make a scatter plot (it is important that it is a scatter 
plot because I want the markers to be color coded). Each point also has 
errobars associated and since there is no way to plot errorbars on 
scatter plots I am plotting them separately, i.e. plot twice: once with 
the errorbars and no markers and then with only markers as in a scatter 
plot. 
The problem is that regardless of the order in which I do this, the 
errorbars are alwas on top of the markers of the scatter plot and I 
would like the opposite, markers on top of the errorbars. Can this be 
done? And more generally, how can I choose what goes on top of what?
Thanks,
Valentino.-
From: Jouni K. S. <jk...@ik...> - 2010年05月05日 15:16:19
"ai...@gm..." <ai...@gm...> writes:
> I have strange problem while I am importing matplotlib.
> File "/usr/lib/python2.6/xml/sax/saxutils.py", line 6, in <module>
> import os, urlparse, urllib, types
> File "/usr/lib/python2.6/urllib.py", line 26, in <module>
> import socket
> File "socket.py", line 7, in <module>
> except socket.error:
> AttributeError: 'module' object has no attribute 'error'
Note how Python prints the full path of saxutils.py and urllib.py but a
bare filename for socket.py. You probably have a file named socket.py in
your current working directory that is inadvertently getting imported by
urllib.py.
-- 
Jouni K. Seppänen
http://www.iki.fi/jks
From: Alan G I. <ala...@gm...> - 2010年05月05日 13:44:10
On 5/5/2010 6:53 AM, Kim Hansen wrote:
> Could anyone give a working example of an embedded, animated plot in a
> Tkinter application, where animated=True is used together with canvas
> background copying to make efficient animated plots in Tkinter
> together with other widgets?
First see the embedding_in_tk.py example.
Then, for a simple example, you can see TSPlot here:
http://econpy.googlecode.com/svn/trunk/abm/gridworld/gridworld.py
You can stick it in any frame.
For a more complex example see diagram_cl
http://www.friedrichromstedt.org/index.php?m=186
hth,
Alan Isaac
From: KrishnaPribadi <Kri...@ha...> - 2010年05月05日 13:12:43
Ryan May-3 wrote:
> 
> 
> You can accomplish it by:
> 
> ax.texts.remove(arrow)
> 
> I'd still like to know why this exception gets raised:
> 
> 
> NotImplementedError Traceback (most recent call
> last)
> 
> /home/rmay/<ipython console> in <module>()
> 
> /home/rmay/.local/lib/python2.6/site-packages/matplotlib/artist.pyc in
> remove(self)
> 123 self._remove_method(self)
> 124 else:
> --> 125 raise NotImplementedError('cannot remove artist')
> 126 # TODO: the fix for the collections relim problem is to
> move the
> 
> 127 # limits calculation into the artist itself, including
> the property
> 
> 
> NotImplementedError: cannot remove artist
> 
> JJ, thoughts?
> 
> Ryan
> 
> -- 
> Ryan May
> Graduate Research Assistant
> School of Meteorology
> University of Oklahoma
> 
> ------------------------------------------------------------------------------
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
> 
Ryan,
I implemented this code fine and NEVER got any raised exceptions... Maybe
you did something else wrong?
-----
Krishna Adrianto Pribadi
Test Engineer
Harley-Davidson Motor Co.
Talladega Test Facility
Vehicle Test Stands
-- 
View this message in context: http://old.nabble.com/remove---delete-arrow---annotate%2C-how-to--tp28451836p28460643.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
Trying to build matplotlib as given in the subject:
matplotlib 0.99.1.2
with:
freetype 2.3.12 (installed by standard procedure)
libpng 1.4.1 (installed by standard procedure)
on:
Mac OS X 10.6 (Snow Leopard) with Xcode 3.2.1 installed
fails according to
http://stackoverflow.com/questions/2442335/libpng-boostgil-png-infopp-null-not-found
because there seems to be some not-backward compatible API change from
libpng 1.2 => 1.4. The error I get is the same as reported under this
URL. The log is attached as setup-build.log.
Also I attach setup-config.log which shows only configuration result
and the modified setupext.py, modified such that freetype2 and libpng
are found on my darwin Mac OS X 10.6. The changes are marked by my
name Friedrich.
I think I can fix this as given under the URL above and a workaround
would probably be to revert to libpng 1.2 but I think this isn't the
perfect solution either ...
I also noticed that the buildbot is failing currently, is this normal behaviour?
I found no such issue on the list, I'm reading since Feb 22 and libpng
1.4 was released Feb 25 according to
http://www.libpng.org/pub/png/src/libpng-1.4.1-README.txt .
Friedrich
From: Kim H. <sla...@gm...> - 2010年05月05日 10:54:06
Hi,
Could anyone give a working example of an embedded, animated plot in a
Tkinter application, where animated=True is used together with canvas
background copying to make efficient animated plots in Tkinter
together with other widgets?
I cannot make it work myself, see below.
I am working on a prototype, where have some Tkinter widgets to
control what is plotted. What I want to plot is something which
progress in time depending on the state of the widgets, and it is
potentially a lot of graphs and details on the canvas, but only minor
changes between updates. So I would rather avoid redrawing the whole
canvas.
I would therefore like to use the trick with copying the backgorund,
static canvas from frame to frame to a buffer, and only draw the
animated artists on top of it as is discussed in
http://www.scipy.org/Cookbook/Matplotlib/Animations#head-3d51654b8306b1585664e7fe060a60fc76e5aa08
and also examplified in
http://matplotlib.sourceforge.net/examples/animation/animation_blit_tk.html
Now, the example does not embed the matplotlib canvas in a Tkinter
root class, which I need if I want to add other Tk widgets on the same
window
I have therefore tried to modify the animation by merging in the
embbedding in Tk example:
http://matplotlib.sourceforge.net/examples/user_interfaces/embedding_in_tk.html
The closest I have gotten to something, which works is this:
import matplotlib
matplotlib.use('TkAgg')
import Tkinter
import sys
import pylab as p
import numpy as npy
import time
root = Tkinter.Tk()
fig = matplotlib.figure.Figure()
ax = fig.add_subplot(111)
canvas = matplotlib.backends.backend_tkagg.FigureCanvasTkAgg(fig, root)
canvas.get_tk_widget().grid()
# create the initial line
x = npy.arange(0,2*npy.pi,0.01)
ax.grid(True)
# canvas.show() #If I add this, it does not show anything?
line, = ax.plot(x, npy.sin(x), animated=True, lw=2)
def run(*args):
 background = canvas.copy_from_bbox(ax.bbox)
 # for profiling
 tstart = time.time()
 while 1:
 # restore the clean slate background
 canvas.restore_region(background)
 # update the data
 line.set_ydata(npy.sin(x+run.cnt/10.0))
 # just draw the animated artist
 ax.draw_artist(line)
 # just redraw the axes rectangle
 canvas.blit(ax.bbox)
 if run.cnt==1000:
 # print the timing info and quit
 print 'FPS:' , 1000/(time.time()-tstart)
 sys.exit()
 run.cnt += 1
run.cnt = 0
manager = p.get_current_fig_manager()
manager.window.after(100, run)
p.show() # If I outcomment this, the graph does not animate
Now, this does show an efficient animated plot embedded in a Tk
application, but I cannot make it work witout instatiating the other
annoying backgroud window, whcih pops up when the p.show() is done.
However, if i uncomment it, I never get a visible window.
As I have understood the cookbook, one should draw the canvas before
copying it to the background and before drawing the animated Artists.
However, if I do that it does not work either.
I must admit, that I do not fully grasp waht is goin on in the lines,
where the current figure manager is associated woth the run method.
Another problem with the naimation is that it is not possible to close
it nicely.
Any help would be appreciated.
Kim
1 message has been excluded from this view by a project administrator.

Showing 6 results of 6

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