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
(13) |
2
(11) |
3
|
4
(9) |
|
5
(3) |
6
(17) |
7
(24) |
8
(11) |
9
(26) |
10
(19) |
11
(4) |
|
12
(4) |
13
(14) |
14
(9) |
15
(5) |
16
(18) |
17
(23) |
18
(3) |
|
19
(1) |
20
(7) |
21
(27) |
22
(26) |
23
(6) |
24
(17) |
25
(1) |
|
26
|
27
(7) |
28
(1) |
29
(4) |
30
(5) |
|
|
|
From: Russell E O. <ro...@ce...> - 2006-11-08 23:58:17
|
At 2:38 PM -0800 2006-11-08, Christopher Barker wrote: >Russell E. Owen wrote: >>I reinstalled wxPython 2.7 from the package at pythonmac.org (to be >>paranoid). I'm using the Python 2.5 version. > >check > >>I got wx-config on my path and confirmed it's the right one (see >>below for details). > >check. > >>Now when I try to build matplotlib it fails. Ouch. >> >>It starts out with the same warning as last time: >>setup.py:267: DeprecationWarning: The wxPython compatibility >>package is no longer automatically generated or activly maintained. >>Please switch to the wx package as soon as possible. >> import wxPython > >This one is easy! > >In setup.py, replace: > >import wxPython > >with > >import wx > >A few versions ago, the "import wxPython" form was deprecated -- it >is now gone in 2.7. IN this case, all it's doing it checking if >wxPython is installed, so th import wx should be the only change >needed. Got it. Thanks! Should I submit a patch? Unfortunately "python setup.py build" still fails when compiling _wxagg (in the same way as last time). I've appended the log so the whole list can enjoy it. I should probably be using wxPython 2.6.x. I originally thought wxPython 2.7 was the current release but as you pointed out, that was a misconception. Unfortunately, it's the only binary package available for Python 2.5 at pythonmac.org. -- Russell $ python setup.py build GTK requires pygtk GTKAgg requires pygtk running build running build_py running build_ext building 'matplotlib.backends._wxagg' extension C compiler: gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -fno-common -dynamic -DNDEBUG -g -O3 creating build/temp.macosx-10.3-fat-2.5 creating build/temp.macosx-10.3-fat-2.5/src creating build/temp.macosx-10.3-fat-2.5/CXX compile options: '-D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXDEBUG__ -D__WXMAC__ -I/usr/local/include -I/usr/include -I. -Isrc -Iswig -Iagg23/include -I. -I/usr/local/include -I/usr/include -I. -I/usr/local/include/freetype2 -I/usr/include/freetype2 -I./freetype2 -Isrc/freetype2 -Iswig/freetype2 -Iagg23/include/freetype2 -I./freetype2 -I/usr/local/include/freetype2 -I/usr/include/freetype2 -I./freetype2 -I/usr/local/include -I/usr/include -I. -I/usr/local/lib/wxPython-unicode-2.7.1.3/lib/wx/include/mac-unicode-debug-2.7 -I/usr/local/lib/wxPython-unicode-2.7.1.3/include/wx-2.7 -I/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 -c' gcc: CXX/cxxextensions.c gcc: CXX/cxx_extensions.cxx gcc: CXX/IndirectPythonInterface.cxx gcc: src/_wxagg.cpp src/_wxagg.cpp: In function 'wxBitmap* convert_agg2bitmap(RendererAgg*, Bbox*)': src/_wxagg.cpp:238: error: conversion from 'wxImage*' to 'const wxString' is ambiguous /usr/local/lib/wxPython-unicode-2.7.1.3/include/wx-2.7/wx/string.h:686: note: candidates are: wxString::wxString(wxChar, size_t) <near match> /usr/local/lib/wxPython-unicode-2.7.1.3/include/wx-2.7/wx/string.h:676: note: wxString::wxString(int) <near match> src/_wxagg.cpp: In function 'wxBitmap* convert_agg2bitmap(RendererAgg*, Bbox*)': src/_wxagg.cpp:238: error: conversion from 'wxImage*' to 'const wxString' is ambiguous /usr/local/lib/wxPython-unicode-2.7.1.3/include/wx-2.7/wx/string.h:686: note: candidates are: wxString::wxString(wxChar, size_t) <near match> /usr/local/lib/wxPython-unicode-2.7.1.3/include/wx-2.7/wx/string.h:676: note: wxString::wxString(int) <near match> lipo: can't figure out the architecture type of: /var/tmp//cc135E90.out src/_wxagg.cpp: In function 'wxBitmap* convert_agg2bitmap(RendererAgg*, Bbox*)': src/_wxagg.cpp:238: error: conversion from 'wxImage*' to 'const wxString' is ambiguous /usr/local/lib/wxPython-unicode-2.7.1.3/include/wx-2.7/wx/string.h:686: note: candidates are: wxString::wxString(wxChar, size_t) <near match> /usr/local/lib/wxPython-unicode-2.7.1.3/include/wx-2.7/wx/string.h:676: note: wxString::wxString(int) <near match> src/_wxagg.cpp: In function 'wxBitmap* convert_agg2bitmap(RendererAgg*, Bbox*)': src/_wxagg.cpp:238: error: conversion from 'wxImage*' to 'const wxString' is ambiguous /usr/local/lib/wxPython-unicode-2.7.1.3/include/wx-2.7/wx/string.h:686: note: candidates are: wxString::wxString(wxChar, size_t) <near match> /usr/local/lib/wxPython-unicode-2.7.1.3/include/wx-2.7/wx/string.h:676: note: wxString::wxString(int) <near match> lipo: can't figure out the architecture type of: /var/tmp//cc135E90.out error: Command "gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -fno-common -dynamic -DNDEBUG -g -O3 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXDEBUG__ -D__WXMAC__ -I/usr/local/include -I/usr/include -I. -Isrc -Iswig -Iagg23/include -I. -I/usr/local/include -I/usr/include -I. -I/usr/local/include/freetype2 -I/usr/include/freetype2 -I./freetype2 -Isrc/freetype2 -Iswig/freetype2 -Iagg23/include/freetype2 -I./freetype2 -I/usr/local/include/freetype2 -I/usr/include/freetype2 -I./freetype2 -I/usr/local/include -I/usr/include -I. -I/usr/local/lib/wxPython-unicode-2.7.1.3/lib/wx/include/mac-unicode-debug-2.7 -I/usr/local/lib/wxPython-unicode-2.7.1.3/include/wx-2.7 -I/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 -c src/_wxagg.cpp -o build/temp.macosx-10.3-fat-2.5/src/_wxagg.o" failed with exit status 1 |
|
From: Andrea G. <and...@gm...> - 2006-11-08 23:40:47
|
Hi NG,
I posted this question few months ago and I didn't receive any
answer, so I'll try to rephrase my problem.
I have a GUI written in wxPython, the main portion of it is a
matplotlib canvas. There is a tree control on the left with
checkboxes: if the user checks a checkbox, I add a line on the plot.
So far so good. The problem comes when the user *un-checks* the
checkbox. I would like to remove the line from the plot, but the only
way I found to do it is to do:
line.set_linestyle("None")
Which is not very nice (and not very correct), as it seems to me that
the line is still there (invisible, but still there). Am I right or
have I completely misunderstood the set_linestyle behavior? If this
method is not correct, is there any alternative that I could try to
erase completely the line from the plot (and from the legend,
obviously)?
The alternative of replotting everything just because a line should be
erased came into my mind but I discarded it because it is
fantastically time consuming with my graphs.
Thank you for every hint.
Andrea.
"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.virgilio.it/infinity77/
|
|
From: Glen W. M. <Gle...@sw...> - 2006-11-08 22:52:42
|
Hello!
I'm dynamically dishing out plots via matplotlib through a web server,
so I really want to savefig to some type of memory object.
Using both os.pipe and cStringIO objects, I get this type of error:
In [9]:%history
1 : import matplotlib
2 : matplotlib.use('Agg')
3 : import pylab
4 : ax = pylab.gca()
5 : ax.specgram( range(100) )
6 : import cStringIO
7 : sbuf = cStringIO.StringIO()
8 : pylab.savefig( sbuf, format='png' )
In [8]:pylab.savefig( sbuf, format='png' )
---------------------------------------------------------------------------
exceptions.TypeError Traceback (most
recent call last)
/home/gmabey/src/R9619_zippy/Projects/R9619_NChannelDetection/AcqLibWeb/<ipython console>
/usr/local/stow/matplotlib-0.87.7/lib/python2.4/site-packages/matplotlib/pylab.py
in savefig(*args, **kwargs)
811 def savefig(*args, **kwargs):
812 fig = gcf()
--> 813 return fig.savefig(*args, **kwargs)
814 if Figure.savefig.__doc__ is not None:
815 savefig.__doc__ = _shift_string(Figure.savefig.__doc__)
/usr/local/stow/matplotlib-0.87.7/lib/python2.4/site-packages/matplotlib/figure.py
in savefig(self, *args, **kwargs)
680 kwargs[key] = rcParams['savefig.%s'%key]
681
--> 682 self.canvas.print_figure(*args, **kwargs)
683
684 def colorbar(self, mappable, cax=None, **kw):
/usr/local/stow/matplotlib-0.87.7/lib/python2.4/site-packages/matplotlib/backends/backend_agg.py
in print_figure(self, filename, dpi, facecolor, edgecolor, orientation,
**kwargs)
458 if not is_string_like(filename):
459 # assume png and write to fileobject
--> 460 self.renderer._renderer.write_png(filename)
461 #pass
462 else:
TypeError: Could not convert object to file pointer
> /usr/local/stow/matplotlib-0.87.7/lib/python2.4/site-packages/matplotlib/backends/backend_agg.py(460)print_figure()
459 # assume png and write to fileobject
--> 460 self.renderer._renderer.write_png(filename)
461 #pass
I'm a bit confused as to where the exception is actually getting raised.
I suppose the renderer's write_png method must be in C?
I implemented a tempfile solution, but I'm surprised that the cStringIO
doesn't already work.
<fellowsophical_question>
Should it?
</fellowsophical_question>
Thanks,
Glen
|
|
From: John H. <jdh...@ac...> - 2006-11-08 17:28:36
|
>>>>> "Yannick" == Yannick Copin <y....@ip...> writes:
Yannick> Hi, I'd like to use axhspan, but specifying both y *and*
Yannick> x extents in *data* units (by default, y is specified in
Yannick> data units, and x in axes -- relative 0-1 -- units). How
Yannick> should I proceed?
Yannick> I naively tried to play with gca().transAxes and so on,
Yannick> but I must admit I was utterly confused...
Yannick> Or should I directly draw a rectangle? (but how to?)
Yes, you should draw a rectangle. Eg,
from matplotlib.patches import Rectangle
r = Rectangle((left, bottom), width, height, facecolor='red')
ax.add_patch(r)
One thing to be aware of is that the axes datalimits are not updated
on a call to add_patch, so autoscaling may be off. You can update the
datalim yourself by doing
ax.update_datalim([(left, bottom), (right, top)])
and then
ax.autoscale_view()
It might be worth adding some convenience functions to draw basic
primitives like this, ie one would rather do
ax.rectangle((left, bottom), width, height, facecolor='red')
or
ax.circle((x,y), radius=5, edgecolor='green')
and not have to worry about the rest
JDH
|
|
From: Olivier R. <oli...@no...> - 2006-11-08 15:57:28
|
I am on windows with mpl 0.87.2. Seweryn Kokot wrote: > I can report the same problem with polish characters. Using WX and GTK it > works but when using WXAgg or GTKAgg it doesn't. > I wrote about this problem some time ago on this group but no > response. > So we are two. > I can add that the problem ocurrs in mpl 0.87.5 (debian sid) and not > in mpl 0.87.2 (debian sarge). > > regards, > SK > > > ------------------------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > |
|
From: Seweryn K. <sk...@po...> - 2006-11-08 15:46:45
|
I can report the same problem with polish characters. Using WX and GTK it works but when using WXAgg or GTKAgg it doesn't. I wrote about this problem some time ago on this group but no response. So we are two. I can add that the problem ocurrs in mpl 0.87.5 (debian sid) and not in mpl 0.87.2 (debian sarge). regards, SK |
|
From: Olivier R. <oli...@no...> - 2006-11-08 11:07:53
|
Hi everybody,
I try to make a plot using chineese strings (unicode).
The folowing code works :
# -*- coding: utf-8 -*-
import matplotlib
matplotlib.use('WX')
import pylab as p
p.plot((1,2,3))
p.xlabel( '=E6=98=AF=E6=9C=80=E5=A5=BD=E7=9A=84=E7=B7=A8=E7=A8=8B=E8=AA=9E=
=E8=A8=80')
p.text(0.5,1.5,u'=C3=A9=C3=A7=C3=A8')
p.show()
But the same code using WxAgg or TkAgg does not works (strings are not
displayed correctly). Is someone have an idea about this problem ?
Thanks.
Olivier
|
|
From: yardbird <yar...@ne...> - 2006-11-08 09:36:43
|
Hello, I have a very weird problem with matplotlib and reals. Before starting to explain please let me apologize, I'm a newbie in Python and I suspect I'm doing something horribly wrong. I have exposed in Python a C++ class with Boost::Python (in the form of a shared object). This class (among other things) reads from a file a list of real numbers, and stores them internally as doubles. What happens is that when using matplotlib my exposed class internally begins to treat reals like they were integers. In other words, when reading reals from a file they are stored as integers, as can be seen by printing the contents of the class to screen: all decimal parts are truncated (i.e., 3.85000E5 instead of 3.8500052719E5). This is _not_ some kind of visualization bug, since my class discards reals whose absolute value is (almost) zero and indeed when using matplotlib the class loads fewer "reals" from the very same file (in other words, values whose abs is < 1 are seen as zeroes and as such they get discarded: all reals whose abs is < 1 are missing when using matplotlib). This is extremely strange to me, since I really don't get how matplotlib can influence the internal behaviour of my class. Is there somewhere some directive in python that can setup the floating point unit? The "bug" happens exactly after loading matplotlib, without it everything is alright. The C++ code from which the class derives has been tested quite thoroughly, so I don't think the problem stems from there. Any pointer would be greatly appreciated :) Thanks very much, Francesco (please CC as I'm not subscribed) |
|
From: Charlie M. <cw...@gm...> - 2006-11-08 02:44:22
|
> There are currently no Mac binaries for > that version on SourceForge or pythonmac. They're up now. |
|
From: Chris B. <Chr...@no...> - 2006-11-08 01:18:26
|
Russell E Owen wrote: >> Russell E. Owen wrote: >>> On Feb 25 Samuel Smith reported that WXAgg crashed on MacOS X using >>> matplotlib 0.87. I just built matplotlib 0.87.7 on Python 2.5 and am >>> still having the problem. >>> - matplotlib 0.87.7 (from source) >> >> That may be the issue -- are you sure you compiled against the right >> wx? Apple delivered a version with OS-X 10.4, and it tends to get >> found when you compile. Search the archives here for how to get it to >> find the right one. > I used the wxPython binary installer from pythonmac.org. I assumed it > included a statically linked wx library but perhaps it does not. yes, it does (well, not exactly, but it does include it's own copies of the wx libs) > If not, > then I have no idea what wx it's using; I don't remember installing one > but I suppose I might have long ago. However, the issue is not which wx wxPython is using, but which wx matplotlib was built against. > I'm not sure this is relevant, but while building matplotlib I got > warnings about using the deprecated wxPython package instead of wx. yup, that's it all right. when mpl is building , it looks for a utility called wx-config, that tells it where to find the headers and libs it needs. The default wx-config on OS-X will point to the wrong wx, so you need to set a n environment variable or something pointing to the correct wx-config. Sorry I don't have the specific details right now, but it should be in the archives, or poke through setup.py and associated files for more info. I think I put a helpful warning in there at some point. good luck, -Chris I > had assumed the matplotlib folks were just a bit behind on their use of > wx, but maybe it is a clue as to what's wrong. > > -- Russell -- Christopher Barker, Ph.D. Oceanographer NOAA/OR&R/HAZMAT (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chr...@no... |
|
From: Russell E. O. <ro...@ce...> - 2006-11-07 23:44:13
|
On Feb 25 Samuel Smith reported that WXAgg crashed on MacOS X using matplotlib 0.87. I just built matplotlib 0.87.7 on Python 2.5 and am still having the problem. Christopher Barker suggested disabling acceleration: import matplotlib.backends.backend_wxagg matplotlib.backends.backend_wxagg._use_accelerator(False) and that does work, but I was wondering if a fix was known? Google only turned up the problem, not a solution. Regards, -- Russell P.S. here are the gory details: Configuration: - PowerBook G4 - MacOS X 10.4.7 - Python 2.5 (from the python main site) - wxPython 2.7.1.3 (from <http://pythonmac.org/packages/py25-fat/index.html>) - numpy 1.0, numarray 1.5.1 and Numeric 24.2 (all from source) - matplotlib 0.87.7 (from source) TkAgg works fine, but WXAgg fails (using numarray or numeric as numerix) when I try to plot as follows: >>> from pylab import * >>> show() Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-pac kages/matplotlib/backends/backend_wx.py", line 1048, in _onPaint self.draw(repaint=False) File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-pac kages/matplotlib/backends/backend_wxagg.py", line 63, in draw self.bitmap = _convert_agg_to_wx_bitmap(self.get_renderer(), None) MemoryError: _wxagg.convert_agg_to_wx_bitmap(): could not create the wx.Bitmap Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-pac kages/matplotlib/backends/backend_wx.py", line 1193, in show figwin.canvas.draw() File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-pac kages/matplotlib/backends/backend_wxagg.py", line 63, in draw self.bitmap = _convert_agg_to_wx_bitmap(self.get_renderer(), None) MemoryError: _wxagg.convert_agg_to_wx_bitmap(): could not create the wx.Bitmap |
|
From: John H. <jdh...@ac...> - 2006-11-07 16:28:55
|
>>>>> "Jose" == Jose Gomez-Dans <jgo...@gm...> writes:
Jose> Hi! We are tryint to access time data stored in an SQL The
Jose> query returns a date object of type DbiDate. When printed,
Jose> we get a nicely formatted text date. If cast into a float or
Jose> int, you get the number of seconds elapsed since
Jose> 1/1/1970. The way we are dealing with the conversion from
Jose> this format into MPL format is:through time.strptime (using
Jose> a format string), then converting that into a datetime
Jose> object, and finally invoking MPL's date2num.
Jose> Is there a better, quicker more obvious way to accomplish
Jose> this?
Seconds since 1/1/1970 is often called "seconds since the epoch" and
mpl provides a conversion routine for dates in this form
from matplotlib.dates import epoch2num
e = int(mydate) # convert your date to seconds since epoch
d = epoch2num(e) # a mpl datenum
epoch2num also works over arrays or sequences of epochs.
JDH
|
|
From: Jose Gomez-D. <jgo...@gm...> - 2006-11-07 16:25:55
|
Hi! We are tryint to access time data stored in an SQL The query returns a date object of type DbiDate. When printed, we get a nicely formatted text date. If cast into a float or int, you get the number of seconds elapsed since 1/1/1970. The way we are dealing with the conversion from this format into MPL format is:through time.strptime (using a format string), then converting that into a datetime object, and finally invoking MPL's date2num. Is there a better, quicker more obvious way to accomplish this? Thanks! Jose |
|
From: John H. <jdh...@ac...> - 2006-11-07 16:19:58
|
>>>>> "Ryan" == Ryan Krauss <rya...@gm...> writes:
Ryan> You have two options. savefig does have a dpi option that
Ryan> will essentially set the figure size for the saved file:
Ryan> savefig('myfile.png',dpi=300)
Ryan> play with dpi until you get a figure size you like.
Ryan> The other way to set the figure size is to specify it when
Ryan> you create the figure: figure(1,(10,8)) would create a
Ryan> fairly large figure. The figure (1 in this case) must not
Ryan> already exist or at least it can't be shown on your screen
Ryan> already. By that I mean if you have already called
Ryan> figure(1) previously in your code, you must close it before
Ryan> you try to call figure(1,(10,8)) or the figure size won't be
Ryan> affected.
Just to elaborate a bit. The figure size in pixels is the figure size
in inches * the dpi. you can set the figure size in inches when you
create it
fig = figure(figsize=(6,8)) # 6x8 inches
and when you save it set the dpi
fig.savefig('somefile.png', dpi=200)
and you will have a 1200x1600 pixel PNG file.
JDH
|
|
From: John H. <jdh...@ac...> - 2006-11-07 16:17:30
|
>>>>> "Etrade" == Etrade Griffiths <etr...@ds...> writes:
Etrade> Sorry, another really basic matplotlib question ... how do
Etrade> I set the font family of the axis tick labels? I am using
Etrade> wxPython/wxMpl and not the pylab interface so am trying to
Etrade> avoid getp/setp. I could do this using matplotlib.rc but
Etrade> want to do it programatically
Etrade> I tried
Etrade> fig=self.get_figure() ax1=fig.gca() ax1.plot(x,y)
Etrade> xt=ax1.get_xticklabels() d = { 'family' : 'sans-serif' }
Etrade> ax1.set_xticklabels(xt, d)
Etrade> But Python goes haywire ... There has to be a simpler way
Etrade> but not found it yet.
I'd like to deprecate font dictionaries in the sense you are using
them here. I implemented them before I fully understood python kwarg
processing. You can do everything with kwargs that you can do with
dictionaries (since kwargs are dictionaries) so it is redundant and
less pythonic. Since you are using the API, I suggest something like
for tick in ax1.xaxis.get_major_ticks():
tick.label1.set_family('sans-serif')
and ditto for the minor ticks if you need them. Also, since mpl
supports left/right or top/bottom ticking, if you are using these you
will also want to set the properties of tick.label2.
Etrade> I am trying to do the same for the legend properties. So
Etrade> far we have
Etrade> p=matplotlib.font_manager.FontProperties()
Etrade> p.set_family('sans-serif') p.set_size('small')
Etrade> fig.legend(lines, titles, 'upper right', prop=p)
Etrade> but this looks fairly cludgy - is there a more elegant way
Etrade> of doing the same thing?
I think this is elegant and not cludgy, so maybe I'm not the best one
to answer this.
JDH
|
|
From: Etrade G. <etr...@ds...> - 2006-11-07 16:04:30
|
Derek, I stand corrected - the phrase should be "fairly kludgy" though "cludgy" might not be that far off when describing my code! Alun At 15:03 07/11/2006, you wrote: > From ><http://www.bbc.co.uk/manchester/have_your_say/2002/11/06/manc_words_3.shtml>http://www.bbc.co.uk/manchester/have_your_say/2002/11/06/manc_words_3.shtml >A cludgy is an outside loo ??? > > >>> Etrade Griffiths <etr...@ds...> 2006/11/07 04:54 PM >>> >Sorry, another really basic matplotlib question ... how do I set the font >family of the axis tick labels? I am using wxPython/wxMpl and not the >pylab interface so am trying to avoid getp/setp. I could do this using >matplotlib.rc but want to do it programatically > >I tried > >fig=self.get_figure() >ax1=fig.gca() >ax1.plot(x,y) >xt=ax1.get_xticklabels() >d = { 'family' : 'sans-serif' } >ax1.set_xticklabels(xt, d) > >But Python goes haywire ... There has to be a simpler way but not found it >yet. > >I am trying to do the same for the legend properties. So far we have > >p=matplotlib.font_manager.FontProperties() >p.set_family('sans-serif') >p.set_size('small') >fig.legend(lines, titles, 'upper right', prop=p) > >but this looks fairly cludgy - is there a more elegant way of doing the >same thing? > >Thanks in advance > >Alun Griffiths > > > >----------------! --------------------------------------------------------- >Using Tomcat but need to do more? Need to support web services, security? >Get stuff done quickly with pre-integrated technology to make your job easier >Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo ><http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642>http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 >_______________________________________________ >Matplotlib-users mailing list >Mat...@li... ><https://lists.sourceforge.net/lists/listinfo/matplotlib-users>https://lists.sourceforge.net/lists/listinfo/matplotlib-users > >-- >This message is subject to the CSIR's copyright, terms and conditions and >e-mail legal notice. >Views expressed herein do not necessarily represent the views of the CSIR. > ><http://mail.csir.co.za/CSIR_eMail_Legal_Notice.html>CSIR E-mail Legal Notice > ><http://mail.csir.co.za/CSIR_Copyright.html>CSIR Copyright, Terms and >Conditions > >For electronic copies of the CSIR Copyright, Terms and Conditions and the >CSIR Legal Notice >send a blank message with "REQUEST LEGAL" in the subject line to ><mailto:Cal...@cs...>CSIR CallCentre > > >This message has been scanned for viruses and dangerous content by ><http://www.mailscanner.info/>MailScanner, >and is believed to be clean. |
|
From: Etrade G. <etr...@ds...> - 2006-11-07 16:01:27
|
John thanks - twinx was indeed where I "borrowed" some of the lines from. They're in the code explicitly 'cos it's a lot clearer to me than using twinx which is buried somewhere in the pylab interface Alun Griffiths At 15:32 07/11/2006, you wrote: > >>>>> "Etrade" == Etrade Griffiths <etr...@ds...> writes: > > Etrade> After poking around in the Pylab source, managed to sort > Etrade> the multiple line plotting using > > Etrade> fig = self.get_figure() ax1 = fig.gca() ax2 = > Etrade> fig.add_axes(ax1.get_position(), sharex=ax1, > Etrade> frameon=False) > >Isn't this what the twinx function does - heave you seen >http://matplotlib.sourceforge.net/examples/shared_axis_demo.py ? |
|
From: John H. <jdh...@ac...> - 2006-11-07 15:34:27
|
>>>>> "Etrade" == Etrade Griffiths <etr...@ds...> writes:
Etrade> After poking around in the Pylab source, managed to sort
Etrade> the multiple line plotting using
Etrade> fig = self.get_figure() ax1 = fig.gca() ax2 =
Etrade> fig.add_axes(ax1.get_position(), sharex=ax1,
Etrade> frameon=False)
Isn't this what the twinx function does - heave you seen
http://matplotlib.sourceforge.net/examples/shared_axis_demo.py ?
|
|
From: John H. <jdh...@ac...> - 2006-11-07 15:31:45
|
>>>>> "izak" == izak marais <iza...@ya...> writes:
izak> I want to plot the probability density function, but
izak> hist(...,normed=1,...) does not work as expected. Here is
izak> the code (with ipython line prompts):
izak> In [69]: n, bins, patches = hist(data, bins = 100, normed =
izak> 1) [ 0.12485649, 0.03013777, 0.03874856, 0. , 0.00861079,
izak> 0. , 0. , 0. , 0. , 0. , 0.0043054 , 0.0043054 , 0. ,
izak> 0. , 0.0043054 , 0. , 0. , 0. , 0. , 0. , 0. ,
izak> 0.0043054 , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. ,
izak> 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. ,
izak> 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. ,
izak> 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. ,
izak> 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. ,
izak> 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. ,
izak> 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. ,
izak> 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. ,
izak> 0.0043054 ,] In [72]: sum(n) Out[72]: 0.22388059701492535
izak> Should this not sum to 1.0 for it to be a PDF? Thanks
It should integrate to one
import matplotlib.mlab
matplotlib.mlab.trapz(bins, n)
JDH
|
|
From: John H. <jdh...@ac...> - 2006-11-07 15:30:39
|
>>>>> "Bart" == Bart van Kuik <B.v...@sr...> writes:
Bart> Hi list, I have created plots, but I find the line style is
Bart> a bit "vague". The line isn't one sharp, contrasting color,
Bart> but smoothly blended to the background. Is the correct term
Bart> anti aliasing?
Yes.
Bart> When setting the linestyle to 'dotted', the plot is not very
Bart> clear, see the following result:
Bart> http://vankuik.nl/cgi/wiki.cgi/download/vague_dotted_plot.png
Try turning antialiasing off for certain lines with
ax.plot(x,y,antialiased=False)
or globally with the lines.antialiased rc parameter; see
http://matplotlib.sf.net/matplotlibrc
JDH
|
|
From: Pierre GM <pgm...@gm...> - 2006-11-07 15:15:59
|
>>> hist?
...
Docstring:
HIST(x, bins=10, normed=0, bottom=0,
align='edge', orientation='vertical', width=None, **kwargs)
Compute the histogram of x. bins is either an integer number of
bins or a sequence giving the bins. x are the data to be binned.
The return values is (n, bins, patches)
If normed is true, the first element of the return tuple will
be the counts normalized to form a probability density, ie,
n/(len(x)*dbin)
align = 'edge' | 'center'. Interprets bins either as edge
or center values
orientation = 'horizontal' | 'vertical'. If horizontal, barh
will be used and the "bottom" kwarg will be the left edges.
width: the width of the bars. If None, automatically compute
the width.
kwargs are used to update the properties of the
hist bars
In your example, len(x)=52, and dbins=bin[1]-bin[0]=4.4666666666667, which
gives:
n.sum() * dbins = 1
|
|
From: Alan I. <ai...@am...> - 2006-11-07 15:12:16
|
On Tue, 7 Nov 2006, Charlie Moad wrote: > You'll need 0.87.7. I will try to build/post these > tonight. Thanks!!!!!!! > It's not terrible to get it compiled on OSX, but it's not > trivial at the same time. That is what I feared. Thanks again! Alan Isaac |
|
From: Ryan K. <rya...@gm...> - 2006-11-07 15:02:18
|
You have two options. savefig does have a dpi option that will
essentially set the figure size for the saved file:
savefig('myfile.png',dpi=300)
play with dpi until you get a figure size you like.
The other way to set the figure size is to specify it when you create
the figure:
figure(1,(10,8))
would create a fairly large figure. The figure (1 in this case) must
not already exist or at least it can't be shown on your screen
already. By that I mean if you have already called figure(1)
previously in your code, you must close it before you try to call
figure(1,(10,8)) or the figure size won't be affected.
Ryan
On 11/6/06, Chuang <chu...@gm...> wrote:
> Hi there,
>
> I want to automatically generated hundreds of figures with matplotlib.
> For each figure, I could use 'plot(Xi)' and 'show()' to draw the figure,
> and press the 'save' button in the figure panel, but this is not too
> automatically. Although I could use 'savefig()' to save the figures
> rather than using 'show()' to show it, and this makes whole program
> fully automatically, I don't know howto set the figure size before
> 'save' it (e.g. set size to 3000x1000pixel). The function 'savefig()'
> doesn't have any option to set figure size. So which function should I
> go to? or what should I do before using 'savefig()'?
>
> Thanks a lot,
> CC
>
>
> -------------------------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
|
|
From: Pierre GM <pgm...@gm...> - 2006-11-07 14:55:19
|
On Tuesday 07 November 2006 04:49, Bart van Kuik wrote:
> I have created plots, but I find the line style is a bit "vague". The
> line isn't one sharp, contrasting color, but smoothly blended to the
> background. Is the correct term anti aliasing?
Seems like it. Make sure the 'antialiased' property of your lines/dots is set
to False by modifying your matplotlibrc default file (if you want this
behaviour to become the default), or by using
rcParams['lines.antialiased']=False, or rc('lines.antialiased',False)...
|
|
From: Etrade G. <etr...@ds...> - 2006-11-07 14:54:18
|
Sorry, another really basic matplotlib question ... how do I set the font
family of the axis tick labels? I am using wxPython/wxMpl and not the
pylab interface so am trying to avoid getp/setp. I could do this using
matplotlib.rc but want to do it programatically
I tried
fig=self.get_figure()
ax1=fig.gca()
ax1.plot(x,y)
xt=ax1.get_xticklabels()
d = { 'family' : 'sans-serif' }
ax1.set_xticklabels(xt, d)
But Python goes haywire ... There has to be a simpler way but not found it yet.
I am trying to do the same for the legend properties. So far we have
p=matplotlib.font_manager.FontProperties()
p.set_family('sans-serif')
p.set_size('small')
fig.legend(lines, titles, 'upper right', prop=p)
but this looks fairly cludgy - is there a more elegant way of doing the
same thing?
Thanks in advance
Alun Griffiths
|