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



Showing 9 results of 9

From: Vidar G. <vid...@37...> - 2005年08月26日 22:48:02
===== Original message from Jeff Whitaker | 2005年8月25日:
> I've created matplotlib colormaps from all the color tables at 
> http://colorbrewer.org, and 
> http://geography.uoregon.edu/datagraphics/color_scales.htm
thanks for providing this,
i hope this will be included in the matplotlib distribution,
along with your script for previewing and listing all colormaps?
(see modification of original code below.)
i would like to mention another archive of color gradients,
http://cpt-city.org.uk/. two examples of color gradients
found here that i think might be useful for plotting data:
Nonlinear grays, e.g. gamma={1/3, 0.5, 0.8, 1.25, ..}
(human vision are more sensitive in the lighter range)
http://cpt-city.org.uk/tl/
Subtle close-to-grayscale gradients, like for instance the
sephia and cyanotype tinted monochrome colormaps found here:
http://cpt-city.org.uk/erj/multiple/
"""
 Usage: colormap-preview.py [cmapname]
 Adapted from original code by Jeff Whitaker
 http://sourceforge.net/mailarchive/message.php?msg_id=12764609
"""
import matplotlib.cm as cm
import pylab as p
def plot_colorbar(cmapname,nsteps=None):
 colormap = cm.__dict__[cmapname]
 fig=p.figure(figsize=(8,1))
 ax = fig.add_axes([0.05,0.05,0.9,0.70])
 if nsteps == None:
 nsteps = colormap.N+1
 clevs = p.linspace(0,1,nsteps+1)
 C = p.array([clevs,clevs])
 X,Y = p.meshgrid(clevs,[0,1])
 levs,coll = ax.contourf(C, Y, X, nsteps-1, cmap=colormap)
 ax.set_xticks([])
 ax.set_yticks([])
 p.title(cmapname)
 p.show()
if __name__ == "__main__":
 names = cm.datad.keys()
 import sys
 if len(sys.argv) > 1:
 cmapname = sys.argv[1]
 else:
 print len(names), 'total color maps'
 print sorted(names)
 cmapname = raw_input('color map name: ')
 if cmapname not in names:
 raise KeyError, 'invalid colormap name,' +\
 ' valid names are '+repr(names)
 plot_colorbar(cmapname)
## end of Python code
-- 
Vidar Bronken Gundersen
 blogged: http://www.37mm.no/blog/ColorBrewer_schemes_for_Matplotlib.html
From: Arnd B. <arn...@we...> - 2005年08月26日 17:10:01
On 2005年8月26日, Rich Shepard wrote:
> On 2005年8月26日, Arnd Baecker wrote:
>
> > I thought it might be of interest to some that a debian-science mailing
> > list has been created. Quoting debian-weekly:
>
> It's unfortunate that the effort is distribution-specific. After all the
> work to remove such differences from various distributions it's counter
> productive to try to re-instate divisions.
Have you actually read the part you snipped away in your reply?
> Perhaps others of us should
> promote a Slackware-science group. Or, a Gentoo-science group.
Just go ahead for slackware.
For Gentoo see:
http://www.gentoo.org/proj/en/desktop/science/index.xml
> Silly.
>
> Rich
Must be Friday, best,
Arnd
From: Rich S. <rsh...@ap...> - 2005年08月26日 13:24:02
On 2005年8月26日, Arnd Baecker wrote:
> I thought it might be of interest to some that a debian-science mailing
> list has been created. Quoting debian-weekly:
 It's unfortunate that the effort is distribution-specific. After all the
work to remove such differences from various distributions it's counter
productive to try to re-instate divisions. Perhaps others of us should
promote a Slackware-science group. Or, a Gentoo-science group.
 Silly.
Rich
-- 
Dr. Richard B. Shepard, President | Author of "Quantifying Environmental
Applied Ecosystem Services, Inc. (TM) | Impact Assessments Using Fuzzy Logic"
<http://www.appl-ecosys.com> Voice: 503-667-4517 Fax: 503-667-8863
From: <aur...@fr...> - 2005年08月26日 12:58:31
Hi all,
I'm having trouble displaying an image using the imshow() command in an e=
mbedded
TkinterCanvasAgg. I used mostly the examples embedding_in_tk2.py and
embedding_in_tk.py
I use two code parts : in my __init__ for the gui def I have :
 self.mplfImageDisplay =3D mpl.figure.Figure(figsize=3D(5,4), dpi=3D100=
)
 #add tk.DrawingArea
 self.cvImageDisplay =3D
FigureCanvasTkAgg(self.mplfImageDisplay,master=3DrightPaneImageDisplay)
 #self.canvas.show()
 self.cvImageDisplay.get_tk_widget().pack()
 #add toolbar
 toolbar =3D NavigationToolbar2TkAgg(self.cvImageDisplay,rightPaneImage=
Display)
 toolbar.update()
 self.cvImageDisplay._tkcanvas.pack()
then in one of my functions, if I use :
 a =3D self.mplfImageDisplay.add_subplot(111)
 a.contourf(x,y,self.scanformatdata,100) #cmap=3Dmpl.cm.gray)
 self.cvImageDisplay.show()
This works fine, but now, I would like to display an image :
 a =3D mpl.image.FigureImage(na.asarray(self.scanformatdata))
 self.cvImageDisplay.show()
This works but I can rescale the image not zoom in using the toolbar, so =
I tried
instead :
 a =3D mpl.axes.Axes(self.mplfImageDisplay,[0.1,1,0.1,1])
 a.imshow(na.asarray(self.scanformatdata),interpolation=3D'nearest')
 self.cvImageDisplay.show()
This does something but I don't know what since nothing is displayed...
Anyone has a clue ? Also, more generally speaking, I found quite extensiv=
e
documentation using the Pylab interface, but as soon as one moves away fr=
om
this (as when you need to if trying to embed in whatever backend, if i
understand well), then there doesn't exist much (?)... is there any sourc=
e I
would have missed ?
All the best,
Aure
From: Arnd B. <arn...@we...> - 2005年08月26日 11:33:09
Hi,
I thought it might be of interest to some that a
debian-science mailing list has been created.
Quoting debian-weekly:
 Debian Science Group. Helen Faulkner [14]announced the creation of the
 [15]debian-science mailing list. It is aimed to encourage discussions
 about how best to [16]use Debian as an operating system for scientific
 research and how to improve Debian by making it more useful to
 scientists and people working in related fields. It should also
 provide an address for scientists where they can ask questions about
 Debian or software in Debian and get useful answers.
 14. http://lists.debian.org/debian-devel/2005/07/msg01555.html
 15. http://lists.debian.org/debian-science/
 16. http://wiki.debian.net/?DebianScience
Best,
Arnd
From: Helge A. <he...@gm...> - 2005年08月26日 08:25:38
On 8/26/05, Jeff Whitaker <js...@fa...> wrote:
> "def get_cmap" line (although this will not make them available via
> pylab calls like 'jet()' and 'hot()'). To get a quick view of what the
this is great, and I think the matlab way with a function for each
color map pollutes the namespace too much. I humbly suggest a syntax
like
 colormap('hot')
or to give bluetones for values < 0, greenish and brown above:
 colormap('earth', zerolevel=3D0.0)
etc. for pylab
Helge
From: Benjamin S. <bsc...@st...> - 2005年08月26日 07:03:37
Attachments: server
I was simply trying out the hint you gave me. I didn't expect it to =
solve my
problem, but I tried anyway.=20
I found it to be the easiest thing I can do just to send it my code. =
It's
not _that_ complex, though you need twisted installed (I don't know =
whether
it'll work with 1.3 - I'm working with 2.0) and you'll need wxpython 2.6
(I'm using features only present in 2.6)
My Attachement is a zip-file. I figured that the outgoing mailserver =
blocks
mail witz zip attachements :-/. First start server.py (in root-dir) - it
will generate the data, then start the client. In the sidebar (once the
client connected to the server) you can select/deselect sources. My idea =
is,
that data collection just goes on, and If I select a source, It displays =
me
all the data currently collected.
The code that has to do with the matplotlib stuff is located in
plugins/wx/monitor.py. Receive(self, data, source) is the retreival =
function
and EnableSource is supposed to enable drawing of a particular =
data-source.
Sorry for not doing a very simple testcase - but I think the code in
monitor.py is simple enough =20
-----Urspr=FCngliche Nachricht-----
Von: Ken McIvor [mailto:km...@gm...]=20
Gesendet: Donnerstag, 25. August 2005 17:12
An: Schindler Benjamin
Cc: mat...@li...
Betreff: Re: AW: [Matplotlib-users] Line2D and wx Backend
On Aug 25, 2005, at 10:02 AM, Schindler Benjamin wrote:
> Since I have to leave from here I cannot yet produce a sample app that =
> would show this behaviour.
It doesn't have to be anything complex, just the bare functionality of=20
whatever you're working on. I'll be happy to take a look at it=20
tomorrow.
> However, I tried to have a non-empty list at the beginning. I replaced =
> Line2D([],[]) with Line2D([1,2],[1,2]) just for the sake of trying -=20
> with no luck apparently.
I'm sorry if I gave you the impression that that was the problem...=20
it's a potential problem, but I didn't mean to suggest that it's why=20
your plot isn't being draw.
Ken
From: Benjamin S. <bsc...@st...> - 2005年08月26日 06:53:01
Yes - this code works at home and at work (Linux/windows). I fail to see =
why
mine won't. I checked the id's - they're correct
-----Urspr=FCngliche Nachricht-----
Von: John Hunter [mailto:jdh...@ac...]=20
Gesendet: Donnerstag, 25. August 2005 18:01
An: Schindler Benjamin
Cc: mat...@li...
Betreff: Re: [Matplotlib-users] Line2D and wx Backend
>>>>> "Schindler" =3D=3D Schindler Benjamin <bsc...@st...> =
writes:
 Schindler> Hi - I'm having problems - I don't get any line
 Schindler> displayed on my screen. My code looks as follows
 Schindler> (Init):
Make sure you are working with the line you think you are
Rather than doing this
 self.axes.add_line(Line2D([],[])
do this
 self.line =3D Line2D([],[]
 self.axes.add_line(self.line)
After you do this
 line =3D self.data[source][0] # Retreive the line
check to make sure that id(line) and id(self.line) are the same.
Here is a simple example that binds events to adding line data.
Perhaps you can follow this (in wx you need to click on the figure
once before the keypress events will be processed)
from matplotlib.lines import Line2D
import matplotlib.numerix as nx
from pylab import figure, show
xdata =3D []
ydata =3D []
line =3D Line2D(xdata, ydata)
def add_data(event):
 if event.key!=3D'a': return
 xdata.extend(nx.mlab.rand(10))
 ydata.extend(nx.mlab.rand(10))
 line.set_data(xdata, ydata)
 fig.canvas.draw()
 =20
fig =3D figure()
ax =3D fig.add_subplot(111)
ax.add_line(line)
ax.set_title("Press 'a' to add more data")
fig.canvas.mpl_connect('key_press_event', add_data)
show()
From: Alan G I. <ai...@am...> - 2005年08月26日 01:20:44
On 2005年8月25日, Menno Straatsma apparently wrote: 
> How can I make make multiple plots within one script using 
> the newest python version? 
The short answer is:
give the fig() command before starting to create each plot,
and give only one show() command at the end.
However all plots will be displayed when you give the show 
command. Like you, I used to use multiple show() commands
in order to get sequential (one at a time) display. I found 
this useful in the classroom. I do not know how to do that 
in pylab now.
Cheers,
Alan Isaac

Showing 9 results of 9

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