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
(3) |
|
2
|
3
(1) |
4
(7) |
5
(7) |
6
(11) |
7
(3) |
8
(4) |
|
9
(5) |
10
(5) |
11
(15) |
12
(7) |
13
(5) |
14
(4) |
15
(5) |
|
16
|
17
(4) |
18
(8) |
19
(12) |
20
(11) |
21
(4) |
22
(2) |
|
23
(4) |
24
(7) |
25
(5) |
26
(13) |
27
(3) |
28
(10) |
29
(3) |
|
30
(1) |
31
(15) |
|
|
|
|
|
|
From: Humufr <hu...@ya...> - 2005-01-20 03:50:44
|
Hi,
I have a problem to draw a rectangle:
The first is that I can't arrive to draw a rectangle with ipython
-pylab, the script who work when it's launch independantly is not
working interactively. The rectangle is not draw. Perhaps it's normal
but I don't think.
The second problem I have is to draw a rectangle at a certain position
with certain height and width. It's seems (at least when I tried to use
it) that the position must be done relatively at the window and not from
the plot. It's not very convenient because if I have a plot draw between
1 and 100 in x and y, to draw the rectangle I add to use something
between 0 and 1 so I had to rescale the rectangle.
Thanks,
Nicolas
|
|
From: danny s. <dan...@ya...> - 2005-01-19 23:03:41
|
my comments on modules being exposed appear to have fallen into a vacuum. I still ask if "from matplotlib import *" should expose the time module or the sys module? Danny --- John Hunter <jdh...@ac...> wrote: > >>>>> "Andrew" == Andrew Straw <str...@as...> writes: > > Andrew> I've just committed a patch to stop "from pylab import *" > Andrew> from overriding Python builtin functions like min() and > Andrew> max(). > > Andrew> Spurred on by the potential of matplotlib included in the > Andrew> Enthought Edition of Python, I've gone ahead and added > the > Andrew> following lines to pylab.py in CVS: > > Andrew> import __builtin__ min = __builtin__.min max = > Andrew> __builtin__.max sum = __builtin__.sum round = > Andrew> __builtin__.round abs = __builtin__.abs > > > I thought we last left this with the idea that these changes would be > made in matplotlib.numerix level, and that the old symbols would > still > be provided under the names amin, amax, aabs, etc..., and the > existing > matplotlib code and examples would be ported to the new naming > scheme. > Eg, > http://sourceforge.net/mailarchive/forum.php?thread_id=6323208&forum_id=36187 > > My fear is that if we do this in pylab but not numerix, confusion > will > only deepen. > > FYI, we have until late Thursday I think to get anything we want in > before the final enthon roll-up. > > JDH > > > ------------------------------------------------------- > This SF.Net email is sponsored by: IntelliVIEW -- Interactive > Reporting > Tool for open source databases. Create drag-&-drop reports. Save time > by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, > etc. > Download a FREE copy at http://www.intelliview.com/go/osdn_nl > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > __________________________________ Do you Yahoo!? Yahoo! Mail - Find what you need with new enhanced search. http://info.mail.yahoo.com/mail_250 |
|
From: Dominique O. <Dom...@po...> - 2005-01-19 22:57:52
|
Nadia Dencheva wrote: > I've been able to reproduce the problem on MacOSX (after the > correction), although I don't have an answer to what's causing it now. Results seem inconsistent; if i replace the 'rosenbrock' function in my previous script with def saddle(x,y): return y**2 - x**2 and use x = y = arange( -2, 2, 0.1 ) then contour( Z, x = X, y = Y, levels = 30, origin = 'lower' ) produces the zigzags, but contour( Z, x = X, y = Y, levels = 30, origin = 'upper' ) doesn't. The same isn't true of the rosenbrock function. I wonder if the zigzags might be coming from the C function which computes the levels. Is there a C interface to that function somewhere that we could try? Dominique |
|
From: John H. <jdh...@ac...> - 2005-01-19 22:45:27
|
>>>>> "Andrew" == Andrew Straw <str...@as...> writes:
Andrew> I've just committed a patch to stop "from pylab import *"
Andrew> from overriding Python builtin functions like min() and
Andrew> max().
Andrew> Spurred on by the potential of matplotlib included in the
Andrew> Enthought Edition of Python, I've gone ahead and added the
Andrew> following lines to pylab.py in CVS:
Andrew> import __builtin__ min = __builtin__.min max =
Andrew> __builtin__.max sum = __builtin__.sum round =
Andrew> __builtin__.round abs = __builtin__.abs
I thought we last left this with the idea that these changes would be
made in matplotlib.numerix level, and that the old symbols would still
be provided under the names amin, amax, aabs, etc..., and the existing
matplotlib code and examples would be ported to the new naming scheme.
Eg,
http://sourceforge.net/mailarchive/forum.php?thread_id=6323208&forum_id=36187
My fear is that if we do this in pylab but not numerix, confusion will
only deepen.
FYI, we have until late Thursday I think to get anything we want in
before the final enthon roll-up.
JDH
|
|
From: Andrew S. <str...@as...> - 2005-01-19 22:33:35
|
I've just committed a patch to stop "from pylab import *" from overriding Python builtin functions like min() and max(). Spurred on by the potential of matplotlib included in the Enthought Edition of Python, I've gone ahead and added the following lines to pylab.py in CVS: import __builtin__ min = __builtin__.min max = __builtin__.max sum = __builtin__.sum round = __builtin__.round abs = __builtin__.abs Although I didn't do anything about it, and without having thought about it deeply, I like Norbert Nemec's idea of introducing __round__ (and __min__, __max__, and __sum__ for sequences) methods into standard Python, thus eliminating the need for functions in numpy/numarray to accomplish these same tasks. Unfortunately, I don't have the time to get into this right now. (This approach would also ask numpy/numarray to eliminate their abs() function in favor of implementing an __abs__() method on array types.) Cheers! Andrew |
|
From: John H. <jdh...@ac...> - 2005-01-19 19:24:35
|
>>>>> "Engelsma," == Engelsma, Dave <D.E...@La...> writes:
Dave> Hi John, I'm wondering how to set the fontsize of the
Dave> ticklabels on an axis (y axis in this case). I would
Dave> like to do something as shown in the third line of
Dave> code:
Dave> . . . graph_axes.set_xlim([0,24])
Dave> graph_axes.set_ylim([0,MaxHourlyDowntime+100])
Dave> graph_axes.set_yticklabels(fontsize=6) . . .
for label in graph_axes.get_yticklabels():
label.set_size(6)
Note you can also change the default label size "system wide" using
the rc param tick.labelsize - http://matplotlib.sf.net/.matplotlibrc
. You can either change it in the rc file itself, or set it for the
application with, for example
from matplotlib import rc
rc('tick', labelsize=6)
This will affect both the x and y tick labels....
Dave> but that won't work, because I'm not supply a list of
Dave> ticklabels. Is there a simple answer to this? (I've
Dave> looked through the mailing lists and the class library
Dave> documentation with no success...
Dave> Also, attached is a screenshot of an statistical
Dave> application that is almost complete... all of the
Dave> graphing and plotting functions are 100% complete and
Dave> work courtesy of matplotlib. (you had helped me with a
Dave> few issues last year and requested a screen shot...)
Cool -- thanks!
JDH
|
|
From: John H. <jdh...@ac...> - 2005-01-19 19:19:14
|
>>>>> "Andrew" == Andrew Becker <be...@da...> writes:
Andrew> Hi - However, if you interact with the window (zoom in)
Andrew> than this information is lost. It would be nice to be
Andrew> able to set a permanant attritute for the axis,
Andrew> yaxis.reversed = True, or some such thing.
I assume you are working with an older version of matplotlib....
Gergory fixed this (I can't remember the version number it was fixed
din ) but it works as of the latest release.
JDH
|
|
From: Andrew B. <be...@da...> - 2005-01-19 19:07:33
|
Hi - However, if you interact with the window (zoom in) than this information is lost. It would be nice to be able to set a permanant attritute for the axis, yaxis.reversed = True, or some such thing. Andy > ylim(ymax, ymin) > OR > xlim(xmax, xmin) > > See, for example, http://matplotlib.sf.net/examples/invert_axes.py |
|
From: John H. <jdh...@ac...> - 2005-01-19 19:06:44
|
>>>>> "Dominique" == Dominique Orban <Dom...@po...> writes:
Dominique> Is there any reason why we can't use the usual TeX
Dominique> symbols for the accents, e.g.: \'{e} for acute accent,
Dominique> \`{e} for grave, \"{a} for umlaut, etc.?
FYI, all of these *are* standard TeX commands. The shortcuts are also
now in matplotlib CVS (I added them after my post yesterday); as in
TeX, the curly's are optional, so you can do \"{o}, \ddot{o}, \"o or
\ddot o.
JDH
|
|
From: Engelsma, D. <D.E...@La...> - 2005-01-19 19:00:06
|
Hi John,
I'm wondering how to set the fontsize of the ticklabels on an axis (y
axis in this case). I would like to do something as shown in the third
line of code:
.
.
.
graph_axes.set_xlim([0,24])
graph_axes.set_ylim([0,MaxHourlyDowntime+100])
graph_axes.set_yticklabels(fontsize=6)
.
.
.
but that won't work, because I'm not supply a list of ticklabels. Is
there a simple answer to this? (I've looked through the mailing lists
and the class library documentation with no success...
Also, attached is a screenshot of an statistical application that is
almost complete... all of the graphing and plotting functions are 100%
complete and work courtesy of matplotlib. (you had helped me with a few
issues last year and requested a screen shot...)
Thanks in advance,
Dave Engelsma
|
|
From: Dominique O. <Dom...@po...> - 2005-01-19 16:38:24
|
> To: Matt Newville <new...@ca...>
> Cc: Mayer Gerhard <ger...@co...>,
> <mat...@li...>
> Subject: Re: AW: [Matplotlib-users] French characters
> From: John Hunter <jdh...@ac...>
> Date: Tue, 18 Jan 2005 15:49:57 -0600
>
>
>>>>>>"Matt" == Matt Newville <new...@ca...> writes:
>
>
> Matt> Sorry for the confusion, that's not what I meant. I think
> Matt> that the acute sign would have to be added to the list of
> Matt> symbols that mathtext can handle. That would probably mean
> Matt> both special code in mathtext.py and an entry in
> Matt> _mathtext_data.py. I'm not sure what the right entry in the
> Matt> font table would be, as I don't understand the entries in
> Matt> the latex_to_bakoma dictionary in _mathtext_data.py at all.
>
> I just added support for accents in general to mathtext. The
> following accents are provided: \hat, \breve, \grave, \bar, \acute,
> \tilde, \vec, \dot, \ddot. All of them have the same syntax, eg to
> make an overbar you do \bar{o} or to make an o umlaut you do \ddot{o}.
Is there any reason why we can't use the usual TeX symbols for the
accents, e.g.: \'{e} for acute accent, \`{e} for grave, \"{a} for
umlaut, etc.?
There has been an attempt to introduce LaTeX commands into Powerpoint at
some point (some package from Stanford I believe, called TeXPoint). It
produces nice equations but very few use it simply because the commands
aren't standard TeX.
Dominique
|
|
From: kristen k. <co...@ya...> - 2005-01-19 08:07:20
|
Hola I have experienced exactly the same problem when using the contour plot with a windows installation. Kristen --- John Hunter <jdh...@ac...> wrote: > >>>>> "Dominique" == Dominique Orban > <Dom...@po...> writes: > > Dominique> If anyone is able to reproduce the > problem, then it > Dominique> might indeed be a problem. If not, > perhaps something is > Dominique> funny with my box. > > A complete script which replicates the problem, w/ > an attached saved > figure which shows it, would help immensely. > > JDH > > > > ------------------------------------------------------- > The SF.Net email is sponsored by: Beat the > post-holiday blues > Get a FREE limited edition SourceForge.net t-shirt > from ThinkGeek. > It's fun and FREE -- well, > almost....http://www.thinkgeek.com/sfshirt > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > __________________________________ Do you Yahoo!? Yahoo! Mail - Easier than ever with enhanced search. Learn more. http://info.mail.yahoo.com/mail_250 |
|
From: Michael S. <mic...@as...> - 2005-01-19 01:24:44
|
Hi!
A few weeks ago I started using Python, Matplotlib, and WxPython for a new
project, and continue to be quite impressed. I now ran into a problem
however, which I cannot solve in a decent way: I am using a slightly more
complicated GUI than the ones in the examples, and positioned a Matplotlib
canvas and the toolbar inside a sizer, which is not the "root"-most sizer
(in the __init__ constructor of my wx.Frame-derived class I call
"self.SetSizer(sizer_A)" while I add the Matplotlib canvas to a different
sizer_B, kind of like "self.sizer_B.Add(self.canvas, 1, wxTOP | wxLEFT |
wxEXPAND)", with sizer_B being added via intermediate objects to sizer_A).
What now happens isn't completely clear to me - but it looks as if the
events aren't handled correctly anymore (nothing at all happens, if I use
the custom sizing given in one of the examples; if I call
self.SetToolBar(self.toolbar) instead, some of the buttons work, I think).
If I position both the canvas and the toolbar in the "root"-most sizer
instead, everything runs fine. Does anyone know a way to solve this?
I am using WxGlade to write some of the GUI code, because it seems to save
some typing work. Below, I added a simple example of the problem I
encounter. I basically combined the "embedding_in_wx4.py" with some
WxGlade-created code (the frame contains a sizer_A with a button and a
sizer_2 which contains the sizer_B that in turn contains the canvas. Of
course, this setup would be possible without this structure, it is just
meant to illustrate...)
Does someone also have some input on WxGlade or other choices that are out
there? What about Boa Constructor? Is that any good? Currently I am using
SPE...
Thanks a lot in advance for your help,
Michael Sielemann
______ example code (not working like this, to illustrate the problem I am
encountering ________________
#!/usr/bin/env python
# -*- coding: ISO-8859-1 -*-
# generated by wxGlade 0.3.5.1 on Tue Jan 18 17:42:12 2005
from matplotlib.numerix import arange, sin, pi
import matplotlib
# uncomment the following to use wx rather than wxagg
#matplotlib.use('WX')
#from matplotlib.backends.backend_wx import FigureCanvasWx as FigureCanvas
# comment out the following to use wx rather than wxagg
matplotlib.use('WXAgg')
from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as
FigureCanvas
from matplotlib.backends.backend_wx import NavigationToolbar2Wx
from matplotlib.backends.backend_wx import _load_bitmap
from matplotlib.figure import Figure
from matplotlib.numerix import rand
import wx
class MyNavigationToolbar(NavigationToolbar2Wx):
"""
Extend the default wx toolbar with your own event handlers
"""
ON_CUSTOM = wx.NewId()
def __init__(self, canvas, cankill):
NavigationToolbar2Wx.__init__(self, canvas)
# for simplicity I'm going to reuse a bitmap from wx, you'll
# probably want to add your own.
self.AddSimpleTool(self.ON_CUSTOM, _load_bitmap('stock_left.xpm'),
'Click me', 'Activate custom contol')
EVT_TOOL(self, self.ON_CUSTOM, self._on_custom)
def _on_custom(self, evt):
# add some text to the axes in a random location in axes (0,1)
# coords) with a random color
# get the axes
ax = self.canvas.figure.axes[0]
# generate a random location can color
x,y = tuple(rand(2))
rgb = tuple(rand(3))
# add the text and draw
ax.text(x, y, 'You clicked me',
transform=ax.transAxes,
color=rgb)
self.canvas.draw()
evt.Skip()
class MyFrame(wx.Frame):
def __init__(self, *args, **kwds):
# begin wxGlade: MyFrame.__init__
kwds["style"] = wx.DEFAULT_FRAME_STYLE
wx.Frame.__init__(self, *args, **kwds)
self.panel_1 = wx.Panel(self, -1)
self.panel_2 = wx.Panel(self.panel_1, -1)
self.button_1 = wx.Button(self.panel_1, -1, "Useless")
# moved downwards
#self.__set_properties()
#self.__do_layout()
# end wxGlade
# "embedding_in_wx4.py" sample code integration
self.SetBackgroundColour(wxNamedColor("WHITE"))
self.figure = Figure(figsize=(5,4), dpi=100)
self.axes = self.figure.add_subplot(111)
self.canvas = FigureCanvas(self, -1, self.figure)
t = arange(0.0,3.0,0.01)
s = sin(2*pi*t)
self.axes.plot(t,s)
self.toolbar = MyNavigationToolbar(self.canvas, True)
self.__set_properties()
self.__do_layout()
# end of "embedding_in_wx4.py" sample code integration
def __set_properties(self):
# begin wxGlade: MyFrame.__set_properties
self.SetTitle("frame_1")
self.SetSize((600, 500))
# end wxGlade
# "embedding_in_wx4.py" sample code integration
self.toolbar.Realize()
# end of "embedding_in_wx4.py" sample code integration
def __do_layout(self):
# begin wxGlade: MyFrame.__do_layout
sizer_A = wx.BoxSizer(wx.VERTICAL)
sizer_2 = wx.BoxSizer(wx.HORIZONTAL)
# next lines were modified by hand
self.sizer_B = wxBoxSizer(wxVERTICAL)
self.sizer_B.Add(self.canvas, 1, wxTOP | wxLEFT | wxEXPAND)
sizer_2.Add(self.sizer_B, 2, wxTOP | wxLEFT | wxEXPAND, 0)
sizer_2.Add(self.button_1, 1, wx.EXPAND|wx.FIXED_MINSIZE, 0)
self.panel_1.SetAutoLayout(True)
self.panel_1.SetSizer(sizer_2)
sizer_2.Fit(self.panel_1)
sizer_2.SetSizeHints(self.panel_1)
sizer_A.Add(self.panel_1, 1, wx.EXPAND, 0)
#self.SetAutoLayout(True)
#self.SetSizer(sizer_A)
#self.Layout()
# end wxGlade
# "embedding_in_wx4.py" sample code integration
if wxPlatform == '__WXMAC__':
# Mac platform (OSX 10.3, MacPython) does not seem to cope with
# having a toolbar in a sizer. This work-around gets the buttons
# back, but at the expense of having the toolbar at the top
self.SetToolBar(self.toolbar)
else:
# On Windows platform, default window size is incorrect, so set
# toolbar width to figure width.
tw, th = self.toolbar.GetSizeTuple()
fw, fh = self.canvas.GetSizeTuple()
# By adding toolbar in sizer, we are able to put it at the
bottom
# of the frame - so appearance is closer to GTK version.
# As noted above, doesn't work for Mac.
self.toolbar.SetSize(wxSize(fw, th))
self.sizer_B.Add(self.toolbar, 0, wxLEFT | wxEXPAND)
# Capture the paint message what was the use of this?
#EVT_PAINT(self, self.OnPaint)
# update the axes menu on the toolbar
self.toolbar.update()
#self.SetSizer(self.sizer)
#self.Fit()
# end of "embedding_in_wx4.py" sample code integration
self.SetAutoLayout(True)
self.SetSizer(sizer_A)
self.Layout()
# end of class MyFrame
class MyAtmosphereApp(wx.App):
def OnInit(self):
wx.InitAllImageHandlers()
frame_1 = MyFrame(None, -1, "")
self.SetTopWindow(frame_1)
frame_1.Show()
return 1
# end of class MyAtmosphereApp
if __name__ == "__main__":
import gettext
gettext.install("AtmosphereApp") # replace with the appropriate catalog
name
# more of my init stuff
AtmosphereApp = MyAtmosphereApp(0)
AtmosphereApp.MainLoop()
|
|
From: Nadia D. <den...@st...> - 2005-01-18 23:13:46
|
I've been able to reproduce the problem on MacOSX (after the correction), although I don't have an answer to what's causing it now. Nadia Dencheva On Jan 18, 2005, at 2:38 PM, Dominique Orban wrote: > (Sorry, sending this again to correct a typo -- i inverted small and > large below) > > I have made several experiments; I have installed the latest matplotlib > (with the 'contour' update) in both Win XP and SuSE Linux Pro 9.1. I > made sure to uninstall everything pertaining to matplotlib before > installing the latest version. In Windows, I use the pre-built > distribution, and in Linux I compile it myself. The situation is this: > > - In Linux, some zigzagging lines appear when there are few points to > interpolate. Eg, if i generate my grid from > x = y = arange( -1, 1, delta ), > zigzags would appear for LARGE values of delta (eg, delta = 0.2; ie > too few values of x and/or y). However, it seems that those zigzags > are a normal consequence of a large value of delta. For SMALLER > deltas, the contours are beautiful. > > - In XP, the same as above happens. But I see additional lines that > don't seem to represent anything meaningful. I made sure I was > performing a clean install. Are there updates to other packages I > should > consider? Pygtk? This happened with both the TkAgg and GTKAgg backends. > Perhaps I should try compiling matplotlib myself? > > If anyone is able to reproduce the problem, then it might indeed be a > problem. If not, perhaps something is funny with my box. > > Thanks, > Dominique > > > > > ------------------------------------------------------- > The SF.Net email is sponsored by: Beat the post-holiday blues > Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. > It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
|
From: John H. <jdh...@ac...> - 2005-01-18 21:55:37
|
>>>>> "Matt" == Matt Newville <new...@ca...> writes:
Matt> Sorry for the confusion, that's not what I meant. I think
Matt> that the acute sign would have to be added to the list of
Matt> symbols that mathtext can handle. That would probably mean
Matt> both special code in mathtext.py and an entry in
Matt> _mathtext_data.py. I'm not sure what the right entry in the
Matt> font table would be, as I don't understand the entries in
Matt> the latex_to_bakoma dictionary in _mathtext_data.py at all.
I just added support for accents in general to mathtext. The
following accents are provided: \hat, \breve, \grave, \bar, \acute,
\tilde, \vec, \dot, \ddot. All of them have the same syntax, eg to
make an overbar you do \bar{o} or to make an o umlaut you do \ddot{o}.
The changes are in CVS - make sure you get mathtext.py revision 1.9 or
later, and _mathtext_data.py revision 1.5 or later.
Here is the test script I used:
from pylab import *
plot(range(10))
title(r'$\ddot{o}\acute{e}\grave{e}\hat{O}\breve{i}\bar{A}\tilde{n}\vec{q}\dot{x}$', fontsize=20)
show()
Hope this helps!
JDH
PS:
Matt, the _mathtext_data dictionary latex_to_bakoma maps the TeX
symbol to a fontfilename, glyph index tuple. To get the character
code in the font file corresponding to the glyph index, you can use
the FT2Font charmap dict
Here's a little demo script which shows you how to use the dict to
load a freetype2 glyph struct for a latex symbol "delta" from the
appropriate cm*.ttf file
import os
from matplotlib import get_data_path
from matplotlib.ft2font import FT2Font
from matplotlib._mathtext_data import latex_to_bakoma
name, glyphind = latex_to_bakoma[r'\delta']
fname = os.path.join(get_data_path(), name + '.ttf')
font = FT2Font(fname)
charmap = font.get_charmap()
ccode = charmap[glyphind]
glyph = font.load_char(ccode)
print glyph.width/64.
|
|
From: John H. <jdh...@ac...> - 2005-01-18 19:40:43
|
>>>>> "Dominique" == Dominique Orban <Dom...@po...> writes:
Dominique> If anyone is able to reproduce the problem, then it
Dominique> might indeed be a problem. If not, perhaps something is
Dominique> funny with my box.
A complete script which replicates the problem, w/ an attached saved
figure which shows it, would help immensely.
JDH
|
|
From: Dominique O. <Dom...@po...> - 2005-01-18 19:38:40
|
(Sorry, sending this again to correct a typo -- i inverted small and large below) I have made several experiments; I have installed the latest matplotlib (with the 'contour' update) in both Win XP and SuSE Linux Pro 9.1. I made sure to uninstall everything pertaining to matplotlib before installing the latest version. In Windows, I use the pre-built distribution, and in Linux I compile it myself. The situation is this: - In Linux, some zigzagging lines appear when there are few points to interpolate. Eg, if i generate my grid from x = y = arange( -1, 1, delta ), zigzags would appear for LARGE values of delta (eg, delta = 0.2; ie too few values of x and/or y). However, it seems that those zigzags are a normal consequence of a large value of delta. For SMALLER deltas, the contours are beautiful. - In XP, the same as above happens. But I see additional lines that don't seem to represent anything meaningful. I made sure I was performing a clean install. Are there updates to other packages I should consider? Pygtk? This happened with both the TkAgg and GTKAgg backends. Perhaps I should try compiling matplotlib myself? If anyone is able to reproduce the problem, then it might indeed be a problem. If not, perhaps something is funny with my box. Thanks, Dominique |
|
From: Dominique O. <Dom...@po...> - 2005-01-18 19:35:36
|
I have made several experiments; I have installed the latest matplotlib (with the 'contour' update) in both Win XP and SuSE Linux Pro 9.1. I made sure to uninstall everything pertaining to matplotlib before installing the latest version. In Windows, I use the pre-built distribution, and in Linux I compile it myself. The situation is this: - In Linux, some zigzagging lines appear when there are few points to interpolate. Eg, if i generate my grid from x = y = arange( -1, 1, delta ), zigzags would appear for small values of delta. However, it seems that those zigzags are a normal consequence of a small value of delta. For larger deltas, the contours are beautiful. - In XP, the same as above happens. But I see additional lines that don't seem to represent anything meaningful. I made sure I was performing a clean install. Are there updates to other packages I should consider? Pygtk? This happened with both the TkAgg and GTKAgg backends. Perhaps I should try compiling matplotlib myself? If anyone is able to reproduce the problem, then it might indeed be a problem. If not, perhaps something is funny with my box. Thanks, Dominique |
|
From: Dominique O. <Dom...@po...> - 2005-01-18 19:17:02
|
Hello,
I am a big consumer of contour plots and it is great that matplotlib now
features them. I didn't find the 'colors' argument to contour()
intuitive to use though, and I wonder whether contour() should accept a
colormap instance, much as imshow, so we can also display a colorbar.
Browsing through colors.py and cm.py it didn't appear clearly to me how
all of that works. There is some info in the mailing list archives but I
still didn't feel comfortable enough with such aspects of matplotlib to
go ahead and modify contour().
Instead I wrote this simple class which returns a range of colors around
the spectrum. There are as many colors as specified, and i use the same
number as the number of levels in my contour plot. Perhaps this could be
the default colors in contour()?
I don't mean to be reinventing the wheel; if there is a simpler way to
do this with colormap instances, i'd love to know how.
===============
class mycolors:
def __init__( self, nlevels ):
jet6 = ( (0,0,1), (0,1,1), (0,1,0), (1,1,0), (1,0,0), (1,0,1) )
self._jet6 = jet6
if nlevels <= 6:
jet = jet6[:nlevels]
else:
spectrum = linspace( 0, nlevels-1, 6 )
for i in range( 6 ):
spectrum[i] = round( spectrum[i] )
# Initialize colors to black
jet = []
for i in range( nlevels ):
jet.append( (0,0,0) )
# Insert basic colors
for i in range( 6 ):
jet[ int( spectrum[i] ) ] = jet6[i]
# Insert spectrum in each bin
for i in range( 5 ):
inthisbin = int( spectrum[i+1] - spectrum[i] - 1 )
eps = 1.0/(inthisbin + 1)
tones = linspace( eps, 1 - eps, inthisbin )
thistone = [ jet6[i+1][0] - jet6[i][0],
jet6[i+1][1] - jet6[i][1],
jet6[i+1][2] - jet6[i][2] ]
for j in range( inthisbin ):
thiscolor = [ jet6[i][0] + thistone[0] * tones[j],
jet6[i][1] + thistone[1] * tones[j],
jet6[i][2] + thistone[2] * tones[j] ]
jet[ int( spectrum[i] ) + j + 1 ] = tuple( thiscolor )
self.jet = jet
self.nlevels = nlevels
def get_colors( self ):
return self.jet
def get_levels( self ):
return self.nlevels
=================
Here is an example script where i use the same number of colors as levels:
from pylab import *
def rosenbrock(x,y): return 10*(y-x**2)**2 + (x-1)**2
x = y = arange( -2, 2, 0.1 )
X, Y = meshgrid( x, y )
Z = rosenbrock( X, Y )
nlevels = 30
cols = mycolors( nlevels )
contour( Z,
x = X,
y = Y,
levels = nlevels,
colors = cols.get_colors(),
origin = 'lower' )
show()
If this is useful to anyone, feel free to use it.
Dominique
|
|
From: Malte M. <Mal...@cs...> - 2005-01-18 04:51:17
|
Hi,
I am trying to use mathtex expression for Molecule descriptions(in the legend)
[in matplotlib-0.70.1 tkagg backend]
The following mathtext expression throws an exception in the parser.
plot(range(10))
title(r'$^{12}\rm{CO}$') # a CO molecule
The following doesn't plot the superscript part of the mathtext in the legend:
r'$\rm{CO}^{2}$
whereas this one does:
r'$CO^{2}$'
Can anyone reproduce this.
PS: Excellent plotting package! No greater pleasure than giving pgplot the
boot and replace it with something "modern".
PPS: I think this ahs come up on the mailing list earlier, but I can't quite
remember. Is it possible to tune "subplot" to do ganged plotting as in the
example script without the overhead?
Cheers,
Malte.
|
|
From: Dominique O. <Dom...@po...> - 2005-01-17 23:28:32
|
John Hunter wrote:
>>>>>>"Dominique" == Dominique Orban <Dom...@po...> writes:
>
>
> Dominique> I notice some spurious zigzagging lines towards the top
> Dominique> of the plot. Any idea where those might be coming from?
>
> I don't get zigzag lines either. Try using replacing
> matplotlib.axes.Axes.contour with the function included below (from
> CVS) and let me know if it works.
>
> Dominique> Also, the figure produced by the above script is
> Dominique> flipped horizontally. The corresponding Matlab script
> Dominique> produces the correct plot.
>
> matplotlib supports two image / contour orientation styles, and this
> is controlled by an rc parameter. Try (note the origin kwarg)
>
> from matplotlib.pylab import *
>
> def rosenbrock(x,y):
> return 10.0 * (y-x**2)**2 + (x-1)**2
>
> x = arange( -1.5, 1.5, 0.01 )
> y = arange( -0.5, 1.5, 0.01 )
> [X,Y] = meshgrid( x, y )
> Z = rosenbrock( X, Y )
> contour( Z, x=X, y=Y, levels = 50, origin='lower' )
> show()
>
>
> Amended contour function
> [snip]
John,
Many thanks for the update. That solves some of the issues. The 'origin'
keyword argument restores the orientation of the plot. To account for
the 'x' and 'y' keyword arguments, I would suggest changing the lines
if x == None and y == None:
y, x = indices((jmax,imax), 'd')
to
if x is None:
x = indices((jmax,imax), 'd')
if y is None:
y = indices((jmax,imax), 'd')
to account for the situation where only one of x or y is specified (I
admit that might be unlikely but hey).
Regarding the zigzags, I notice they appear for relatively small values
of the increment in arange() (the 3rd argument). When I decrease it to,
say, 0.1, zigzags start to appear. For higher values, they don't. It
makes me think they might be part of the line collections. Is anyone
else able to reproduce this behavior?
Thanks much.
Dominique
|
|
From: John H. <jdh...@ac...> - 2005-01-17 21:53:37
|
>>>>> "Dominique" == Dominique Orban <Dom...@po...> writes:
Dominique> I notice some spurious zigzagging lines towards the top
Dominique> of the plot. Any idea where those might be coming from?
I don't get zigzag lines either. Try using replacing
matplotlib.axes.Axes.contour with the function included below (from
CVS) and let me know if it works.
Dominique> Also, the figure produced by the above script is
Dominique> flipped horizontally. The corresponding Matlab script
Dominique> produces the correct plot.
matplotlib supports two image / contour orientation styles, and this
is controlled by an rc parameter. Try (note the origin kwarg)
from matplotlib.pylab import *
def rosenbrock(x,y):
return 10.0 * (y-x**2)**2 + (x-1)**2
x = arange( -1.5, 1.5, 0.01 )
y = arange( -0.5, 1.5, 0.01 )
[X,Y] = meshgrid( x, y )
Z = rosenbrock( X, Y )
contour( Z, x=X, y=Y, levels = 50, origin='lower' )
show()
Amended contour function
def contour(self, z,
x = None,
y = None,
levels = None,
colors = None,
linewidths = None,
alpha = 1.0,
fmt='%1.3f',
origin=None):
"""\
CONTOUR(z, x = None, y = None, levels = None, colors = None)
plots contour lines of an image z
z is a 2D array of image values
x and y are 2D arrays with coordinates of z values in the
two directions. x and y do not need to be evenly spaced but must
be of the same shape as z
levels can be a list of level values or the number of levels to be
plotted. If levels == None, a default number of 7 evenly spaced
levels is plotted.
colors is one of these:
- a tuple of matplotlib color args (string, float, rgb, etc),
different levels will be plotted in different colors in the order
specified
- one string color, e.g. colors = 'r' or colors = 'red', all levels
will be plotted in this color
- if colors == None, the default color for lines.color in
.matplotlibrc is used.
linewidths is one of:
- a number - all levels will be plotted with this linewidth,
e.g. linewidths = 0.6
- a tuple of numbers, e.g. linewidths = (0.4, 0.8, 1.2) different
levels will be plotted with different linewidths in the order
specified
- if linewidths == None, the default width in lines.linewidth in
.matplotlibrc is used
reg is a 2D region number array with the same dimensions as x and
y. The values of reg should be positive region numbers, and zero fro
zones wich do not exist.
triangle - triangulation array - must be the same shape as reg
alpha : the default transparency of contour lines
fmt is a format string for adding a label to each collection.
Currently this is useful for auto-legending and may be useful down
the road for legend labeling
origin = 'upper'|'lower'|None. If None, the rc value for image.origin
will be used
More information on reg and triangle arrays is in _contour.c
Return value is levels, collections where levels is a list of contour
levels used and collections is a list of
matplotlib.collections.LineCollection instances
"""
if origin is None: origin = rcParams['image.origin']
if origin == 'upper':
if x is not None: x = x[::-1]
if y is not None: y = y[::-1]
z = z[::-1]
if not self._hold: self.cla()
if which[0] == "numeric":
z = array(z.tolist(),typecode = z.typecode())
if len(shape(z)) != 2:
raise TypeError("Input must be a 2D array.")
else:
jmax, imax = shape(z)
region = 0
reg = ones((jmax,imax), Int32)
reg[:,0]=0
triangle = zeros((jmax,imax), Int32)
if x == None and y == None:
y, x = indices((jmax,imax), 'd')
rz = ravel(z)
zmax = nxmax(rz)
zmin = nxmin(rz)
def autolev(N):
return mlab.linspace(zmin, zmax, N+2)[1:-1]
if levels is None: lev = autolev(7)
else:
try: Nlev = int(levels)
except TypeError:
lev = list(levels)
else: lev = autolev(Nlev)
Nlev = len(lev)
if colors == None:
colors = rcParams['lines.color']
if is_string_like(colors):
colors = [colors] * Nlev
elif iterable(colors) and len(colors) < Nlev:
colors = list(colors) * Nlev
else:
try: gray = float(colors)
except TypeError: pass
else: colors = [gray] * Nlev
tcolors = []
for c in colors:
tcolors.append((colorConverter.to_rgba(c, alpha),))
if linewidths == None:
tlinewidths = [linewidths] *Nlev
else:
if iterable(linewidths) and len(linewidths) < Nlev:
linewidths = list(linewidths) * int(ceil(Nlev/len(linewidths)))
elif not iterable(linewidths) and type(linewidths) in [int, float]:
linewidths = [linewidths] * Nlev
tlinewidths = [(w,) for w in linewidths]
args = zip(lev, tcolors, tlinewidths)
levels = []
collections = []
for level, color, width in args:
ntotal, nparts = _contour.GcInit1(x, y, reg, triangle, region, z, level)
np = zeros((nparts,), Int32)
xp = zeros((ntotal, ), Float64)
yp = zeros((ntotal,), Float64)
nlist = _contour.GcTrace(np, xp, yp)
col = LineCollection(nlist, colors=color, linewidths = width)
col.set_label(fmt%level)
self.add_collection(col)
levels.append(level)
#col.set_linestyle('dashdot') # dashed|dotted|solid|dashdot
#dashes = 0, (4,2,8,1)
#col.set_linestyle( (dashes,) ) # offset, onoffseq
collections.append(col)
if x is not None:
rx = ravel(x)
self.set_xlim((min(rx), max(rx)))
else:
self.set_xlim([0,imax])
if y is not None:
ry = ravel(y)
self.set_ylim((min(ry), max(ry)))
else:
self.set_ylim([0,jmax])
return levels, collections
|
|
From: Carol L. <car...@sr...> - 2005-01-17 19:05:19
|
The change picked up the top color. However, it looks to me as though the yellowish color is missing from the color bar. I see only 9 colors. The is without tweaking clim. When I do tweak clim to clim(vmin=-.1, vmax = 0.1), I see the yellowish color, but two of the bluer colors seem to be missing. I see only 8 colors in the color bar. > To: Carol Leger <car...@sr...> > Cc: mat...@li... > Subject: Re: [Matplotlib-users] Color bar with discrete colors > From: John Hunter <jdh...@ac...> > Date: Sat, 15 Jan 2005 16:32:48 -0600 > > >>>>>>"Carol" == Carol Leger <car...@sr...> writes: > > > Carol> This is how I modified poormans_contour.py: > > It's a bug; in the matplotlib/pylab.py function "colorbar", replace > the line that reads > > N = 200 > > with > > N = cmap.N > > No need to tweak the clim.... > > Should cure what ails ya, > JDH > -- Ms. Carol A. Leger SRI International Phone: (650) 859-4114 333 Ravenswood Avenue G-273 Menlo Park, CA 94025 e-mail: le...@sr... |
|
From: <fcc...@fi...> - 2005-01-17 12:56:04
|
On Friday 14 January 2005 14:48, Dominique Orban wrote: I don't get any zig-zag lines on my box when I run your code... as for being sideways, I cant tell since I don't have matlab here... I don't have a solution, but it doesn't seem to be a matplotlib problem. I am running, version 0.70.1 good luck, =46l=E1vio > Hi, > > When trying to plot the contours of the famous Rosenbrock function: > > ---------------------------------------- > from matplotlib.pylab import * > > def rosenbrock(x,y): > return 10.0 * (y-x**2)**2 + (x-1)**2 > > x =3D arange( -1.5, 1.5, 0.01 ) > y =3D arange( -0.5, 1.5, 0.01 ) > [X,Y] =3D meshgrid( x, y ) > Z =3D rosenbrock( X, Y ) > contour( Z, x=3DX, y=3DY, levels =3D 50 ) > show() > ---------------------------------------- > > I notice some spurious zigzagging lines towards the top of the plot. Any > idea where those might be coming from? > > Also, the figure produced by the above script is flipped horizontally. > The corresponding Matlab script produces the correct plot. > > Thanks, > Dominique > > > ------------------------------------------------------- > The SF.Net email is sponsored by: Beat the post-holiday blues > Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. > It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
|
From: John H. <jdh...@ac...> - 2005-01-15 22:59:32
|
>>>>> "James" == James Boyle <bo...@ll...> writes:
James> To reply to my own post: On question (1): I modified the
James> call to colorbar in pylab.py to accept a color map and norm
James> keyword arguments. It was this functionality that was
Perhaps it would be cleaner simply to derive a custom class from
ScalarMappable that does your fill calls and stores your cmap and norm
instances; then you would get the observer stuff for free. If you
decide to go this route, perhaps you could submit the example.
James> I would also like to code up a floating color bar. Often I
James> make 4/5 images per page with a common colormap and
James> normalization. It is handy just to plop the reference
James> colorbar in a central location not attached to a particular
James> figure.
I just committed changes to CVS to support this -- you can now place a
colorbar in a custom axes, and I added an orientation kwarg to
support horizontal or vertical colorbar layout. Make sure you get
pylab.py revision 1.21 or later.
Here is an example
from pylab import *
ax = axes([0.1, 0.3, 0.8, 0.6])
im = imshow(rand(12,12), interpolation='nearest')
cax = axes([0.1, 0.1, 0.8, 0.15])
colorbar(cax=cax, orientation='horizontal')
show()
James> On question (2): Alan Isaac pointed out that using the same
James> edgecolor as the fillcolor would make the borders
James> invisible.
Yep.
JDH
|