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
(19) |
2
(30) |
3
(14) |
4
(1) |
5
(16) |
6
(7) |
7
(12) |
8
(14) |
9
(35) |
10
(16) |
11
(31) |
12
(6) |
13
(14) |
14
(13) |
15
(20) |
16
(15) |
17
(27) |
18
(5) |
19
(10) |
20
(22) |
21
(20) |
22
(30) |
23
(25) |
24
(11) |
25
(2) |
26
(2) |
27
(23) |
28
(20) |
29
(26) |
30
(25) |
31
(7) |
|
Hello, I'm writing a script that removes data from plots by looping over axes.get_lines(), removing data, then using axes.set_lines(). It works quite well, but when it's a plot with error bars, the vertical part of the error bar is not disappearing. I'm assuming the vertical part is a vline or something and so should not be with the other lines. Where does this data get stuck? :) Thanks! Jack
On Jul 14, 2009, at 3:12 PM, per freem wrote: > Hi Tony, > > thanks for the pointer. that code does not run for me, it generates > the following error: > > ttributeError Traceback (most recent call > last) > .... > > /Library/Python/2.5/site-packages/matplotlib/rcsetup.pyc in > validate_color(s) > 160 def validate_color(s): > 161 'return a valid color arg' > --> 162 if s.lower() == 'none': > 163 return 'None' > 164 if is_color_like(s): > > AttributeError: 'list' object has no attribute 'lower' > WARNING: Failure executing file: <color_cycle.py> > > any idea what might be wrong? Hmm, it looks like there was a fix added a couple of months ago (svn revision 7164). If you're on trunk, then updating it should fix this problem. If you're not on trunk: I don't think any official releases have occurred since this fix, so I don't think updating to the last official release will help. In any case, I think this error only affects the ``cycle_cmap`` function in the code (calls to ``cmap_intervals`` should work fine). If you comment out the 4 lines of code after the comment "Change the default color cycle", I believe everything should work fine. -Tony
Hi Tony, thanks for the pointer. that code does not run for me, it generates the following error: ttributeError Traceback (most recent call last) color_cycle.py in <module>() 63 if __name__ == '__main__': 64 n_lines = 10 ---> 65 cycle_cmap(length=n_lines) 66 x = np.linspace(0, 10) 67 for shift in np.linspace(0, np.pi, n_lines): color_cycle.py in cycle_cmap(cmap, length) 59 idx = np.linspace(crange['start'], crange['stop'], length).astype(np.int) 60 colors = cm(idx) ---> 61 mpl.axes.set_default_color_cycle(colors.tolist()) 62 63 if __name__ == '__main__': /Library/Python/2.5/site-packages/matplotlib/axes.pyc in set_default_color_cycle(clist) 113 """ 114 _process_plot_var_args.defaultColors = clist[:] --> 115 rcParams['lines.color'] = clist[0] 116 117 class _process_plot_var_args: /Library/Python/2.5/site-packages/matplotlib/__init__.pyc in __setitem__(self, key, val) 603 instead.'% (key, alt)) 604 key = alt --> 605 cval = self.validate[key](val) 606 dict.__setitem__(self, key, cval) 607 except KeyError: /Library/Python/2.5/site-packages/matplotlib/rcsetup.pyc in validate_color(s) 160 def validate_color(s): 161 'return a valid color arg' --> 162 if s.lower() == 'none': 163 return 'None' 164 if is_color_like(s): AttributeError: 'list' object has no attribute 'lower' WARNING: Failure executing file: <color_cycle.py> any idea what might be wrong? On Tue, Jul 14, 2009 at 10:14 AM, Tony S Yu <to...@mi...> wrote: > Not too long ago, I posted an example of this to the list<http://www.nabble.com/Where-to-post-examples-%2528specifically%252C-one-that-may-be-useful-for-time-evolution-plots%2529-td23901837.html>. > The code near the bottom of that thread is a little more general than the > one at the top and shows, three different ways to cycle through the colors > of a colormap. > > Hope that helps, > -Tony > > > On Jul 14, 2009, at 9:51 AM, per freem wrote: > > Hi all, > > i would like to set the colors of the lines i plot (using the plot > function) to go from red to blue, in evenly spaced interval. that is, > imagine a color map from red to green, where i plot n-many lines, each > receiving a color from this color map, starting at the red end and going to > green. > > the docs say how to set the color cycle of lines set by plot, using: > > matplotlib.axes.set_default_color_cycle(['r', 'y', 'g', 'b']) > > but this only allows me to use named colors, and here i am looking to use > shades from red to green. > my question is: first, how can i generate N evenly spaced colors from the > red spectrum to the green spectrum? and two, how can i make it so plot uses > these colors for its line plots? > > thanks very much. > > ------------------------------------------------------------------------------ > Enter the BlackBerry Developer Challenge > This is your chance to win up to 100,000ドル in prizes! For a limited time, > vendors submitting new applications to BlackBerry App World(TM) will have > the opportunity to enter the BlackBerry Developer Challenge. See full prize > > details at: > http://p.sf.net/sfu/Challenge_______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > >
On 2009年07月14日 12:52, Robert Cimrman wrote: > Robert Kern wrote: >> On 2009年07月13日 13:20, Robert Cimrman wrote: >>> Hi all, >>> >>> I would like to use griddata() to interpolate a function given at >>> specified points of a bunch of other points. While the method works >>> well, it slows down considerably as the number of points to interpolate >>> to increases. >>> >>> The dependence of time/(number of points) is nonlinear (see the >>> attachment) - it seems that while the Delaunay trinagulation itself is >>> fast, I wonder how to speed-up the interpolation. The docstring says, >>> that it is based on "natural neighbor interpolation" - how are the >>> neighbors searched? >> Using the Delaunay triangulation. The "natural neighbors" of an interpolation >> point are those points participating in triangles in the Delaunay triangulation >> whose circumcircles include the interpolation point. The triangle that encloses >> the interpolation point is found by a standard walking procedure, then the >> neighboring triangles (natural or otherwise) are explored in a breadth-first >> search around the starting triangle to find the natural neighbors. > > I see, thanks for the explanation. The walking procedure is what is > described e.g. in [1], right? (summary; starting from a random triangle, > a line is made connecting that triangle with the interpolation point, > and triangles along that line are probed.) > > [1] http://www.geom.uiuc.edu/software/cglist/GeomDir/ptloc96.ps.gz Yes. >>> Does it use the kd-trees like scipy.spatial? I have >>> a very good experience with scipy.spatial performance. >>> >>> Also, is there a way of reusing the triangulation when interpolating >>> several times using the same grid? >> One would construct a Triangulation() object with the (x,y) data points, get a >> new NNInterpolator() object using the .nn_interpolator(z) method for each new z >> data set, and then interpolate your grid on the NNInterpolator. > > So if the above fails, I can bypass griddata() by using the delaunay > module directly, good. Yes. griddata is a fairly light wrapper that exists mainly to sanitize inputs and allow use of the natgrid implementation easily. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco
Hi all, I'm a newbie, I'm trying to plot a line with an arrow (arrow in the middle and another with an arrow at the end) with the following points: [1, 2] and [5, 2] Could anyone please help me with the code? Thanks. Harriet A. Welbeck
Robert Kern wrote: > On 2009年07月13日 13:20, Robert Cimrman wrote: >> Hi all, >> >> I would like to use griddata() to interpolate a function given at >> specified points of a bunch of other points. While the method works >> well, it slows down considerably as the number of points to interpolate >> to increases. >> >> The dependence of time/(number of points) is nonlinear (see the >> attachment) - it seems that while the Delaunay trinagulation itself is >> fast, I wonder how to speed-up the interpolation. The docstring says, >> that it is based on "natural neighbor interpolation" - how are the >> neighbors searched? > > Using the Delaunay triangulation. The "natural neighbors" of an interpolation > point are those points participating in triangles in the Delaunay triangulation > whose circumcircles include the interpolation point. The triangle that encloses > the interpolation point is found by a standard walking procedure, then the > neighboring triangles (natural or otherwise) are explored in a breadth-first > search around the starting triangle to find the natural neighbors. I see, thanks for the explanation. The walking procedure is what is described e.g. in [1], right? (summary; starting from a random triangle, a line is made connecting that triangle with the interpolation point, and triangles along that line are probed.) [1] http://www.geom.uiuc.edu/software/cglist/GeomDir/ptloc96.ps.gz > Unfortunately, griddata() uses the unstructured-interpolation-points API rather > than the more efficient grid-interpolation-points API. In the former, each > interpolation point uses the last-found enclosing triangle as the start of the > walking search. This works well where adjacent interpolation points are close to > each other. This is not the case at the ends of the grid rows. The latter API is > smarter and starts a new row of the grid with the triangle from the triangle > from the *start* of the previous row rather than the end. I suspect this is > largely the cause of the poor performance. Good to know, I will try to pass the points in groups of close points. >> Does it use the kd-trees like scipy.spatial? I have >> a very good experience with scipy.spatial performance. >> >> Also, is there a way of reusing the triangulation when interpolating >> several times using the same grid? > > One would construct a Triangulation() object with the (x,y) data points, get a > new NNInterpolator() object using the .nn_interpolator(z) method for each new z > data set, and then interpolate your grid on the NNInterpolator. So if the above fails, I can bypass griddata() by using the delaunay module directly, good. thank you, r.
Hi, Is there a way to interactive with the plot? For example, draw a vertical marker on the plot, let user move the marker and shows x, y values of the point where the curve intersect with the marker? Thanks, J -- View this message in context: http://www.nabble.com/Interactive-with-the-plot%2C-moving-marker%2C-etc-tp24484499p24484499.html Sent from the matplotlib - users mailing list archive at Nabble.com.
On 2009年07月13日 13:20, Robert Cimrman wrote: > Hi all, > > I would like to use griddata() to interpolate a function given at > specified points of a bunch of other points. While the method works > well, it slows down considerably as the number of points to interpolate > to increases. > > The dependence of time/(number of points) is nonlinear (see the > attachment) - it seems that while the Delaunay trinagulation itself is > fast, I wonder how to speed-up the interpolation. The docstring says, > that it is based on "natural neighbor interpolation" - how are the > neighbors searched? Using the Delaunay triangulation. The "natural neighbors" of an interpolation point are those points participating in triangles in the Delaunay triangulation whose circumcircles include the interpolation point. The triangle that encloses the interpolation point is found by a standard walking procedure, then the neighboring triangles (natural or otherwise) are explored in a breadth-first search around the starting triangle to find the natural neighbors. Unfortunately, griddata() uses the unstructured-interpolation-points API rather than the more efficient grid-interpolation-points API. In the former, each interpolation point uses the last-found enclosing triangle as the start of the walking search. This works well where adjacent interpolation points are close to each other. This is not the case at the ends of the grid rows. The latter API is smarter and starts a new row of the grid with the triangle from the triangle from the *start* of the previous row rather than the end. I suspect this is largely the cause of the poor performance. > Does it use the kd-trees like scipy.spatial? I have > a very good experience with scipy.spatial performance. > > Also, is there a way of reusing the triangulation when interpolating > several times using the same grid? One would construct a Triangulation() object with the (x,y) data points, get a new NNInterpolator() object using the .nn_interpolator(z) method for each new z data set, and then interpolate your grid on the NNInterpolator. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco
Question is however, are you using the GTK backend? ie from matplotlib.backends.backend_gtkagg import FigureCanvasGTKAgg as FigureCanvas from matplotlib.backends.backend_gtkagg import NavigationToolbar2GTKAgg as NavigationToolbar backend_gtkagg then imports matplotlib.backends._gtkagg For matplotlib-0.98.5.2.win32-py2.5.exe C:\Python25\Lib\site-packages\matplotlib\backends\_gtkagg.pyd exists For matplotlib-0.98.5.3.win32-py2.6.exe C:\Python26\Lib\site-packages\matplotlib\backends\_gtkagg.pyd doesn't ie gtk backend doesn't seem to be compiled. matplotlib is the only thing holding me back in moving to python26 (on windows). Hopefully the svn build is updated soon or a new release is due soon (I can wait ) >Hi Christoph, > > > >Sorry for my delay to get back to you. > > > >The svn version seems to work fine with GTK support, at least my > >application had no problems running > > > >The versions I tested with are as follows: > > python version: 2.6.0 final 0 > > numpy version: 1.3.0 > matplotlib version: 0.98.6svn > > gtk+ version: 2.16.2 > > pyGTK version: 2.12.1 > > > >Thank you > >you have been a big help > > >Steve > >
Please post a standalone example that reproduces your problem. I tried your example with some junk data but no such exception is raised. However, there has been a report of a similar ordinal value problem which I think is not fixed yet, but that problem only occurs when two and more axes are shared. See if below helps, * move the axhline call after the plotting commands. * autoscale only after all the necessary plot elements are in place. Again, please post a standalone example that reproduces your problem. Regards, -JJ On Tue, Jul 14, 2009 at 9:50 AM, M Osborne<os...@gm...> wrote: > I am trying to plot some historical trend data, where x is a date and > y is a percentage. > > When I try to insert a horizontal line with ax1.axhline(y=80, > linewidth=1, color='r'), matplotlib breaks, with an error " > ValueError: ordinal must be >= 1". > > The Traceback most recent call is, File > "/usr/lib64/python2.4/site-packages/matplotlib/dates.py", line 170, in > _from_ordinalf > dt = datetime.datetime.fromordinal(ix)" > > Without the axhline element, matplotlib handles the data fine, and > plots nice weekly dates. > > I'm guessing based on the error that axhline is manually forcing > autoscale off and/or matplotlib can no longer interpret the date > values for x? > > Below is the matplotlib snippet of my code: > > fig = plt.figure(figsize=(20,10)) > font = { 'fontname':'Tahoma', 'fontsize':12 } > ax1 = fig.add_subplot(211) > ax1.set_ylim(0,100) > ax1.autoscale_view(tight=False, scalex=True, scaley=False) > ax1.grid(True) > ax1.axhline(y=80, linewidth=1, color='r') > ax1.set_ylim(0,100) > ax1.autoscale_view(tight=False, scalex=True, scaley=False) > ax1.plot(timestamp, percentu, 'ko-' ) > ax1.plot(timestamp, percentl, 'b--', linewidth=2) > ax2 = fig.add_subplot(212) > ax2.grid(True) > ax2.plot(predict_x, predict_y, 'bs--', linewidth=2) > plt.savefig("plot.pdf") > > > Thank you in advance! > > ------------------------------------------------------------------------------ > Enter the BlackBerry Developer Challenge > This is your chance to win up to 100,000ドル in prizes! For a limited time, > vendors submitting new applications to BlackBerry App World(TM) will have > the opportunity to enter the BlackBerry Developer Challenge. See full prize > details at: http://p.sf.net/sfu/Challenge > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users >
Not too long ago, I posted an example of this to the list. The code near the bottom of that thread is a little more general than the one at the top and shows, three different ways to cycle through the colors of a colormap. Hope that helps, -Tony On Jul 14, 2009, at 9:51 AM, per freem wrote: > Hi all, > > i would like to set the colors of the lines i plot (using the plot > function) to go from red to blue, in evenly spaced interval. that > is, imagine a color map from red to green, where i plot n-many > lines, each receiving a color from this color map, starting at the > red end and going to green. > > the docs say how to set the color cycle of lines set by plot, using: > > matplotlib.axes.set_default_color_cycle(['r', 'y', 'g', 'b']) > > but this only allows me to use named colors, and here i am looking > to use shades from red to green. > my question is: first, how can i generate N evenly spaced colors > from the red spectrum to the green spectrum? and two, how can i make > it so plot uses these colors for its line plots? > > thanks very much. > ------------------------------------------------------------------------------ > Enter the BlackBerry Developer Challenge > This is your chance to win up to 100,000ドル in prizes! For a limited > time, > vendors submitting new applications to BlackBerry App World(TM) will > have > the opportunity to enter the BlackBerry Developer Challenge. See > full prize > details at: http://p.sf.net/sfu/Challenge_______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Hi all, i would like to set the colors of the lines i plot (using the plot function) to go from red to blue, in evenly spaced interval. that is, imagine a color map from red to green, where i plot n-many lines, each receiving a color from this color map, starting at the red end and going to green. the docs say how to set the color cycle of lines set by plot, using: matplotlib.axes.set_default_color_cycle(['r', 'y', 'g', 'b']) but this only allows me to use named colors, and here i am looking to use shades from red to green. my question is: first, how can i generate N evenly spaced colors from the red spectrum to the green spectrum? and two, how can i make it so plot uses these colors for its line plots? thanks very much.
I am trying to plot some historical trend data, where x is a date and y is a percentage. When I try to insert a horizontal line with ax1.axhline(y=80, linewidth=1, color='r'), matplotlib breaks, with an error " ValueError: ordinal must be >= 1". The Traceback most recent call is, File "/usr/lib64/python2.4/site-packages/matplotlib/dates.py", line 170, in _from_ordinalf dt = datetime.datetime.fromordinal(ix)" Without the axhline element, matplotlib handles the data fine, and plots nice weekly dates. I'm guessing based on the error that axhline is manually forcing autoscale off and/or matplotlib can no longer interpret the date values for x? Below is the matplotlib snippet of my code: fig = plt.figure(figsize=(20,10)) font = { 'fontname':'Tahoma', 'fontsize':12 } ax1 = fig.add_subplot(211) ax1.set_ylim(0,100) ax1.autoscale_view(tight=False, scalex=True, scaley=False) ax1.grid(True) ax1.axhline(y=80, linewidth=1, color='r') ax1.set_ylim(0,100) ax1.autoscale_view(tight=False, scalex=True, scaley=False) ax1.plot(timestamp, percentu, 'ko-' ) ax1.plot(timestamp, percentl, 'b--', linewidth=2) ax2 = fig.add_subplot(212) ax2.grid(True) ax2.plot(predict_x, predict_y, 'bs--', linewidth=2) plt.savefig("plot.pdf") Thank you in advance!