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
(1) |
2
(12) |
3
(12) |
4
(19) |
5
(7) |
6
(6) |
7
(2) |
|
8
(2) |
9
(11) |
10
(15) |
11
(27) |
12
(27) |
13
(18) |
14
(3) |
|
15
(3) |
16
(25) |
17
(9) |
18
(3) |
19
(4) |
20
(2) |
21
(4) |
|
22
(9) |
23
(28) |
24
(18) |
25
(16) |
26
(9) |
27
(4) |
28
(13) |
|
29
(15) |
30
(33) |
|
|
|
|
|
|
From: Jouni K. S. <jk...@ik...> - 2009-11-12 17:33:47
|
Celil Rufat <cel...@gm...> writes:
> However, when I try one of the Qt4 examles:
[...]
> File
> "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/font_manager.py",
> line 303, in get_fontconfig_fonts
> status, output = commands.getstatusoutput("fc-list file")
> File
> "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/commands.py",
> line 56, in getstatusoutput
> text = pipe.read()
> IOError: [Errno 4] Interrupted system call
I believe the attached patch (already committed to the trunk) should fix
this on Python 2.6, but I don't have a Qt installation to try it out
with. Can you try this on your system?
--
Jouni K. Seppänen
http://www.iki.fi/jks
|
|
From: Taro S. <ub...@gm...> - 2009-11-12 17:13:21
|
TheLonelyStar wrote: > > > /net/gorgonzola/storage/nhuesken/svn/ActiveLearning/SVM/ModelSelection/Ergebnisse/plot.pyc > in plot(filename, line_list, name_list, reference) > 6 for i in xrange(len(line_list)): > 7 > plt.plot(m[:,reference],m[:,line_list[i]],label=name_list[i]) > 8 plt.legend(loc='best') > ----> 9 plt.show() > 10 > > Are you calling plt.show() more than once within a script? If so, I was having a similar issue, but after reading this FAQ entry: http://matplotlib.sourceforge.net/faq/howto_faq.html#use-show I realized that the specific usage of show() is not supported (yet); plt.show() can only be used once within a script. Out of luck! I hope there is a resolution one way or the other, since it will make matplotlib so much more useful than it already is. Cheers, Taro -- View this message in context: http://old.nabble.com/matplotlib-WX-and-Qt4Agg-backends-tp26315069p26322550.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
|
From: per f. <per...@gm...> - 2009-11-12 17:07:59
|
thanks to all for the replies. i am still having an issue with the log
scale of these plots. i am trying to hide the top and right axes of
the plot, since these should not be there when plotting a histogram or
a line plot. i use the following code:
import matplotlib
matplotlib.use('PDF')
import matplotlib.pyplot as plt
from matplotlib import rc
rc('font',**{'family':'sans-serif','sans-serif':['Helvetica']})
plt.rcParams['ps.useafm'] = True
rc('font',**{'family':'sans-serif','sans-serif':['Helvetica']})
plt.rcParams['pdf.fonttype'] = 42
plt.rcParams['font.size'] = 10
from mpl_toolkits.axes_grid.axislines import SubplotZero
fig = plt.figure(figsize=(5, 5), dpi=300)
ax = SubplotZero(fig, 1, 1, 1)
ax = fig.add_subplot(ax)
x = range(1, 11)
y = [5000, 900, 600, 500, 200, 110, 50, 20, 10, 5]
plt.plot(x, y, linewidth=1.5, c='k')
ax = plt.gca()
ax.set_yscale('log')
ax.axis["xzero"].set_visible(True)
# make other axis (bottom, top, right) invisible.
invisible = ["bottom", "top", "right"]
for n in invisible:
ax.axis[n].set_visible(False)
plt.savefig('test_logscale.pdf')
if i do this, the bottom x-axis labels disappear.
this only happens with SubplotZero -- which is needed to make the
irrelevant axes invisible, I think -- then the labels of the x-axis
disappear.
any idea how this can be fixed? i want those axes removed but i still
want the labels/ticks of the bottom x-axis to show.
thanks.
On 11/11/09, Gökhan Sever <gok...@gm...> wrote:
> On Wed, Nov 11, 2009 at 4:25 PM, per freem <per...@gm...> wrote:
>> hi all,
>>
>> I am trying to make a simple bar graph that has its yaxis scale set to
>> log. I use the following code:
>>
>> import matplotlib
>> matplotlib.use('PDF')
>> import matplotlib.pyplot as plt
>> from matplotlib import rc
>> rc('font',**{'family':'sans-serif','sans-serif':['Helvetica']})
>> plt.rcParams['ps.useafm'] = True
>> rc('font',**{'family':'sans-serif','sans-serif':['Helvetica']})
>> plt.rcParams['pdf.fonttype'] = 42
>> plt.rcParams['font.size'] = 10
>>
>> x = range(1, 11)
>> y = [5000, 900, 600, 500, 200, 110, 50, 20, 10, 5]
>> plt.figure(figsize=(5, 5), dpi=300)
>
>> plt.bar(x, y)
>
> It should work scaling from within the bar()
> plt.bar(x, y, log=True)
>
> # plt.gca().set_yscale('log')
>
>> plt.savefig('test_logscale.pdf')
>>
>> the problem is that the bar graphs do not appear -- instead, i simply
>> get horizontal lines around where the top of the bar graph should
>> appear. Any idea how to fix this?
>>
>> also, sometimes the x axis disappears when i try this. thanks.
>>
>> ------------------------------------------------------------------------------
>> 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
>>
>
>
>
> --
> Gökhan
>
|
|
From: Geoffrey E. <ge...@us...> - 2009-11-12 16:59:48
|
Ryan,
I have noticed the same issue with contourf. It seems to be a thin gap
between neighboring polygons showing through. You can turn on a thin
contour line of the same color to cover the gap:
for c in pylab.contourf( x, y, z ).collections:
c.set_linewidth( 0.1 )
Not ideal, but it works.
-Geoff
On Nov 12, 2009, at 5:42 AM, Ryan Neve wrote:
> Thank you for the suggestion, but I couldn't see a difference with
> "antialiased" either True or False. The lines between contour levels
> remain.
> I tried a different colormap (spectral) but it had the same effect.
> I tried more color levels (256) but the effect got worse.
>
> I can't find any example pictures online of matplotlib's contourf()
> producing a "smooth" plot, I know matlab's does it:
> http://www.mbari.org/bog/Projects/CentralCal/summary/images/m1_nuts_ts_contour.jpg
>
>
> -Ryan
>
> On Wed, Nov 11, 2009 at 5:08 PM, Eric Firing <ef...@ha...>
> wrote:
> Ryan Neve wrote:
> Hello,
> In my filled contour plot: http://imgur.com/vXoCL.png
> There are faint lines between the contour levels. I think they are
> yellow since they disappear in the yellow parts of the graph and are
> most obvious in the red areas. Is there any way to get rid of these
> lines? The number of contour levels is arbitrary, and I don't need
> them emphasized with a moire pattern.
>
> Try experimenting with the "antialiased" kwarg in your call to
> contourf. It is a boolean; see if a value of True or False gives a
> better result.
>
> Eric
>
>
> Thank you,
>
> -Ryan
>
>
> ------------------------------------------------------------------------
>
> ------------------------------------------------------------------------------
> 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
>
>
> ------------------------------------------------------------------------------
> 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: Ryan N. <ne...@em...> - 2009-11-12 15:26:44
|
Thank you for the suggestion, but I couldn't see a difference with "antialiased" either True or False. The lines between contour levels remain. I tried a different colormap (spectral) but it had the same effect. I tried more color levels (256) but the effect got worse. I can't find any example pictures online of matplotlib's contourf() producing a "smooth" plot, I know matlab's does it: http://www.mbari.org/bog/Projects/CentralCal/summary/images/m1_nuts_ts_contour.jpg -Ryan On Wed, Nov 11, 2009 at 5:08 PM, Eric Firing <ef...@ha...> wrote: > Ryan Neve wrote: > >> Hello, >> In my filled contour plot: http://imgur.com/vXoCL.png >> There are faint lines between the contour levels. I think they are yellow >> since they disappear in the yellow parts of the graph and are most obvious >> in the red areas. Is there any way to get rid of these lines? The number of >> contour levels is arbitrary, and I don't need them emphasized with a moire >> pattern. >> > > Try experimenting with the "antialiased" kwarg in your call to contourf. It > is a boolean; see if a value of True or False gives a better result. > > Eric > > >> Thank you, >> >> -Ryan >> >> >> ------------------------------------------------------------------------ >> >> >> ------------------------------------------------------------------------------ >> 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: Tony S Yu <to...@MI...> - 2009-11-12 15:03:33
|
On Nov 12, 2009, at 8:16 AM, Michael Droettboom wrote: > Thanks for looking into this further. Can you file a bug with this > script that appears differently in the PDF/PS/SVG/Agg backends vs. > Mac OS X? Bug filed. Thanks for your response. -Tony > > Cheers, > Mike > > Tony S Yu wrote: >> >> On Nov 11, 2009, at 1:33 PM, Michael Droettboom wrote: >> >>> Which older revision (or release) worked as you expected? >> >> After some digging, I think this issue is caused by an error in the >> macosx backend (everything works fine with tkagg, qt4agg, and agg). >> Oddly enough, calling savefig(), instead of show(), with the macosx >> backend creates the correct plot, but calling savefig() after show >> () does not. >> >> I'm actually not sure if my code worked for older revisions of the >> macosx backend (I may have had a different default backend before). >> The transform code doesn't work with revisions between 7950 and >> 7625; older versions break the macosx backend on my system (OS X >> 10.6.1). >> >> -Tony >> |
|
From: Michael D. <md...@st...> - 2009-11-12 13:16:47
|
Thanks for looking into this further. Can you file a bug with this script that appears differently in the PDF/PS/SVG/Agg backends vs. Mac OS X? Cheers, Mike Tony S Yu wrote: > > On Nov 11, 2009, at 1:33 PM, Michael Droettboom wrote: > >> Which older revision (or release) worked as you expected? > > After some digging, I think this issue is caused by an error in the > macosx backend (everything works fine with tkagg, qt4agg, and agg). > Oddly enough, calling savefig(), instead of show(), with the macosx > backend creates the correct plot, but calling savefig() after show() > does not. > > I'm actually not sure if my code worked for older revisions of the > macosx backend (I may have had a different default backend before). > The transform code doesn't work with revisions between 7950 and 7625; > older versions break the macosx backend on my system (OS X 10.6.1). > > -Tony > > >> >> Mike >> >> Tony S Yu wrote: >>> Hi, >>> >>> Awhile back, Jae-Joon helped me transform collection sizes from >>> points to data values by overriding the `get_transform` method of >>> a RegularPolyCollection (see example code below). >>> >>> When I tried the code today, the collection didn't appear on the >>> plot. Removing the get_transform method below brings the collection >>> back, but of course, the sizes are not what I want. >>> >>> Some simple testing suggests that changing the transform returned >>> by `get_transform` changes the offsets of the collection items. In >>> other words, the transform originally (i.e. in some older revision) >>> modified only the scale of collection items, but now appears to >>> modify both the scale and offset. >>> >>> Is there a way to modify only the scale of collection items? >>> >>> Thanks, >>> -Tony >>> >>> BTW, I'm on svn r7950. >>> >>> #----------------- >>> # The squares will not show up with the code below >>> # Comment out the get_transform method to see squares >>> # Change scale_x and scale_y to values close to 1 to see how they >>> change both scale and offset >>> >>> class SquareCollection(collections.RegularPolyCollection): >>> """Return a collection of squares.""" >>> >>> def __init__(self, **kwargs): >>> super(SquareCollection, self).__init__(4, rotation=np.pi/4., >>> **kwargs) >>> >>> def get_transform(self): >>> """Return transform scaling circle areas to data space.""" >>> ax = self.axes >>> pts2pixels = 72.0 / ax.figure.dpi >>> scale_x = pts2pixels * ax.bbox.width / ax.viewLim.width >>> scale_y = pts2pixels * ax.bbox.height / ax.viewLim.height >>> return transforms.Affine2D().scale(scale_x, scale_y) >>> >>> ax = plt.gca() >>> circle_areas = np.pi * np.ones(4) >>> xy = [(0, 0), (0, 1), (1, 0), (1, 1)] >>> squares = SquareCollection(sizes=circle_areas, >>> offsets=xy, transOffset=ax.transData, >>> facecolor='black') >>> ax.add_collection(squares, autolim=True) >>> plt.axis([-0.5, 1.5, -0.5, 1.5]) >>> plt.show() >>> >>> >>> >>> ------------------------------------------------------------------------------ >>> >>> 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 >> > -- Michael Droettboom Science Software Branch Operations and Engineering Division Space Telescope Science Institute Operated by AURA for NASA |
|
From: Taro S. <ta...@ap...> - 2009-11-12 03:44:14
|
Hello. I'm trying to embed mpl in an wxpython app which is intended
to run repeatedly within a single script. (It's a workaround for not
being able to use pyplot.show() more than once in a script.)
All seems to work as intended when I don't attach any key press events
(here to just destroy the app) to canvas, but when I do, as in the
script below, for some reason I keep getting errors that appear to
indicate that some remnant of the zombie of the previous app instance
may be sticking around when they shouldn't exist. Both the script in
question and the (typical) error message are shown below in this
message.
I've tried both on Linux (Debian Lenny) and Mac OS X (Leopard) with
Python 2.5 with the latest stable versions of numpy, matplotlib,
wxpython and whatnot. I observe similar problems on both
environments. What am I doing wrong? Am I not properly handling the
cleanup process before destroying the app at each loop? I think
wx.App.MainLoop() can be run more than once within a script, so that
should be okay, though I'm not sure if mpl is designed to be used this
way.
A strange thing is that when I close the app by clicking on the 'X' on
the Window frame, I don't reproduce the error. If anything, I wonder
how to initiate the event that imitates that behavior, but that is
probably a question for the wxpython people...
I'd appreciate any assistance!
Cheers,
Taro
#### BEGIN SCRIPT ####
#!/usr/bin/env python
import wxversion
wxversion.ensureMinimal('2.8')
import matplotlib
matplotlib.use('WXAgg')
from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as FigureCanvas
from matplotlib.figure import Figure
from numpy import arange, sin, pi
import wx
class CanvasFrame(wx.Frame):
def __init__(self):
wx.Frame.__init__(self, None, -1, 'CanvasFrame',size=(550,350))
self.figure = Figure()
self.axes = self.figure.add_subplot(111)
t = arange(0.0, 3.0, 0.01)
s = sin(2 * pi * t)
self.axes.plot(t, s)
self.canvas = FigureCanvas(self, -1, self.figure)
self.Bind(wx.EVT_CLOSE, self.OnCloseWindow)
self.canvas.mpl_connect('key_press_event', self.key_press)
self.sizer = wx.BoxSizer(wx.VERTICAL)
self.sizer.Add(self.canvas, 1, wx.LEFT | wx.TOP | wx.GROW)
self.SetSizer(self.sizer)
self.Fit()
def key_press(self, event):
self.Close(True)
def OnCloseWindow(self, event):
print 'Window Closed'
self.Destroy()
class App(wx.App):
def OnInit(self):
frame = CanvasFrame()
frame.Show(True)
return True
def run_app():
app = App(redirect=False)
app.MainLoop()
del app
for i in range(10):
run_app()
#### END SCRIPT ####
#### BEGIN ERROR MESSAGE ####
Traceback (most recent call last):
File "/usr/lib/python2.5/site-packages/matplotlib/backends/backend_wx.py",
line 1316, in _onMotion
FigureCanvasBase.motion_notify_event(self, x, y, guiEvent=evt)
File "/usr/lib/python2.5/site-packages/matplotlib/backend_bases.py",
line 1244, in motion_notify_event
guiEvent=guiEvent)
File "/usr/lib/python2.5/site-packages/matplotlib/backend_bases.py",
line 899, in __init__
LocationEvent.__init__(self, name, canvas, x, y, guiEvent=guiEvent)
File "/usr/lib/python2.5/site-packages/matplotlib/backend_bases.py",
line 817, in __init__
self._update_enter_leave()
File "/usr/lib/python2.5/site-packages/matplotlib/backend_bases.py",
line 844, in _update_enter_leave
last.canvas.callbacks.process('axes_leave_event', last)
File "/usr/lib/python2.5/site-packages/wx-2.8-gtk2-unicode/wx/_core.py",
line 14314, in __getattr__
raise PyDeadObjectError(self.attrStr % self._name)
wx._core.PyDeadObjectError: The C++ part of the FigureCanvasWxAgg
object has been deleted, attribute access no longer allowed.
#### END ERROR MESSAGE ####
|
|
From: Celil R. <cel...@gm...> - 2009-11-12 00:30:18
|
I just installed matplotlib on Snow Leopard 10.6 with the Qt4 backend (via
macports). However, when I try one of the Qt4 examles:
python
/opt/local/share/py26-matplotlib/examples/user_interfaces/embedding_in_qt4.py
I get the following error message:
Traceback (most recent call last):
File
"/opt/local/share/py26-matplotlib/examples/user_interfaces/embedding_in_qt4.py",
line 70, in update_figure
self.draw()
File
"/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/backends/backend_qt4agg.py",
line 130, in draw
FigureCanvasAgg.draw(self)
File
"/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/backends/backend_agg.py",
line 314, in draw
self.figure.draw(self.renderer)
File
"/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/artist.py",
line 46, in draw_wrapper
draw(artist, renderer, *kl)
File
"/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/figure.py",
line 773, in draw
for a in self.axes: a.draw(renderer)
File
"/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/artist.py",
line 46, in draw_wrapper
draw(artist, renderer, *kl)
File
"/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/axes.py",
line 1735, in draw
a.draw(renderer)
File
"/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/artist.py",
line 46, in draw_wrapper
draw(artist, renderer, *kl)
File
"/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/axis.py",
line 742, in draw
tick.draw(renderer)
File
"/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/artist.py",
line 46, in draw_wrapper
draw(artist, renderer, *kl)
File
"/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/axis.py",
line 196, in draw
self.label1.draw(renderer)
File
"/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/text.py",
line 515, in draw
bbox, info = self._get_layout(renderer)
File
"/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/text.py",
line 272, in _get_layout
'lp', self._fontproperties, ismath=False)
File
"/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/backends/backend_agg.py",
line 158, in get_text_width_height_descent
font = self._get_agg_font(prop)
File
"/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/backends/backend_agg.py",
line 195, in _get_agg_font
fname = findfont(prop)
File
"/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/font_manager.py",
line 1308, in findfont
_rebuild()
File
"/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/font_manager.py",
line 1292, in _rebuild
fontManager = FontManager()
File
"/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/font_manager.py",
line 984, in __init__
self.ttffiles = findSystemFonts(paths) + findSystemFonts()
File
"/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/font_manager.py",
line 341, in findSystemFonts
for f in get_fontconfig_fonts(fontext):
File
"/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/font_manager.py",
line 303, in get_fontconfig_fonts
status, output = commands.getstatusoutput("fc-list file")
File
"/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/commands.py",
line 56, in getstatusoutput
text = pipe.read()
IOError: [Errno 4] Interrupted system call
Any ideas on what could be causing this?
celil
|
|
From: Jae-Joon L. <lee...@gm...> - 2009-11-11 23:14:51
|
The bar command makes rectangles whose bottom position is 0.
The reason that bars disappear when you set log scale is that bottom
position of the bar become -infinity.
You may
* set log scale before calling the bar
or
* create bar plot but with reasonable (positive) bottom value. Take
a look at the docs.
Regards,
-JJ
On Wed, Nov 11, 2009 at 5:25 PM, per freem <per...@gm...> wrote:
> hi all,
>
> I am trying to make a simple bar graph that has its yaxis scale set to
> log. I use the following code:
>
> import matplotlib
> matplotlib.use('PDF')
> import matplotlib.pyplot as plt
> from matplotlib import rc
> rc('font',**{'family':'sans-serif','sans-serif':['Helvetica']})
> plt.rcParams['ps.useafm'] = True
> rc('font',**{'family':'sans-serif','sans-serif':['Helvetica']})
> plt.rcParams['pdf.fonttype'] = 42
> plt.rcParams['font.size'] = 10
>
> x = range(1, 11)
> y = [5000, 900, 600, 500, 200, 110, 50, 20, 10, 5]
> plt.figure(figsize=(5, 5), dpi=300)
> plt.bar(x, y)
> plt.gca().set_yscale('log')
> plt.savefig('test_logscale.pdf')
>
> the problem is that the bar graphs do not appear -- instead, i simply
> get horizontal lines around where the top of the bar graph should
> appear. Any idea how to fix this?
>
> also, sometimes the x axis disappears when i try this. thanks.
>
> ------------------------------------------------------------------------------
> 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: Jae-Joon L. <lee...@gm...> - 2009-11-11 23:06:43
|
I'm not exactly sure what you're trying to do. but I think what you want can be easily achieved by simply using the masked array. Is the example below similar to what you need? a = np.arange(100).reshape((10,10)) m1 = np.triu(a, 1) > 0 m2 = np.tril(a, -1) > 0 #m2 = ~m1 am1 = np.ma.array(a, mask=m1) am2 = np.ma.array(a, mask=m2) pcolormesh(am1, cmap=plt.cm.jet) pcolormesh(am2, cmap=plt.cm.gray) -JJ On Wed, Nov 11, 2009 at 12:11 PM, Christian Meesters <mee...@im...> wrote: > Hi, > > Is there a way to somehow squeeze two datasets with two different color > maps into one pcolormesh? Say one dataset occupies one triangle (e. g. > numpy.triu(dataset1, 1)) and the second dataset a different area (e. g. > numpy.tril(dataset2, -1)) and then paste the two datasets in one > pcolormesh (e.g. pylab.pcolormesh(numpy.triu(dataset1, 1) + > numpy.tril(dataset2, -1)) ). This will obviously share one colormap. But > does anybody know a trick to use two different ones? > > TIA > Christian > > PS Forgot to thank Eric Firing for his tip last time I asked. Thank you > Eric: You solved my problem! > > > ------------------------------------------------------------------------------ > 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: Gökhan S. <gok...@gm...> - 2009-11-11 22:54:46
|
On Wed, Nov 11, 2009 at 4:25 PM, per freem <per...@gm...> wrote:
> hi all,
>
> I am trying to make a simple bar graph that has its yaxis scale set to
> log. I use the following code:
>
> import matplotlib
> matplotlib.use('PDF')
> import matplotlib.pyplot as plt
> from matplotlib import rc
> rc('font',**{'family':'sans-serif','sans-serif':['Helvetica']})
> plt.rcParams['ps.useafm'] = True
> rc('font',**{'family':'sans-serif','sans-serif':['Helvetica']})
> plt.rcParams['pdf.fonttype'] = 42
> plt.rcParams['font.size'] = 10
>
> x = range(1, 11)
> y = [5000, 900, 600, 500, 200, 110, 50, 20, 10, 5]
> plt.figure(figsize=(5, 5), dpi=300)
> plt.bar(x, y)
It should work scaling from within the bar()
plt.bar(x, y, log=True)
# plt.gca().set_yscale('log')
> plt.savefig('test_logscale.pdf')
>
> the problem is that the bar graphs do not appear -- instead, i simply
> get horizontal lines around where the top of the bar graph should
> appear. Any idea how to fix this?
>
> also, sometimes the x axis disappears when i try this. thanks.
>
> ------------------------------------------------------------------------------
> 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
>
--
Gökhan
|
|
From: Pauli V. <pa...@ik...> - 2009-11-11 22:30:56
|
Tue, 10 Nov 2009 23:45:10 -0800, shriv wrote: > I am a very new user to both python and matplotlib so please beware that > my questions might be a real no-brainer. Here goes: I have a 3D array of > data that I isolated from a much larger dataset. The first two columns > are the x and y positions while the third is the intensity at the > position (xi, yi). I would like to produce a colour map of the intensity > as a function of x and y positions. Numerous tries with pcolor have got > me nowhere. I constantly get an error message saying "Too many indices". You need to regrid your data on a regular grid, not at scattered positions. See http://matplotlib.sourceforge.net/api/mlab_api.html#matplotlib.mlab.griddata -- Pauli Virtanen |
|
From: per f. <per...@gm...> - 2009-11-11 22:25:26
|
hi all,
I am trying to make a simple bar graph that has its yaxis scale set to
log. I use the following code:
import matplotlib
matplotlib.use('PDF')
import matplotlib.pyplot as plt
from matplotlib import rc
rc('font',**{'family':'sans-serif','sans-serif':['Helvetica']})
plt.rcParams['ps.useafm'] = True
rc('font',**{'family':'sans-serif','sans-serif':['Helvetica']})
plt.rcParams['pdf.fonttype'] = 42
plt.rcParams['font.size'] = 10
x = range(1, 11)
y = [5000, 900, 600, 500, 200, 110, 50, 20, 10, 5]
plt.figure(figsize=(5, 5), dpi=300)
plt.bar(x, y)
plt.gca().set_yscale('log')
plt.savefig('test_logscale.pdf')
the problem is that the bar graphs do not appear -- instead, i simply
get horizontal lines around where the top of the bar graph should
appear. Any idea how to fix this?
also, sometimes the x axis disappears when i try this. thanks.
|
|
From: Eric F. <ef...@ha...> - 2009-11-11 22:08:36
|
Ryan Neve wrote: > Hello, > In my filled contour plot: http://imgur.com/vXoCL.png > There are faint lines between the contour levels. I think they are > yellow since they disappear in the yellow parts of the graph and are > most obvious in the red areas. Is there any way to get rid of these > lines? The number of contour levels is arbitrary, and I don't need them > emphasized with a moire pattern. Try experimenting with the "antialiased" kwarg in your call to contourf. It is a boolean; see if a value of True or False gives a better result. Eric > > Thank you, > > -Ryan > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------------ > 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: John H. <jd...@gm...> - 2009-11-11 21:30:49
|
On Wed, Nov 11, 2009 at 3:22 PM, Shrividya Ravi <pen...@gm...> wrote:
> Thanks for your reply, Giorgio. I had a look at the documentation for pcolor
> but unfortunately, I can't pick out where I have gone wrong. I have attached
> my data array as a txt file. In ipython, I use the 'loadtxt' command to load
> the dataset and then assigned the variables x,y, and z to the first, second
> and third columns respectively. I then specified the meshgrid X,Y from the x
> and y arrays of my data and used pcolor(X,Y,z) to try and plot the color
> map.
You have to interpolate your 1D data onto a 2D grid --
# first load the data
In [504]: x,y,z = np.loadtxt('195pt52_T6.txt', unpack=True)
# create evenly sampled x and y vectors to interpolate onto
In [505]: xi = np.linspace(x.min(), x.max(), 20)
In [506]: yi = np.linspace(y.min(), y.max(), 20)
# use griddata to do the 2D interoplation
In [507]: Z = mlab.griddata(x, y, z, xi, yi)
In [508]: Z.shape
Out[508]: (20, 20)
# use meshgrid to create 2D grids of your 1D x and 1 data
In [509]: X, Y = np.meshgrid(xi, yi)
# pass all the 2D arrays to pcolor
In [510]: pcolor(X, Y, Z)
Out[510]: <matplotlib.collections.PolyCollection object at 0x113e6d8c>
Hope this helps!
|
|
From: Shrividya R. <pen...@gm...> - 2009-11-11 21:23:05
|
0 0 195.552 -13.2 9 107.092 -13.2 11.6421 158.136 -13.2 14.2842 105.09 -13.2 16.9263 123.106 -13.2 19.5684 133.114 -13.2 22.2105 93.0799 -13.2 24.8526 91.0782 -13.2 27.4947 83.0713 -13.2 30.1368 89.0765 -13.2 32.7789 97.0834 -13.2 35.4211 89.0765 -13.2 38.0632 93.0799 -13.2 40.7053 92.0791 -13.2 43.3474 86.0739 -13.2 45.9895 90.0773 -13.2 48.6316 89.0765 -13.2 51.2737 89.0765 -13.2 53.9158 88.0756 -13.2 56.5579 89.0765 -13.2 59.2 81.0696 -10.3895 9 107.092 -10.3895 11.6421 111.095 -10.3895 14.2842 123.106 -10.3895 16.9263 136.117 -10.3895 19.5684 133.114 -10.3895 22.2105 98.0842 -10.3895 24.8526 94.0808 -10.3895 27.4947 96.0825 -10.3895 30.1368 93.0799 -10.3895 32.7789 86.0739 -10.3895 35.4211 91.0782 -10.3895 38.0632 93.0799 -10.3895 40.7053 92.0791 -10.3895 43.3474 82.0705 -10.3895 45.9895 83.0713 -10.3895 48.6316 91.0782 -10.3895 51.2737 97.0834 -10.3895 53.9158 94.0808 -10.3895 56.5579 108.093 -10.3895 59.2 88.0756 -7.57895 9 81.0696 -7.57895 11.6421 83.0713 -7.57895 14.2842 89.0765 -7.57895 16.9263 93.0799 -7.57895 19.5684 87.0748 -7.57895 22.2105 100.086 -7.57895 24.8526 83.0713 -7.57895 27.4947 96.0825 -7.57895 30.1368 85.073 -7.57895 32.7789 94.0808 -7.57895 35.4211 87.0748 -7.57895 38.0632 87.0748 -7.57895 40.7053 100.086 -7.57895 43.3474 94.0808 -7.57895 45.9895 89.0765 -7.57895 48.6316 89.0765 -7.57895 51.2737 98.0842 -7.57895 53.9158 86.0739 -7.57895 56.5579 94.0808 -7.57895 59.2 87.0748 -4.76842 9 92.0791 -4.76842 11.6421 86.0739 -4.76842 14.2842 93.0799 -4.76842 16.9263 89.0765 -4.76842 19.5684 85.073 -4.76842 22.2105 97.0834 -4.76842 24.8526 84.0722 -4.76842 27.4947 98.0842 -4.76842 30.1368 93.0799 -4.76842 32.7789 89.0765 -4.76842 35.4211 79.0679 -4.76842 38.0632 96.0825 -4.76842 40.7053 97.0834 -4.76842 43.3474 91.0782 -4.76842 45.9895 86.0739 -4.76842 48.6316 82.0705 -4.76842 51.2737 104.089 -4.76842 53.9158 100.086 -4.76842 56.5579 97.0834 -4.76842 59.2 91.0782 -1.95789 9 102.088 -1.95789 11.6421 82.0705 -1.95789 14.2842 101.087 -1.95789 16.9263 95.0816 -1.95789 19.5684 82.0705 -1.95789 22.2105 89.0765 -1.95789 24.8526 92.0791 -1.95789 27.4947 103.089 -1.95789 30.1368 85.073 -1.95789 32.7789 81.0696 -1.95789 35.4211 96.0825 -1.95789 38.0632 85.073 -1.95789 40.7053 94.0808 -1.95789 43.3474 85.073 -1.95789 45.9895 94.0808 -1.95789 48.6316 91.0782 -1.95789 51.2737 93.0799 -1.95789 53.9158 87.0748 -1.95789 56.5579 109.094 -1.95789 59.2 90.0773 0.852632 9 103.089 0.852632 11.6421 89.0765 0.852632 14.2842 84.0722 0.852632 16.9263 95.0816 0.852632 19.5684 95.0816 0.852632 22.2105 86.0739 0.852632 24.8526 91.0782 0.852632 27.4947 96.0825 0.852632 30.1368 87.0748 0.852632 32.7789 95.0816 0.852632 35.4211 98.0842 0.852632 38.0632 92.0791 0.852632 40.7053 88.0756 0.852632 43.3474 85.073 0.852632 45.9895 93.0799 0.852632 48.6316 84.0722 0.852632 51.2737 89.0765 0.852632 53.9158 78.067 0.852632 56.5579 100.086 0.852632 59.2 96.0825 3.66316 9 83.0713 3.66316 11.6421 94.0808 3.66316 14.2842 91.0782 3.66316 16.9263 85.073 3.66316 19.5684 90.0773 3.66316 22.2105 90.0773 3.66316 24.8526 81.0696 3.66316 27.4947 94.0808 3.66316 30.1368 100.086 3.66316 32.7789 92.0791 3.66316 35.4211 85.073 3.66316 38.0632 100.086 3.66316 40.7053 92.0791 3.66316 43.3474 80.0687 3.66316 45.9895 91.0782 3.66316 48.6316 88.0756 3.66316 51.2737 94.0808 3.66316 53.9158 96.0825 3.66316 56.5579 86.0739 3.66316 59.2 92.0791 6.47368 9 97.0834 6.47368 11.6421 104.089 6.47368 14.2842 80.0687 6.47368 16.9263 87.0748 6.47368 19.5684 118.101 6.47368 22.2105 120.103 6.47368 24.8526 86.0739 6.47368 27.4947 91.0782 6.47368 30.1368 81.0696 6.47368 32.7789 90.0773 6.47368 35.4211 84.0722 6.47368 38.0632 90.0773 6.47368 40.7053 83.0713 6.47368 43.3474 87.0748 6.47368 45.9895 92.0791 6.47368 48.6316 97.0834 6.47368 51.2737 91.0782 6.47368 53.9158 91.0782 6.47368 56.5579 96.0825 6.47368 59.2 103.089 9.28421 9 104.089 9.28421 11.6421 104.089 9.28421 14.2842 117.101 9.28421 16.9263 93.0799 9.28421 19.5684 106.091 9.28421 22.2105 97.0834 9.28421 24.8526 96.0825 9.28421 27.4947 94.0808 9.28421 30.1368 89.0765 9.28421 32.7789 89.0765 9.28421 35.4211 97.0834 9.28421 38.0632 84.0722 9.28421 40.7053 91.0782 9.28421 43.3474 88.0756 9.28421 45.9895 95.0816 9.28421 48.6316 97.0834 9.28421 51.2737 94.0808 9.28421 53.9158 94.0808 9.28421 56.5579 83.0713 9.28421 59.2 89.0765 12.0947 9 96.0825 12.0947 11.6421 90.0773 12.0947 14.2842 91.0782 12.0947 16.9263 92.0791 12.0947 19.5684 88.0756 12.0947 22.2105 94.0808 12.0947 24.8526 93.0799 12.0947 27.4947 97.0834 12.0947 30.1368 90.0773 12.0947 32.7789 100.086 12.0947 35.4211 91.0782 12.0947 38.0632 81.0696 12.0947 40.7053 85.073 12.0947 43.3474 98.0842 12.0947 45.9895 92.0791 12.0947 48.6316 87.0748 12.0947 51.2737 93.0799 12.0947 53.9158 91.0782 12.0947 56.5579 85.073 12.0947 59.2 90.0773 14.9053 9 108.093 14.9053 11.6421 93.0799 14.9053 14.2842 79.0679 14.9053 16.9263 89.0765 14.9053 19.5684 86.0739 14.9053 22.2105 94.0808 14.9053 24.8526 98.0842 14.9053 27.4947 81.0696 14.9053 30.1368 94.0808 14.9053 32.7789 89.0765 14.9053 35.4211 94.0808 14.9053 38.0632 100.086 14.9053 40.7053 101.087 14.9053 43.3474 81.0696 14.9053 45.9895 105.09 14.9053 48.6316 99.0851 14.9053 51.2737 88.0756 14.9053 53.9158 96.0825 14.9053 56.5579 87.0748 14.9053 59.2 92.0791 17.7158 9 119.102 17.7158 11.6421 96.0825 17.7158 14.2842 86.0739 17.7158 16.9263 83.0713 17.7158 19.5684 92.0791 17.7158 22.2105 85.073 17.7158 24.8526 84.0722 17.7158 27.4947 94.0808 17.7158 30.1368 90.0773 17.7158 32.7789 92.0791 17.7158 35.4211 101.087 17.7158 38.0632 115.099 17.7158 40.7053 95.0816 17.7158 43.3474 93.0799 17.7158 45.9895 83.0713 17.7158 48.6316 94.0808 17.7158 51.2737 103.089 17.7158 53.9158 111.095 17.7158 56.5579 95.0816 17.7158 59.2 86.0739 20.5263 9 197.169 20.5263 11.6421 100.086 20.5263 14.2842 82.0705 20.5263 16.9263 89.0765 20.5263 19.5684 86.0739 20.5263 22.2105 85.073 20.5263 24.8526 91.0782 20.5263 27.4947 95.0816 20.5263 30.1368 100.086 20.5263 32.7789 102.088 20.5263 35.4211 93.0799 20.5263 38.0632 91.0782 20.5263 40.7053 91.0782 20.5263 43.3474 104.089 20.5263 45.9895 105.09 20.5263 48.6316 590.507 20.5263 51.2737 141.121 20.5263 53.9158 87.0748 20.5263 56.5579 90.0773 20.5263 59.2 86.0739 23.3368 9 150.129 23.3368 11.6421 103.089 23.3368 14.2842 91.0782 23.3368 16.9263 105.09 23.3368 19.5684 88.0756 23.3368 22.2105 91.0782 23.3368 24.8526 85.073 23.3368 27.4947 91.0782 23.3368 30.1368 96.0825 23.3368 32.7789 86.0739 23.3368 35.4211 87.0748 23.3368 38.0632 98.0842 23.3368 40.7053 94.0808 23.3368 43.3474 91.0782 23.3368 45.9895 101.087 23.3368 48.6316 181.156 23.3368 51.2737 120.103 23.3368 53.9158 80.0687 23.3368 56.5579 92.0791 23.3368 59.2 96.0825 26.1474 9 97.0834 26.1474 11.6421 90.0773 26.1474 14.2842 83.0713 26.1474 16.9263 84.0722 26.1474 19.5684 90.0773 26.1474 22.2105 98.0842 26.1474 24.8526 92.0791 26.1474 27.4947 96.0825 26.1474 30.1368 102.088 26.1474 32.7789 97.0834 26.1474 35.4211 86.0739 26.1474 38.0632 84.0722 26.1474 40.7053 93.0799 26.1474 43.3474 112.096 26.1474 45.9895 98.0842 26.1474 48.6316 112.096 26.1474 51.2737 84.0722 26.1474 53.9158 91.0782 26.1474 56.5579 92.0791 26.1474 59.2 101.087 28.9579 9 78.067 28.9579 11.6421 89.0765 28.9579 14.2842 98.0842 28.9579 16.9263 90.0773 28.9579 19.5684 86.0739 28.9579 22.2105 94.0808 28.9579 24.8526 91.0782 28.9579 27.4947 94.0808 28.9579 30.1368 90.0773 28.9579 32.7789 94.0808 28.9579 35.4211 94.0808 28.9579 38.0632 91.0782 28.9579 40.7053 109.094 28.9579 43.3474 93.0799 28.9579 45.9895 93.0799 28.9579 48.6316 98.0842 28.9579 51.2737 101.087 28.9579 53.9158 97.0834 28.9579 56.5579 96.0825 28.9579 59.2 88.0756 31.7684 9 84.0722 31.7684 11.6421 103.089 31.7684 14.2842 86.0739 31.7684 16.9263 88.0756 31.7684 19.5684 90.0773 31.7684 22.2105 98.0842 31.7684 24.8526 85.073 31.7684 27.4947 87.0748 31.7684 30.1368 104.089 31.7684 32.7789 93.0799 31.7684 35.4211 95.0816 31.7684 38.0632 98.0842 31.7684 40.7053 110.095 31.7684 43.3474 93.0799 31.7684 45.9895 90.0773 31.7684 48.6316 111.095 31.7684 51.2737 91.0782 31.7684 53.9158 98.0842 31.7684 56.5579 105.09 31.7684 59.2 96.0825 34.5789 9 95.0816 34.5789 11.6421 85.073 34.5789 14.2842 97.0834 34.5789 16.9263 91.0782 34.5789 19.5684 83.0713 34.5789 22.2105 81.0696 34.5789 24.8526 94.0808 34.5789 27.4947 91.0782 34.5789 30.1368 102.088 34.5789 32.7789 84.0722 34.5789 35.4211 98.0842 34.5789 38.0632 86.0739 34.5789 40.7053 94.0808 34.5789 43.3474 98.0842 34.5789 45.9895 94.0808 34.5789 48.6316 83.0713 34.5789 51.2737 106.091 34.5789 53.9158 93.0799 34.5789 56.5579 76.0653 34.5789 59.2 97.0834 37.3895 9 97.0834 37.3895 11.6421 89.0765 37.3895 14.2842 109.094 37.3895 16.9263 200.172 37.3895 19.5684 82.0705 37.3895 22.2105 96.0825 37.3895 24.8526 97.0834 37.3895 27.4947 96.0825 37.3895 30.1368 90.0773 37.3895 32.7789 87.0748 37.3895 35.4211 95.0816 37.3895 38.0632 84.0722 37.3895 40.7053 98.0842 37.3895 43.3474 92.0791 37.3895 45.9895 88.0756 37.3895 48.6316 96.0825 37.3895 51.2737 93.0799 37.3895 53.9158 82.0705 37.3895 56.5579 96.0825 37.3895 59.2 86.0739 40.2 9 89.0765 40.2 11.6421 103.089 40.2 14.2842 93.0799 40.2 16.9263 89.0765 40.2 19.5684 85.073 40.2 22.2105 88.0756 40.2 24.8526 97.0834 40.2 27.4947 97.0834 40.2 30.1368 90.0773 40.2 32.7789 87.0748 40.2 35.4211 101.087 40.2 38.0632 106.091 40.2 40.7053 107.092 40.2 43.3474 103.089 40.2 45.9895 100.086 40.2 48.6316 94.0808 40.2 51.2737 97.0834 40.2 53.9158 87.0748 40.2 56.5579 96.0825 40.2 59.2 128.11 |
|
From: Ryan N. <ne...@em...> - 2009-11-11 21:10:26
|
Hello, In my filled contour plot: http://imgur.com/vXoCL.png There are faint lines between the contour levels. I think they are yellow since they disappear in the yellow parts of the graph and are most obvious in the red areas. Is there any way to get rid of these lines? The number of contour levels is arbitrary, and I don't need them emphasized with a moire pattern. Thank you, -Ryan |
|
From: Tony S Yu <to...@MI...> - 2009-11-11 19:56:00
|
On Nov 11, 2009, at 1:33 PM, Michael Droettboom wrote: > Which older revision (or release) worked as you expected? After some digging, I think this issue is caused by an error in the macosx backend (everything works fine with tkagg, qt4agg, and agg). Oddly enough, calling savefig(), instead of show(), with the macosx backend creates the correct plot, but calling savefig() after show() does not. I'm actually not sure if my code worked for older revisions of the macosx backend (I may have had a different default backend before). The transform code doesn't work with revisions between 7950 and 7625; older versions break the macosx backend on my system (OS X 10.6.1). -Tony > > Mike > > Tony S Yu wrote: >> Hi, >> >> Awhile back, Jae-Joon helped me transform collection sizes from >> points to data values by overriding the `get_transform` method of >> a RegularPolyCollection (see example code below). >> >> When I tried the code today, the collection didn't appear on the >> plot. Removing the get_transform method below brings the >> collection back, but of course, the sizes are not what I want. >> >> Some simple testing suggests that changing the transform returned >> by `get_transform` changes the offsets of the collection items. In >> other words, the transform originally (i.e. in some older >> revision) modified only the scale of collection items, but now >> appears to modify both the scale and offset. >> >> Is there a way to modify only the scale of collection items? >> >> Thanks, >> -Tony >> >> BTW, I'm on svn r7950. >> >> #----------------- >> # The squares will not show up with the code below >> # Comment out the get_transform method to see squares >> # Change scale_x and scale_y to values close to 1 to see how they >> change both scale and offset >> >> class SquareCollection(collections.RegularPolyCollection): >> """Return a collection of squares.""" >> >> def __init__(self, **kwargs): >> super(SquareCollection, self).__init__(4, rotation=np.pi/ >> 4., **kwargs) >> >> def get_transform(self): >> """Return transform scaling circle areas to data space.""" >> ax = self.axes >> pts2pixels = 72.0 / ax.figure.dpi >> scale_x = pts2pixels * ax.bbox.width / ax.viewLim.width >> scale_y = pts2pixels * ax.bbox.height / ax.viewLim.height >> return transforms.Affine2D().scale(scale_x, scale_y) >> >> ax = plt.gca() >> circle_areas = np.pi * np.ones(4) >> xy = [(0, 0), (0, 1), (1, 0), (1, 1)] >> squares = SquareCollection(sizes=circle_areas, >> offsets=xy, transOffset=ax.transData, >> facecolor='black') >> ax.add_collection(squares, autolim=True) >> plt.axis([-0.5, 1.5, -0.5, 1.5]) >> plt.show() >> >> >> >> ------------------------------------------------------------------------------ >> 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: Tom L. <le...@ih...> - 2009-11-11 19:36:15
|
It looks like you are storing your source data in a python list. Matplotlib runs much faster if you store your data using a numpy array instead. I'm no expert, but it certianly sped up my graph drawing. -Tom Message: 5 Date: Wed, 11 Nov 2009 08:53:58 -0600 From: Mike Anderson <mba...@wi...> Subject: [Matplotlib-users] matplotlib slow compared to gnuplot? To: mat...@li... Message-ID: <AE4...@wi...> Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Hi all, Previously I was a user of gnuplot but have been giving matplotlib a try. One thing I've run in to right away is that matplotlib appears to be significantly slower. A script to produce a dozen plots was taking me ~1 second with gnuplot, and now takes me ~18 seconds with matplotlib. I'm curious if anyone knows how to speed things up. To figure out what is taking most of the time, I've used cProfile and pstats and below is the top 15 functions taking the most time. (note: "plotStackedJobsVsTime" is my function that uses matplotlib.) My script, for the curious, is at http://www.hep.wisc.edu/cms/comp/routerqMonitor/prodJobMonitorPlots_matplotlib.py and produces these plots: http://www.hep.wisc.edu/cms/comp/routerqMonitor/index.html Any hints at what I can do to speed up my script? Or is it out of my hands because it's all in matplotlib? Thanks for any help, Mike |
|
From: Michael D. <md...@st...> - 2009-11-11 18:33:25
|
Which older revision (or release) worked as you expected? Mike Tony S Yu wrote: > Hi, > > Awhile back, Jae-Joon helped me transform collection sizes from points > to data values by overriding the `get_transform` method of a > RegularPolyCollection (see example code below). > > When I tried the code today, the collection didn't appear on the plot. > Removing the get_transform method below brings the collection back, > but of course, the sizes are not what I want. > > Some simple testing suggests that changing the transform returned by > `get_transform` changes the offsets of the collection items. In other > words, the transform originally (i.e. in some older revision) modified > only the scale of collection items, but now appears to modify both the > scale and offset. > > Is there a way to modify only the scale of collection items? > > Thanks, > -Tony > > BTW, I'm on svn r7950. > > #----------------- > # The squares will not show up with the code below > # Comment out the get_transform method to see squares > # Change scale_x and scale_y to values close to 1 to see how they > change both scale and offset > > class SquareCollection(collections.RegularPolyCollection): > """Return a collection of squares.""" > > def __init__(self, **kwargs): > super(SquareCollection, self).__init__(4, rotation=np.pi/4., > **kwargs) > > def get_transform(self): > """Return transform scaling circle areas to data space.""" > ax = self.axes > pts2pixels = 72.0 / ax.figure.dpi > scale_x = pts2pixels * ax.bbox.width / ax.viewLim.width > scale_y = pts2pixels * ax.bbox.height / ax.viewLim.height > return transforms.Affine2D().scale(scale_x, scale_y) > > ax = plt.gca() > circle_areas = np.pi * np.ones(4) > xy = [(0, 0), (0, 1), (1, 0), (1, 1)] > squares = SquareCollection(sizes=circle_areas, > offsets=xy, transOffset=ax.transData, > facecolor='black') > ax.add_collection(squares, autolim=True) > plt.axis([-0.5, 1.5, -0.5, 1.5]) > plt.show() > > > > ------------------------------------------------------------------------------ > 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: Tony S Yu <to...@MI...> - 2009-11-11 18:21:30
|
Hi,
Awhile back, Jae-Joon helped me transform collection sizes from points
to data values by overriding the `get_transform` method of a
RegularPolyCollection (see example code below).
When I tried the code today, the collection didn't appear on the plot.
Removing the get_transform method below brings the collection back,
but of course, the sizes are not what I want.
Some simple testing suggests that changing the transform returned by
`get_transform` changes the offsets of the collection items. In other
words, the transform originally (i.e. in some older revision) modified
only the scale of collection items, but now appears to modify both the
scale and offset.
Is there a way to modify only the scale of collection items?
Thanks,
-Tony
BTW, I'm on svn r7950.
#-----------------
# The squares will not show up with the code below
# Comment out the get_transform method to see squares
# Change scale_x and scale_y to values close to 1 to see how they
change both scale and offset
class SquareCollection(collections.RegularPolyCollection):
"""Return a collection of squares."""
def __init__(self, **kwargs):
super(SquareCollection, self).__init__(4, rotation=np.pi/4.,
**kwargs)
def get_transform(self):
"""Return transform scaling circle areas to data space."""
ax = self.axes
pts2pixels = 72.0 / ax.figure.dpi
scale_x = pts2pixels * ax.bbox.width / ax.viewLim.width
scale_y = pts2pixels * ax.bbox.height / ax.viewLim.height
return transforms.Affine2D().scale(scale_x, scale_y)
ax = plt.gca()
circle_areas = np.pi * np.ones(4)
xy = [(0, 0), (0, 1), (1, 0), (1, 1)]
squares = SquareCollection(sizes=circle_areas,
offsets=xy, transOffset=ax.transData,
facecolor='black')
ax.add_collection(squares, autolim=True)
plt.axis([-0.5, 1.5, -0.5, 1.5])
plt.show()
|
|
From: Gökhan S. <gok...@gm...> - 2009-11-11 18:16:38
|
On Wed, Nov 11, 2009 at 11:53 AM, per freem <per...@gm...> wrote:
> hi all,
>
> i've been using genfromtxt to parse tab separated files for plotting
> purposes in matplotlib. the problem is that genfromtxt seems to give
> only two ways to access the contents of the file: one is by column,
> where you can use:
>
> d = genfromtxt(...)
>
> and then do d['header_name1'] to access the column named by
> 'header_name1', d['header_name2'] to access the column named by
> 'header_name2', etc. Or it will allow you to traverse the file line
> by line, and then access each header by number, i.e.
>
> for line in d:
> field1 = d[0]
> field2 = d[1]
> # etc.
>
> the problem is that the second method relies on knowing the order of
> the fields rather than just their name, and the first method does not
> allow line by line iteration.
> ideally what i would like is to be able to traverse each line of the
> parsed file, and then refer to each of its fields by header name, so
> that if the column order in the file changes my program will be
> unaffected:
>
> for line in d:
> field1 = ['header_name1']
> field2 = ['header_name2']
>
> is there a way to do this using standard matplotlib/numpy/scipy
> utilities? i could write my own code to do this but it seems like
> something somebody probably already thought of a good representation
> for and has implemented a more optimized version than i could write on
> my own. does such a thing exist?
>
> thanks very much
I have a constructor class to read space-delimited ASCII files.
class NasaFile(object):
def __init__(self, filename):
...
# Reading data
_data = np.loadtxt(filename, dtype='float', skiprows=self.NLHEAD).T
# Read using data['Time'] syntax
self.data = dict(zip(self.VDESC, _data))
...
There is a meta-header in this type of data and NLHEAD is the variable
telling me how many lines to skip to reach the actual data. VDESC
tells me what each columns are (starting with Time variable and many
other different measurement results.)
There is not any column dependence in this case, and generically read
any length specifically formatted data. For instance:
from nasafile import NasaFile
c = NasaFile("mydata")
c.data['Time'] gets me the whole Time column as an ndarray . Why do
you think dictionaries are not sufficient for your case? I was using
locals() to create automatic names but that was not a very wise
approach.
> _______________________________________________
> NumPy-Discussion mailing list
> Num...@sc...
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>
--
Gökhan
|
|
From: Mike A. <mba...@wi...> - 2009-11-11 18:08:24
|
> ideally what i would like is to be able to traverse each line of the
> parsed file, and then refer to each of its fields by header name, so
> that if the column order in the file changes my program will be
> unaffected:
What you want is a DictReader.
For a quick example of me using that,
----------
aReader = csv.DictReader(open(inputFilename, 'r'), delimiter='\t')
yValues = {} # Will be a dictionary of lists (these are lists of y-
values)
xValues = [] # List of x values (timestamps)
for row in aReader:
xValues.append(datetime.datetime(*(time.strptime(row
['TimeStamp'],timeStampFormat)[0:6])))
for field in sorted(row,reverse=True): # Read from last
to first in field list
if field=='TimeStamp': continue # Column of x-data
if not field in yValues.keys():
yValues[field] = [nt(row[field])] # Start list of the values
in this column
else:
yValues[field].append(int(row[field])) # Add to list of values in
this column
----------
Mike
|
|
From: per f. <per...@gm...> - 2009-11-11 17:53:56
|
hi all, i've been using genfromtxt to parse tab separated files for plotting purposes in matplotlib. the problem is that genfromtxt seems to give only two ways to access the contents of the file: one is by column, where you can use: d = genfromtxt(...) and then do d['header_name1'] to access the column named by 'header_name1', d['header_name2'] to access the column named by 'header_name2', etc. Or it will allow you to traverse the file line by line, and then access each header by number, i.e. for line in d: field1 = d[0] field2 = d[1] # etc. the problem is that the second method relies on knowing the order of the fields rather than just their name, and the first method does not allow line by line iteration. ideally what i would like is to be able to traverse each line of the parsed file, and then refer to each of its fields by header name, so that if the column order in the file changes my program will be unaffected: for line in d: field1 = ['header_name1'] field2 = ['header_name2'] is there a way to do this using standard matplotlib/numpy/scipy utilities? i could write my own code to do this but it seems like something somebody probably already thought of a good representation for and has implemented a more optimized version than i could write on my own. does such a thing exist? thanks very much |