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
(7) |
2
(8) |
|
3
(3) |
4
(5) |
5
(2) |
6
(3) |
7
(4) |
8
(11) |
9
(4) |
|
10
|
11
(8) |
12
(10) |
13
(16) |
14
(14) |
15
(13) |
16
(1) |
|
17
|
18
(8) |
19
(6) |
20
(13) |
21
(15) |
22
(5) |
23
(13) |
|
24
(2) |
25
(4) |
26
(1) |
27
(4) |
28
(8) |
29
(11) |
30
(5) |
|
31
(3) |
|
|
|
|
|
|
|
From: Benjamin R. <ben...@ou...> - 2011-07-13 22:49:11
|
On Wednesday, July 13, 2011, Justin McCann <jn...@gm...> wrote: > 2011/7/13 SULSEUNG-JIN <sul...@ho...>: >> Thanks, Justin >> >> I think I made a confusing example code. Here comes new one: > > Maybe you just need to force a call to draw() and set your x/y limits. > This works for me on matplotlib 1.0.1 > > $ ipython -pylab > # ==== > from matplotlib.collections import LineCollection > f = figure() > plot() > ax = gca() > vec = numpy.random.random((10,3)) > segs = [] > for i in range(0, len(vec)): > x1 = vec[i][0] > #x1 = 3000000 > x2 = vec[i][1] > #x2 = 4000000 > y1 = y2 = vec[i][2] > segs.extend( [[(x1,y1),(x2,y2)]] ) > > line_segments = LineCollection(segs, linewidth=3, alpha=0.3, colors = > 'r', linestyle = 'solid') > ax.add_collection(line_segments) > ax.set_xlim(0,1) > ax.set_ylim(0,1) > show() # hmmmm... nothing yet > draw() # force a draw; now it works > > ------------------------------------------------------------------------------ > AppSumo Presents a FREE Video for the SourceForge Community by Eric > Ries, the creator of the Lean Startup Methodology on "Lean Startup > Secrets Revealed." This video shows you how to validate your ideas, > optimize your ideas and identify your business strategy. > http://p.sf.net/sfu/appsumosfdev2dev > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > Just an observation (I haven't tested anything)... But what is up with the call to plot()? It might be causing issues with the autoscaler. Any line collections created without other plotting functions is going to need the axes limits set. Ben Root |
|
From: SULSEUNG-JIN <sul...@ho...> - 2011-07-13 22:31:35
|
If I set like vec = 100*numpy.random.random((10,3)) it does not shpw lines even with changing the set_xlimit and set_ylimit. I guess there is something related with scaling. Jin --- > Date: Wed, 13 Jul 2011 16:44:01 -0400 > Subject: Re: [Matplotlib-users] Question on LineCollection > From: jn...@gm... > To: sul...@ho... > CC: mat...@li... > > 2011/7/13 SULSEUNG-JIN <sul...@ho...>: > > Thanks, Justin > > > > I think I made a confusing example code. Here comes new one: > > Maybe you just need to force a call to draw() and set your x/y limits. > This works for me on matplotlib 1.0.1 > > $ ipython -pylab > # ==== > from matplotlib.collections import LineCollection > f = figure() > plot() > ax = gca() > vec = numpy.random.random((10,3)) > segs = [] > for i in range(0, len(vec)): > x1 = vec[i][0] > #x1 = 3000000 > x2 = vec[i][1] > #x2 = 4000000 > y1 = y2 = vec[i][2] > segs.extend( [[(x1,y1),(x2,y2)]] ) > > line_segments = LineCollection(segs, linewidth=3, alpha=0.3, colors = > 'r', linestyle = 'solid') > ax.add_collection(line_segments) > ax.set_xlim(0,1) > ax.set_ylim(0,1) > show() # hmmmm... nothing yet > draw() # force a draw; now it works |
|
From: SULSEUNG-JIN <sul...@ho...> - 2011-07-13 21:10:08
|
Justin, your code works flawlessly. Well, I've got the "vec" from pytables like:
vec = [ [x['sStart'],x['sEnd'],x['dIdent'],x['gi'] ] for x in table.where('(gi == currGi) & (sId == currSubId)') ]
With the above "vec", it does not work. Do you have any idea?
Jin.
---
> Date: Wed, 13 Jul 2011 16:44:01 -0400
> Subject: Re: [Matplotlib-users] Question on LineCollection
> From: jn...@gm...
> To: sul...@ho...
> CC: mat...@li...
>
> 2011/7/13 SULSEUNG-JIN <sul...@ho...>:
> > Thanks, Justin
> >
> > I think I made a confusing example code. Here comes new one:
>
> Maybe you just need to force a call to draw() and set your x/y limits.
> This works for me on matplotlib 1.0.1
>
> $ ipython -pylab
> # ====
> from matplotlib.collections import LineCollection
> f = figure()
> plot()
> ax = gca()
> vec = numpy.random.random((10,3))
> segs = []
> for i in range(0, len(vec)):
> x1 = vec[i][0]
> #x1 = 3000000
> x2 = vec[i][1]
> #x2 = 4000000
> y1 = y2 = vec[i][2]
> segs.extend( [[(x1,y1),(x2,y2)]] )
>
> line_segments = LineCollection(segs, linewidth=3, alpha=0.3, colors =
> 'r', linestyle = 'solid')
> ax.add_collection(line_segments)
> ax.set_xlim(0,1)
> ax.set_ylim(0,1)
> show() # hmmmm... nothing yet
> draw() # force a draw; now it works
|
|
From: Justin M. <jn...@gm...> - 2011-07-13 20:44:08
|
2011/7/13 SULSEUNG-JIN <sul...@ho...>:
> Thanks, Justin
>
> I think I made a confusing example code. Here comes new one:
Maybe you just need to force a call to draw() and set your x/y limits.
This works for me on matplotlib 1.0.1
$ ipython -pylab
# ====
from matplotlib.collections import LineCollection
f = figure()
plot()
ax = gca()
vec = numpy.random.random((10,3))
segs = []
for i in range(0, len(vec)):
x1 = vec[i][0]
#x1 = 3000000
x2 = vec[i][1]
#x2 = 4000000
y1 = y2 = vec[i][2]
segs.extend( [[(x1,y1),(x2,y2)]] )
line_segments = LineCollection(segs, linewidth=3, alpha=0.3, colors =
'r', linestyle = 'solid')
ax.add_collection(line_segments)
ax.set_xlim(0,1)
ax.set_ylim(0,1)
show() # hmmmm... nothing yet
draw() # force a draw; now it works
|
|
From: Ravi K. V. <vvn...@gm...> - 2011-07-13 20:14:53
|
Reposting it as the content of my query in my previous post on the website.
Hi all,
>
> I am having trouble redrawing the canvas when embedding the simple
> matplotlib graph into wxpython.
> I tried creating the required GUI using the XRCed.
> My aim is to display two check boxes, one with Sin and one with Cos signal.
> And then a show button.
> By default both the checkboxes are clicked and a Sin signal is displayed.
> If SinCheckbox is clicked, I want a sin signal. If Cos is clicked, I wanted
> a Cos Signal. If both are checked I wanted a Tan signal to be displayed in
> the figure.
> The problem i am facing is, when I am trying to draw on the canvas for the
> figure, I thought the old canvas gets cleared and draw() redraws the figure.
> But this does not seem to be the case. I still see the old figure and new
> plot being drawn on the old plot.
>
> Also I tried placing the tooltips but they doesnt seem to come up.
>
> Please find the code I have used for the same. I tried to modify the code
> in the matplotlib examples for embedding matplotlib in wxpython.
> Also attaching to this email is the xrc code generated using XRCed
>
> MyApp- class creates the required layout.
> PlotPanel class is responsible for creating the figure, embedding the
> matplotlibfigure inside the canvas and redrawing it through method 'repaint'
> i defined in it.
>
> I am getting an object of PlotPanel in the MyApp instance and calling the
> plot function.
>
>
>
> import wxversion
> wxversion.ensureMinimal('2.8')
>
> import sys, time, os, gc
> import matplotlib
> matplotlib.use('WXAgg')
> import matplotlib.cm as cm
> import matplotlib.cbook as cbook
> from matplotlib.backends.backend_wxagg import Toolbar, FigureCanvasWxAgg, \
> NavigationToolbar2WxAgg as NavigationToolbar
> from matplotlib.figure import Figure
> import numpy as npy
> from pylab import get_current_fig_manager as gcfm
> import wx
> import wx.xrc as xrc
> import matplotlib as mpl
> mpl.use('WXAgg')
> mpl.interactive(False)
> ERR_TOL = 1e-5 # floating point slop for peak-detection
> matplotlib.rc('image', origin='lower')
>
> class PlotPanel(wx.Panel):
>
> def __init__(self, parent):
> wx.Panel.__init__(self, parent, -1)
> self.tooltip = wx.ToolTip(tip='tip with a long %s line and a
> newline\n' % (' '*100)) # needs to be added to getover the bug with tooltip.
> self.fig = Figure((5,4), 200)
> self.a = self.fig.add_subplot(111)
> #self.fig = Figure(0)
> self.canvas = FigureCanvasWxAgg(self, -1, self.fig)
> #self.toolbar = Toolbar(self.canvas) #matplotlib toolbar
> self.toolbar = NavigationToolbar(self.canvas)
> self.toolbar.Realize()
> # Now put all into a sizer
> sizer = wx.BoxSizer(wx.VERTICAL)
> # This way of adding to sizer allows resizing
> sizer.Add(self.canvas, 1, wx.LEFT|wx.BOTTOM|wx.GROW)
> # Best to allow the toolbar to resize!
> sizer.Add(self.toolbar, 0, wx.GROW)
> self.SetSizer(sizer)
> self.Fit()
>
> def init_plot_data(self):
>
> self.x=npy.linspace(0, 6 * npy.pi, 500)
> self.y=npy.sin(self.x)
> #self.x, self.y = npy.meshgrid(x, y)
> print 'before the plotting'
> self.myGraph = self.a.plot(self.x,self.y)
> print 'after the plotting'
>
> self.toolbar.update()
> gcfm().canvas.SetToolTip(self.tooltip)
> self.tooltip.Enable(False)
> self.tooltip.SetDelay(0)
> self.fig.canvas.mpl_connect('motion_notify_event',self._onMotion)
>
> def GetToolBar(self):
> # You will need to override GetToolBar if you are using an
> # unmanaged toolbar in your frame
> return self.toolbar
>
> def _onMotion(self,event) :
> tip='X:{0} Y:{1}'.format(event.xdata,event.ydata)
> print tip
> self.tooltip.SetTip(tip)
> self.tooltip.Enable(True)
>
> def repaint(self):
> self.canvas.draw()
>
> class MyApp(wx.App):
>
> def OnInit(self):
> #xrcfile = cbook.get_sample_data('graphing_tool.xrc',
> asfileobj=False)
> xrcfile='U:\graphing_tool\modularised\\version_13_13th
> July\gtool.xrc'
> print 'loading', xrcfile
>
> self.res = xrc.XmlResource(xrcfile)
>
> # main frame and panel ---------
>
> self.frame = self.res.LoadFrame(None,"mainFrame")
> print 'RAVI: Frame is :',self.frame
> self.panel = xrc.XRCCTRL(self.frame,"mainPanel")
>
> # matplotlib panel -------------
>
> # container for matplotlib panel (I like to make a container
> # panel for our panel so I know where it'll go when in XRCed.)
> plot_container = xrc.XRCCTRL(self.frame,"signalplot")
> sizer = wx.BoxSizer(wx.VERTICAL)
>
> # matplotlib panel itself
> self.plotpanel = PlotPanel(plot_container)
> self.plotpanel.init_plot_data()
>
> sizer.Add(self.plotpanel, 1, wx.EXPAND)
> plot_container.SetSizer(sizer)
>
> # onex checkbox
>
> self.sin_checkbox = xrc.XRCCTRL(self.frame,'sin')
>
> # lte checkbox
>
> self.cos_checkbox = xrc.XRCCTRL(self.frame,'cos')
>
> ## display button
> display_button= xrc.XRCCTRL(self.frame,'display')
> wx.EVT_BUTTON(display_button,display_button.GetId(),self.onDisplay)
>
>
> # final setup ------------------
>
> sizer = self.panel.GetSizer()
> self.frame.Show(1)
>
> self.SetTopWindow(self.frame)
>
> return True
>
> def onDisplay(self,event):
>
> if self.sin_checkbox.IsChecked() and not
> self.cos_checkbox.IsChecked():
> print 'showing sin signal'
> self.plotFigure(1)
>
> elif not self.sin_checkbox.IsChecked() and
> self.cos_checkbox.IsChecked():
> print 'showing cos signal'
> self.plotFigure(2)
> elif self.sin_checkbox.IsChecked() and
> self.cos_checkbox.IsChecked() :
> print 'showing Tan signal'
> self.plotFigure(3)
> else:
> msg= 'Not showing either sin or cos signal. Click on either of
> the signals'
>
> def plotFigure(self,option):
> if option == 1:
> self.plotpanel.y=npy.sin(self.plotpanel.x)
> #self.x, self.y = npy.meshgrid(x, y)
> print 'before the plotting sin'
> self.plotpanel.myGraph =
> self.plotpanel.a.plot(self.plotpanel.x,self.plotpanel.y)
> print 'after the plotting'
>
> self.plotpanel.repaint()
> elif option == 2:
> #self.plotpanel.fig.clf(False)
> #self.plotpanel.canvas.Clear()
> self.plotpanel.y=npy.cos(self.plotpanel.x)
> #self.x, self.y = npy.meshgrid(x, y)
> print 'before the plotting cos'
> self.plotpanel.myGraph =
> self.plotpanel.a.plot(self.plotpanel.x,self.plotpanel.y)
> print 'after the plotting'
> self.plotpanel.repaint()
> else:
> #self.plotpanel.fig.clf(False)
> #self.plotpanel.canvas.Clear()
> self.plotpanel.y=npy.tan(self.plotpanel.x)
> #self.x, self.y = npy.meshgrid(x, y)
> print 'before the plotting Tan'
> self.plotpanel.myGraph =
> self.plotpanel.a.plot(self.plotpanel.x,self.plotpanel.y)
> print 'after the plotting'
> self.plotpanel.repaint()
> if __name__ == '__main__':
> app = MyApp(0)
> app.MainLoop()
>
> --
> Thanks,
> Ravikanth
>
--
Regards,
RaviKanth VN Vanapalli
MS - Telecommunications Engineering
The University of Texas at Dallas, Richardson, TX
Ph: (571) 420 0656
Email: vvn...@gm...
|
|
From: SULSEUNG-JIN <sul...@ho...> - 2011-07-13 20:13:58
|
Thanks, Justin
I think I made a confusing example code. Here comes new one:
segs = []
for i in range(0, len(vec)):
x1 = vec[i][0]
#x1 = 3000000
x2 = vec[i][1]
#x2 = 4000000
y1 = y2 = vec[i][2]
segs.extend( [[(x1,y1),(x2,y2)]] )
line_segments = LineCollection(segs, linewidth=3, alpha=0.3, colors =
'r', linestyle = 'solid') ax.add_collection(line_segments)
The above code doesn't show any lines. But if I comment out one or both of commented parts, the lines are shown.
I mean the below cases are all work.
x1 = vec[i][0]
x2 = 4000000
y1 = y2 = vec[i][2]
or
x1 = 3000000
x2 = vec[i][1]
y1 = y2 = vec[i][2]
I think it's wierd. I'm pretty sure that the 2D array has valid values.
Jin
---
> Date: Wed, 13 Jul 2011 15:32:33 -0400
> Subject: Re: [Matplotlib-users] Question on LineCollection
> From: jn...@gm...
> To: sul...@ho...
> CC: mat...@li...
>
> 2011/7/13 SULSEUNG-JIN <sul...@ho...>:
> > Hi,
> >
> > I'm plotting thousands of short lines on a plot. Because "plot" and "Line2D"
> > are quite slow for this case, I'm trying to use lineCollection. Here comes
> > the part of my testing code:
> >
> > ...
> > segs = []
> >
> > # Manual set for testing
> > x2 = np.zeros(2,dtype=int)
> > ys2 = [np.zeros(2,dtype=float)]
> > x2[0] = 1000000
> > x2[1] = 2000000
> > ys2[0][0] = ys2[0][1] = 50
> > segs.extend( [zip(x2,y) for y in ys2] )
> >
> > for i in range(0, len(records)):
> > ...
> > # get xStart, xEnd, and y
> > ...
> >
> > x2[0] = xStart
> > x2[1] = xEnd
> > ys2[0][0] = ys2[0][1] = y
> > segs.extend( [zip(x2,y) for y in ys2] )
> >
> > line_segments = LineCollection(segs, linewidth=4, alpha=0.3, colors =
> > 'r', linestyle = 'solid')
> > ax.add_collection(line_segments)
> > ...
> >
> > The problem I have is only the first segment of the lines in the "segs"
> > which I manually set the values is shown in the plot. If I move the first
> > part in the for loop to test, it works. What am I missing?
> >
> > Thank you in advance.
>
> Are you sure it's the first segment that shows up, and not the last one?
>
> You're reusing the numpy array x2 and the list ys2. You're overwriting
> the values inside them each time through the for loop, but segs just
> contains len(records) references to the exact same arrays in memory
> (x2 and ys2).
>
> The reason it works if you move the first part inside is that it
> creates a new numpy.array x2 and a new python list ys2 each time then,
> which is what you want.
>
> Justin
|
|
From: Jorge G. <jga...@fi...> - 2011-07-13 19:55:34
|
In case it helps, I also tried the simple plot test recommended in the matplotlib FAQ: Here's the traceback it gave me. $HOME=/home/cadsoft CONFIGDIR=/home/cadsoft/.matplotlib matplotlib data path /usr/local/lib/python3.1/dist-packages/matplotlib/mpl-data loaded rc file /usr/local/lib/python3.1/dist-packages/matplotlib/mpl-data/matplotlibrc matplotlib version 1.1.0 verbose.level helpful interactive is False platform is linux2 Using fontManager instance from /home/cadsoft/.matplotlib/fontList.py3k.cache backend agg version v2.2 Thanks for all of your help. On Fri, Jul 8, 2011 at 2:49 PM, Darren Dale <dsd...@gm...> wrote: > On Wed, Jun 29, 2011 at 10:46 AM, Jorge Garcia <jga...@fi...> wrote: > > Hello, > > > > I was trying to test out the Python 3 development version with the first > > plot shown in the pyplot tutorial. Everything seems to work ok until I go > > > > plt.show() > > > > at which point nothing happens, I don't see a plot. Python accepts the > > command and is waiting for a new command but I have no plot. > > Maybe you don't have a python-3 compatible gui library installed, in > which case your backend is defaulting to AGG, which cannot render a > window for you. > > > I've tried changing the backend in the matplotlibrc file to TkAgg, but I > > still get nothing, in fact now when I try to import matplotlib I get a > > traceback error that name -tkagg is not defined, seems like it might be > > something in the module. > > > > Can anyone lend a hand? > > Posting the exact traceback would help us help you. I'll hazard a > guess that you don't have the tk development packages installed, so > the tkagg backend could not be built when you installed matplotlib for > py3, and therefore tkagg cannot be selected as your backend. > > Darren > |
|
From: Justin M. <jn...@gm...> - 2011-07-13 19:32:40
|
2011/7/13 SULSEUNG-JIN <sul...@ho...>:
> Hi,
>
> I'm plotting thousands of short lines on a plot. Because "plot" and "Line2D"
> are quite slow for this case, I'm trying to use lineCollection. Here comes
> the part of my testing code:
>
> ...
> segs = []
>
> # Manual set for testing
> x2 = np.zeros(2,dtype=int)
> ys2 = [np.zeros(2,dtype=float)]
> x2[0] = 1000000
> x2[1] = 2000000
> ys2[0][0] = ys2[0][1] = 50
> segs.extend( [zip(x2,y) for y in ys2] )
>
> for i in range(0, len(records)):
> ...
> # get xStart, xEnd, and y
> ...
>
> x2[0] = xStart
> x2[1] = xEnd
> ys2[0][0] = ys2[0][1] = y
> segs.extend( [zip(x2,y) for y in ys2] )
>
> line_segments = LineCollection(segs, linewidth=4, alpha=0.3, colors =
> 'r', linestyle = 'solid')
> ax.add_collection(line_segments)
> ...
>
> The problem I have is only the first segment of the lines in the "segs"
> which I manually set the values is shown in the plot. If I move the first
> part in the for loop to test, it works. What am I missing?
>
> Thank you in advance.
Are you sure it's the first segment that shows up, and not the last one?
You're reusing the numpy array x2 and the list ys2. You're overwriting
the values inside them each time through the for loop, but segs just
contains len(records) references to the exact same arrays in memory
(x2 and ys2).
The reason it works if you move the first part inside is that it
creates a new numpy.array x2 and a new python list ys2 each time then,
which is what you want.
Justin
|
|
From: Jorge G. <jga...@fi...> - 2011-07-13 19:13:09
|
Hi Darren,
I think your correct, the matplotlibrc file says that the backend is set to
Agg.
Here's the traceback:
BUILDING MATPLOTLIB
matplotlib: 1.1.0
python: 3.1.2 (r312:79147, Sep 27 2010, 09:45:41) [GCC
4.4.3]
platform: linux2
REQUIRED DEPENDENCIES
numpy: 1.6.0
freetype2: 9.22.3
OPTIONAL BACKEND DEPENDENCIES
libpng: 1.4.7
Tkinter: no
* Using default library and include directories for
* Tcl and Tk because a Tk window failed to open.
* You may need to define DISPLAY for Tk to work so
* that setup can determine where your libraries are
* located. Tkinter present, but header files are not
* found. You may need to install development
* packages.
Gtk+: no
* Building for Gtk+ requires pygtk; you must be able
* to "import gtk" in your build/install environment
Mac OS X native: no
Qt: no
Qt4: no
Cairo: no
OPTIONAL DATE/TIMEZONE DEPENDENCIES
datetime: present, version unknown
dateutil: 1.5
pytz: 2011c
OPTIONAL USETEX DEPENDENCIES
dvipng: 1.12
ghostscript: 8.71
latex: 3.1415926
pdftops: 0.12.4
[Edit setup.cfg to suppress the above messages]
============================================================================
pymods ['pylab']
packages ['matplotlib', 'matplotlib.backends',
'matplotlib.backends.qt4_editor', 'matplotlib.projections',
'matplotlib.testing', 'matplotlib.testing.jpl_units', 'matplotlib.tests',
'mpl_toolkits', 'mpl_toolkits.mplot3d', 'mpl_toolkits.axes_grid',
'mpl_toolkits.axes_grid1', 'mpl_toolkits.axisartist',
'matplotlib.sphinxext', 'matplotlib.tri', 'matplotlib.delaunay']
running build
running build_py
copying lib/matplotlib/mpl-data/matplotlibrc ->
build/lib.linux-i686-3.1/matplotlib/mpl-data
copying lib/matplotlib/mpl-data/matplotlib.conf ->
build/lib.linux-i686-3.1/matplotlib/mpl-data
running build_ext
On Fri, Jul 8, 2011 at 2:49 PM, Darren Dale <dsd...@gm...> wrote:
> On Wed, Jun 29, 2011 at 10:46 AM, Jorge Garcia <jga...@fi...> wrote:
> > Hello,
> >
> > I was trying to test out the Python 3 development version with the first
> > plot shown in the pyplot tutorial. Everything seems to work ok until I go
> >
> > plt.show()
> >
> > at which point nothing happens, I don't see a plot. Python accepts the
> > command and is waiting for a new command but I have no plot.
>
> Maybe you don't have a python-3 compatible gui library installed, in
> which case your backend is defaulting to AGG, which cannot render a
> window for you.
>
> > I've tried changing the backend in the matplotlibrc file to TkAgg, but I
> > still get nothing, in fact now when I try to import matplotlib I get a
> > traceback error that name -tkagg is not defined, seems like it might be
> > something in the module.
> >
> > Can anyone lend a hand?
>
> Posting the exact traceback would help us help you. I'll hazard a
> guess that you don't have the tk development packages installed, so
> the tkagg backend could not be built when you installed matplotlib for
> py3, and therefore tkagg cannot be selected as your backend.
>
> Darren
>
|
|
From: Paul I. <piv...@gm...> - 2011-07-13 18:48:58
|
Richard Hattersley, on 2011-07-13 09:58, wrote: > Is there a standard way to add fixed-size, arbitrary-design symbols to axes? > - Their position must be given in data coordinates > - Their size must be given in physical coordinates (inches/points) > > They basically need to behave like plot markers, but with the ability to specifiy arbitrary designs. > e.g. See http://commons.wikimedia.org/wiki/File:Cloud_cover_3.svg for an example symbol. > > Currently I'm defining my symbols using a sequence of Patch objects, and then using PatchCollection (with its offsets and transOffset properties, and its set_transform() method) to do the positioning/scaling. > > Is there a better way? This looks similar enough: http://matplotlib.sourceforge.net/examples/api/scatter_piecharts.html best, -- Paul Ivanov 314 address only used for lists, off-list direct email at: http://pirsquared.org | GPG/PGP key id: 0x0F3E28F7 |
|
From: SULSEUNG-JIN <sul...@ho...> - 2011-07-13 17:19:23
|
Hi,
I'm plotting thousands of short lines on a plot. Because "plot" and "Line2D" are quite slow for this case, I'm trying to use lineCollection. Here comes the part of my testing code:
...
segs = []
# Manual set for testing
x2 = np.zeros(2,dtype=int)
ys2 = [np.zeros(2,dtype=float)]
x2[0] = 1000000
x2[1] = 2000000
ys2[0][0] = ys2[0][1] = 50
segs.extend( [zip(x2,y) for y in ys2] )
for i in range(0, len(records)):
...
# get xStart, xEnd, and y
...
x2[0] = xStart
x2[1] = xEnd
ys2[0][0] = ys2[0][1] = y
segs.extend( [zip(x2,y) for y in ys2] )
line_segments = LineCollection(segs, linewidth=4, alpha=0.3, colors = 'r', linestyle = 'solid')
ax.add_collection(line_segments)
...
The problem I have is only the first segment of the lines in the "segs" which I manually set the values is shown in the plot. If I move the first part in the for loop to test, it works. What am I missing?
Thank you in advance.
Jin
---
|
|
From: Paul I. <piv...@gm...> - 2011-07-13 16:27:27
|
JD83, on 2011-07-13 08:59, wrote:
>
> I am writing a script with a matplotlib figure embedded in a Tkinter Frame :
>
> fig=Figure()
> ax=fig.add_subplot(111)
> canvas = FigureCanvasTkAgg(fig, root)
>
> and so on...
>
> Everything goes well but when i try to clear the figure, the xaxis and yaxis
> don't desappear, so that the next axis print over the previous ones.
>
> ax.cla() clears the plot.
> But ax.xaxis.cla() or ax.yaxis.cla() have no effect.
as far as i can see, this is for resetting the formatting and
clearing labels - it does have an effect here:
In [16]: ax.set_ylabel("foo")
Out[16]: <matplotlib.text.Text at 0xb25a44c>
In [17]: ax.yaxis.cla() #label is gone
> And fig.clr() seems to lock the process : nothing deleted, nothing new
> ploted.
Try this:
f.clf(keep_observers=False)
from the docstring: "Set *keep_observers* to True if, for example,
a gui widget is tracking the axes in the figure."
best,
--
Paul Ivanov
314 address only used for lists, off-list direct email at:
http://pirsquared.org | GPG/PGP key id: 0x0F3E28F7
|
|
From: JD83 <jd...@fr...> - 2011-07-13 15:59:59
|
I am writing a script with a matplotlib figure embedded in a Tkinter Frame : fig=Figure() ax=fig.add_subplot(111) canvas = FigureCanvasTkAgg(fig, root) and so on... Everything goes well but when i try to clear the figure, the xaxis and yaxis don't desappear, so that the next axis print over the previous ones. ax.cla() clears the plot. But ax.xaxis.cla() or ax.yaxis.cla() have no effect. And fig.clr() seems to lock the process : nothing deleted, nothing new ploted. Can somebody help ? Thank you. JD -- View this message in context: http://old.nabble.com/Clearing-the-axis-in-a-figure-embedded-in-Tkinter-tp32054762p32054762.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
|
From: Richard H. <hat...@bt...> - 2011-07-13 08:58:16
|
Is there a standard way to add fixed-size, arbitrary-design symbols to axes? - Their position must be given in data coordinates - Their size must be given in physical coordinates (inches/points) They basically need to behave like plot markers, but with the ability to specifiy arbitrary designs. e.g. See http://commons.wikimedia.org/wiki/File:Cloud_cover_3.svg for an example symbol. Currently I'm defining my symbols using a sequence of Patch objects, and then using PatchCollection (with its offsets and transOffset properties, and its set_transform() method) to do the positioning/scaling. Is there a better way? Any suggestions gratefully received! Thanks |
|
From: C M <cmp...@gm...> - 2011-07-13 01:46:29
|
On Tue, Jul 12, 2011 at 3:15 AM, Maximilian Trescher <fa...@tr...> wrote: > Hi, > >> I want to pick a good (dynamic, for zooming) way to format the y axis. >> There are two issues: >> Does (1) seem like the right approach? And for 2, is there already a >> formatter that is appropriate for this or could be adapted to it? > did you try the AutoDateLocator (from matplotlib.dates)? I hadn't. I am trying now but am stuck on: How can I plot the data given that, from the database, each datapoint is of the form ''0:00:02.994000'? Is there a way to tell matplotlib to read that as a time duration? Thanks, Che |