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





Showing 17 results of 17

From: Nicolas B. <nbi...@gm...> - 2009年08月26日 23:06:16
Its great news that the 3D is receiving more polish :)
After reading on wikipedia, wouldn't it be nicier to have Phong
reflection[1] instead of Gouraud?
Maybe it would be too hard, as the Gouraud seems to be implemented directly
in Agg (from what others just said...)
Anyway, just a suggestion ;)
[1] http://en.wikipedia.org/wiki/Phong_reflection_model
2009年8月26日 Eric Firing <ef...@ha...>
> Reinier Heeres wrote:
> > Hi JJ,
> >
> > Thanks for the examples! I indeed suspected the anti-aliasing as well.
> > I'll include an option for linecolors = facecolors soon (probably this
> > weekend); it seems to be a good solution.
>
> No, not in general. There are two problems: it distorts the sizes and
> positions of the patches, very slightly, but enough that it might be a
> problem in some applications; and it does not work with alpha != 1.
>
> Eric
>
>
> ------------------------------------------------------------------------------
> 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
>
From: Russell E. O. <ro...@uw...> - 2009年08月26日 22:50:18
A few things:
- What python and matplotlib are you using? I recommend Mac Python from 
python.org (use the binary installer) and the Mac binary installer for 
matplotlib.
- Note that matplotlib 0.99.0 is current. I suggest you upgrade.
- If you are using TkAgg (as seems likely), I'm not sure how well it 
plays with IDLE. I suggest you try the same example from the command 
line (Terminal application).
- What is your default backend? The normal Mac binary matplotlib uses 
TkAgg, which is a good choice in this case. But if you build from source 
the default is Agg, which is probably not what you want. You can set the 
default explicitly by editing .matplotlib/matplotlibrc (which has 
probably appeared now that you've run matplotlib once).
Here's a slightly shorter example (I confess I'm not familiar with 
matplotlib.pyplot so I hope this is not deprecated):
import pylab
pylab.plot([1, 2, 3])
pylab.show()
-- Russell
In article <426...@we...>,
 Walid Majid <wm...@ya...> wrote:
> Hi,
> 
> I am new to matplotlib and having trouble running a simple example, which I 
> found on one of the tutorial pages:
> 
> import matplotlib.pyplot as plt
> plt.plot([1,2,3])
> plt.ylabel('some numbers')
> plt.show()
> 
> The problem I encounter is that no plot actually shows up when I run the 
> above sequence on my idle session. 
> I am running on Mac OS X 10.5.6 and if anyone can give me some help, I would 
> appreciate it. 
> 
> Python: 2.5.4
> idle: 1.2.4
> matplotlib: 0.98.5.3
> 
> WM
From: Xavier G. <xav...@gm...> - 2009年08月26日 22:47:16
>> Hi,
>>
>> I have already asked about that but I'm back once again :)
>>
>> The way I use matplotlib may be a corner case:
>> I'm often looking at large (4k x 4k) images and I do want to see the
>> pixels values moving the mouse over the display.
>> imshow does a great job but all the backend only display "x= y=".
>> I would love to see "x= y= Z=" (or "value="...call it the way you want ;))
>>
>> What is the best way to do that?
>> imshow is great because there is nothing to connect to see x and y
>> values on the backend.
>> I need to code something as simple as imshow to get also the pixel values.
>> 
>
> The easiest way I can think of is to override Axes.format_coord
> method. A pseudo code might look like below
>
> def report_pixel(x, y):
> # get the pixel value
> v = get_pixel_value_of_your_image(x,y)
>
> return "x=%f y=%f value=%f" % (x, y, v)
>
> ax = gca()
> ax.format_coord = report_pixel
>
> The code will become more complicated if you want to support multiple images.
> This solution is far from elegant, but maybe the easiest one.
>
> -JJ
>
> 
>> Is there really on way to get that as a new option in imshow? at least
>> in one of the backend (as a starting point)
>>
>> Best Regards,
>> Xavier
>> 
Thanks it does work but I still wonder why it is not an option in imshow
Xavier
From: dek <dr...@ho...> - 2009年08月26日 20:15:48
I made a toolbar in a figure originally tied to a canvas via wx backend
means. I cleared the figure, assigned a new canvas, and want to assign the
same toolbar to it. Recreating the toolbar and setting it in wx caused odd
display transition (it was slow I suppose?).
I've been able to to get this mostly to work by simply using:
self.toolbar.canvas = self.canvas
self.toolbar._idDrag=self.canvas.mpl_connect('motion_notify_event',\
 	self.toolbar.mouse_move)
This works so long as a toolbar button isn't pressed originally upon putting
in a new canvas, in which case the user would have to repress the previously
pressed button to make it work.
Any ideas on what I can do?
-- 
View this message in context: http://www.nabble.com/assign-pre-existing-toolbar-to-new-canvas-tp25157107p25157107.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Eric F. <ef...@ha...> - 2009年08月26日 17:29:51
Reinier Heeres wrote:
> Hi JJ,
> 
> Thanks for the examples! I indeed suspected the anti-aliasing as well.
> I'll include an option for linecolors = facecolors soon (probably this
> weekend); it seems to be a good solution.
No, not in general. There are two problems: it distorts the sizes and 
positions of the patches, very slightly, but enough that it might be a 
problem in some applications; and it does not work with alpha != 1.
Eric
From: Michael D. <md...@st...> - 2009年08月26日 17:15:50
Jae-Joon Lee wrote:
> On Wed, Aug 26, 2009 at 6:22 AM, German Ocampo<ger...@gm...> wrote:
> 
>> Hello
>>
>> Are there some way to take out the gridlines from a surface in mplot3D
>> and get a smooth colour change?
>>
>> 
> Micheal,
> If my understanding is correct, we will see this artifacts even with
> the Gouraud shading. What do you think?
> 
The Agg Gouraud function deals with these artifacts by oversizing the 
area by half a pixel, which is more or less equivalent to what the 
"edgecolor == facecolor" trick does, except with Gouraud shading the 
edgecolor is not constant, but interpolated. So, no, the artifacts will 
not be there. There are other inherent artifacts related to the 
triangulation itself, of course ;)
Mike
-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA
From: Ignacio A. S. <ign...@gm...> - 2009年08月26日 15:41:54
I have a problem with zoom/pan in matplot NavigationToolbar. I am
using networkx to generate graphs and it's interface to matplot to
draw it. When I use zoom/pan with the NavigationToolbar, the edges and
the labels don't resize. I don't know if this is a networkx or a
matplotlib problem. This is my source code:
import sys, os, random
from PyQt4 import QtGui, QtCore
from numpy import arange, sin, pi
from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas
from matplotlib.backends.backend_qt4agg import NavigationToolbar2QTAgg
as NavigationToolbar
from matplotlib.figure import Figure
import networkx as nx
progname = os.path.basename(sys.argv[0])
progversion = "0.1"
class MyMplCanvas(FigureCanvas):
 """Ultimately, this is a QWidget (as well as a FigureCanvasAgg, etc.)."""
 def __init__(self, parent=None, width=5, height=4, dpi=100):
 fig = Figure(figsize=(width, height), dpi=dpi)
 self.axes = fig.add_subplot(111)
 self.axes.set_navigate(True)
 # We want the axes cleared every time plot() is called
 self.axes.hold(False)
 self.compute_initial_figure()
 #
 FigureCanvas.__init__(self, fig)
 self.setParent(parent)
 FigureCanvas.setSizePolicy(self,
 QtGui.QSizePolicy.Expanding,
 QtGui.QSizePolicy.Expanding)
 FigureCanvas.updateGeometry(self)
 def compute_initial_figure(self):
 pass
class MyStaticMplCanvas(MyMplCanvas):
 """Simple canvas with a sine plot."""
 def __init__(self,*args,**kwargs):
 MyMplCanvas.__init__(self,*args,**kwargs)
 self.mpl_connect('pick_event',self.onpick)
 def compute_initial_figure(self):
 G=nx.star_graph(20)
 pos=nx.graphviz_layout(G)
 nodes = nx.draw_networkx_nodes(G,pos,ax=self.axes)
 print nodes
 nodes.set_picker(True)
 edges = nx.draw_networkx_edges(G,pos,ax=self.axes)
 self._labels = range(len(G.nodes()))
 labels=dict(zip(self._labels,self._labels))
 nx.draw_networkx_labels(G, pos, ax=self.axes,labels=labels)
 def onpick(self,event):
 ind=event.ind[0]
 print self._labels[ind]
 return True
class ApplicationWindow(QtGui.QMainWindow):
 def __init__(self):
 QtGui.QMainWindow.__init__(self)
 self.setAttribute(QtCore.Qt.WA_DeleteOnClose)
 self.setWindowTitle("application main window")
 self.file_menu = QtGui.QMenu('&File', self)
 self.file_menu.addAction('&Quit', self.fileQuit,
 QtCore.Qt.CTRL + QtCore.Qt.Key_Q)
 self.menuBar().addMenu(self.file_menu)
 self.help_menu = QtGui.QMenu('&Help', self)
 self.menuBar().addSeparator()
 self.menuBar().addMenu(self.help_menu)
 self.help_menu.addAction('&About', self.about)
 self.main_widget = QtGui.QWidget(self)
 l = QtGui.QVBoxLayout(self.main_widget)
 sc = MyStaticMplCanvas(self.main_widget, width=5, height=3, dpi=100)
 l.addWidget(sc)
 bar = NavigationToolbar(sc,self)
 l.addWidget(bar)
 self.main_widget.setFocus()
 self.setCentralWidget(self.main_widget)
 def fileQuit(self):
 self.close()
 def closeEvent(self, ce):
 self.fileQuit()
 def about(self):
 QtGui.QMessageBox.about(self, "About %s" % progname,
u"""%(prog)s version %(version)s
Copyright \N{COPYRIGHT SIGN} 2005 Florent Rougon, 2006 Darren Dale
This program is a simple example of a Qt4 application embedding matplotlib
canvases.
It may be used and modified with no restriction; raw copies as well as
modified versions may be distributed without limitation."""
% {"prog": progname, "version": progversion})
qApp = QtGui.QApplication(sys.argv)
aw = ApplicationWindow()
aw.setWindowTitle("%s" % progname)
aw.show()
sys.exit(qApp.exec_())
From: Reinier H. <re...@he...> - 2009年08月26日 15:20:12
Hi JJ,
Thanks for the examples! I indeed suspected the anti-aliasing as well.
I'll include an option for linecolors = facecolors soon (probably this
weekend); it seems to be a good solution.
After that I'll try to implement usage of the Gouraud shading,
although I fear that this will not look nice with
edgecolors=facecolors, so anti-aliasing might have to be turned off in
that case. Is it perhaps possible to only render the surface with AA
off?
Cheers,
Reinier
On Wed, Aug 26, 2009 at 5:03 PM, Jae-Joon Lee<lee...@gm...> wrote:
> On Wed, Aug 26, 2009 at 6:22 AM, German Ocampo<ger...@gm...> wrote:
>> Hello
>>
>> Are there some way to take out the gridlines from a surface in mplot3D
>> and get a smooth colour change?
>
> I think surface plot does not draw any gridlines by default (linewidth
> set to 0). Maybe you're referring the artifacts between each surface
> elements, as can be seen in the example below
>
> http://matplotlib.sourceforge.net/examples/mplot3d/surface3d_demo.html
>
> My guess is that they are artifacts of antialiasing that edges gets
> somewhat transparent.
>
> So, you may turn off antialiasing, but plot gets a bit ugly. Or you
> may actually strokes the edges with their face colors.
>
> See the example plot attached.
>
> The second example is created with high resolution grid to demonstrate
> smooth color variation (this is extremely slow to render though).
>
> It may be better if mplot3d has option for this, but I'll leave it to
> Reinier, the original author of mplot3d.
>
> Micheal,
> If my understanding is correct, we will see this artifacts even with
> the Gouraud shading. What do you think?
>
> Regards,
>
> -JJ
>
> ps. I'm resending this message with external link to images due to the
> attachment size limit in mpl list.
>
> http://dl.getdropbox.com/u/178748/mpl/mplo3d_test_lowres.png
> http://dl.getdropbox.com/u/178748/mpl/mplo3d_test_hires.png
-- 
Reinier Heeres
Tel: +31 6 10852639
From: Jae-Joon L. <lee...@gm...> - 2009年08月26日 15:04:00
On Wed, Aug 26, 2009 at 6:22 AM, German Ocampo<ger...@gm...> wrote:
> Hello
>
> Are there some way to take out the gridlines from a surface in mplot3D
> and get a smooth colour change?
>
I think surface plot does not draw any gridlines by default (linewidth
set to 0). Maybe you're referring the artifacts between each surface
elements, as can be seen in the example below
http://matplotlib.sourceforge.net/examples/mplot3d/surface3d_demo.html
My guess is that they are artifacts of antialiasing that edges gets
somewhat transparent.
So, you may turn off antialiasing, but plot gets a bit ugly. Or you
may actually strokes the edges with their face colors.
See the example plot attached.
The second example is created with high resolution grid to demonstrate
smooth color variation (this is extremely slow to render though).
It may be better if mplot3d has option for this, but I'll leave it to
Reinier, the original author of mplot3d.
Micheal,
If my understanding is correct, we will see this artifacts even with
the Gouraud shading. What do you think?
Regards,
-JJ
ps. I'm resending this message with external link to images due to the
attachment size limit in mpl list.
http://dl.getdropbox.com/u/178748/mpl/mplo3d_test_lowres.png
http://dl.getdropbox.com/u/178748/mpl/mplo3d_test_hires.png
From: ms <dev...@gm...> - 2009年08月26日 15:01:40
Hi,
Can anyone help me to find how to draw an area chart (something like
http://commons.wikimedia.org/wiki/File:Browser_Wars.png ) with MPL?
Googling and the MPL gallery didn't help.
thanks!
m.
From: German O. <ger...@gm...> - 2009年08月26日 13:54:09
Mike
thanks for your answer. I will wait for this option.
regards
german
On Wed, Aug 26, 2009 at 3:45 PM, Michael Droettboom<md...@st...> wrote:
> Smooth Gouraud shading on surface plots is being worked on, but is not yet
> implemented.
>
> Mike
>
> German Ocampo wrote:
>>
>> Hello
>>
>> Are there some way to take out the gridlines from a surface in mplot3D
>> and get a smooth colour change?
>>
>> Thanks
>>
>> German
>>
>>
>> ------------------------------------------------------------------------------
>> 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
>>
>
> --
> Michael Droettboom
> Science Software Branch
> Operations and Engineering Division
> Space Telescope Science Institute
> Operated by AURA for NASA
>
>
From: Michael D. <md...@st...> - 2009年08月26日 13:52:04
Smooth Gouraud shading on surface plots is being worked on, but is not 
yet implemented.
Mike
German Ocampo wrote:
> Hello
>
> Are there some way to take out the gridlines from a surface in mplot3D
> and get a smooth colour change?
>
> Thanks
>
> German
>
> ------------------------------------------------------------------------------
> 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
> 
-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA
From: German O. <ger...@gm...> - 2009年08月26日 10:22:45
Hello
Are there some way to take out the gridlines from a surface in mplot3D
and get a smooth colour change?
Thanks
German
Chris,
Christopher Barker wrote:
> Werner F. Bruhin wrote:
>> The other problem I have is that the xtick_labels are cut off at the 
>> bottom when the frame is resized below a certain size. How can I 
>> prevent this?
>
> I don't think MPL yet has a system for making things fit, so you need 
> to change the size/position of your axes object:
>
> axes.set_position(pos, which='both')
>
> """
> Set the axes position with:
>
> pos = [left, bottom, width, height]
> """
>
> these are in "figure units" which are relative to figure size, from 0 
> to 1. Unfortunately, what this means is that the amount of space for 
> the axis labels varies with the size of the figure, as you've discovered.
>
>
> The default for a single axes in a figure is:
>
> (0.125, 0.1, 0.9, 0.9)
>
> so you might try something like:
>
> axes.set_position((0.125, 0.15, 0.9, 0.85) )
>
> what is best depends on what size you want your figure to look good at.
Thanks for this tip, will play around with this a bit. First try shifts 
the figure of the panel on the top left and right, so this will need a 
bit more digging on my part.
Werner
From: Auré G. <aur...@ya...> - 2009年08月26日 08:14:36
> The patches hide the contourf correctly, as expected, but not the
> contour lines...
Sounds like a zorder problem:
http://matplotlib.sourceforge.net/examples/pylab_examples/zorder_demo.html
-- 
Jouni K.. Sepp?nen
I'd missed that point... Thanks, it's working fine now !
Cheers,
Aure
 
From: John H. <jd...@gm...> - 2009年08月26日 01:19:18
On Tue, Aug 25, 2009 at 4:59 PM, Patrick Rynhart<pry...@gm...> wrote:
> Thanks again for your help. Do you think that testing for the version
> of the Visual C redistributable is required during an install of
> matplotlib (and/or possibly at runtime).
This shouldn't be an issue with recent binaries of mpl, eg 0.99 and
later, so hopefully we won't have to worry about this install check.
I think we've fixed the MSVCP71.DLL problem, but if you experience
otherwise let us know.
JDH
From: Patrick R. <pry...@gm...> - 2009年08月26日 01:14:18
Hi again,
Just to update you, copying across the Visual C/C++ runtime library
(MSVCP71.DLL) from a Windows XP SP3 install to
C:\Python25\Lib\site-packages\matplotlib on Windows Server 2008 does
in fact appear to work correctly with matplotlib after all.
Regards,
Patrick
--
Dr Patrick Rynhart
Linux Systems Administrator / Team Leader
IT Support Group
School of Engineering and Advanced Technology
AgHort A Room 3.61
Massey University (Turitea Campus)
NEW ZEALAND
Phone +64 6 356 9099 extn 2444
2 messages has been excluded from this view by a project administrator.

Showing 17 results of 17

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