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
(2) |
2
(4) |
3
(9) |
4
(12) |
5
(12) |
6
(7) |
7
(8) |
8
(4) |
9
(2) |
10
(9) |
11
(6) |
12
(1) |
13
(20) |
14
(13) |
15
(9) |
16
(3) |
17
(12) |
18
(16) |
19
(14) |
20
(12) |
21
(15) |
22
(11) |
23
(5) |
24
(7) |
25
(7) |
26
(8) |
27
(11) |
28
(10) |
29
(1) |
30
(3) |
31
(6) |
|
|
|
|
|
From: Benjamin R. <ben...@ou...> - 2011-10-31 22:08:34
|
On Monday, October 31, 2011, Katie Boyle <kat...@gm...> wrote: > Hi All, > I was wondering how to set custom tick labels in an mplot3D plot? I have tried: > ax = Axes3D(figure) > ax.set_xticks(ticks,labels) > - and - > ax = Axes3D(figure) > ax.w_xaxis.set_ticks(ticks,labels) > and both options cause the plot to disappear from the viewing window. > When I don't try to set ticks, the window shows up fine except for the fact that it displays the axis values -120.1, -120.5, -120.7 as -0.1, -0.5, -0.7, which isn't going to work for me. I need a way to force the plot to display the values exactly as they are written. > Many thanks in advance, > Katie Which version of mpl are you using? Note that there have been *huge* advances in usability for the recently released v1.1.0. Many of the same functions you would normally use in regular plots are now available for mplot3d, and the need to use w_xaxis and such is going away. Ben Root |
From: Atma K. <aka...@mi...> - 2011-10-31 22:03:15
|
Hi All, I am new to matplotlib and glade and am struggling with changing cursors in a glade-3 based python application using matplotlib. I have attached the simple application plot_in_Glade.py and plot_in_Glade.glade. I am trying to change the cursor on the plot but unfortunately no luck (gives no error though). (line 31 in plot_in_Glade.py) I have attached a simpleTest.py in which I am able to change the cursor (pretty much the same code for plotting except no glade for UI) Version: glade 3.6.7 python 2.6.6 on RHEL6 I know this is not the correct forum to ask about glade issues but on a different note I am not sure if any of you have encountered the problem of dialog boxes being modal even though they are set for being non-modal. In my attached application I have made the 1st dialog box non-modal (which is being called by testMain) and the plot dialog box as non-modal but in both cases I cannot access the parent dialog box once the child is spawned ! Any ideas ? Looking forward to hearing from you. Regards Atma |
From: Katie B. <kat...@gm...> - 2011-10-31 21:37:14
|
Hi All, I was wondering how to set custom tick labels in an mplot3D plot? I have tried: ax = Axes3D(figure) ax.set_xticks(ticks,labels) - and - ax = Axes3D(figure) ax.w_xaxis.set_ticks(ticks,labels) and both options cause the plot to disappear from the viewing window. When I don't try to set ticks, the window shows up fine except for the fact that it displays the axis values -120.1, -120.5, -120.7 as -0.1, -0.5, -0.7, which isn't going to work for me. I need a way to force the plot to display the values exactly as they are written. Many thanks in advance, Katie |
From: Daniel H. <dh...@gm...> - 2011-10-31 16:12:40
|
Try nm = matplotlib.colors.Normalize(desired_min, desired_max) plt.scatter(x1,y1,c=myarr1,cmap=plt.get_cmap("gist_heat"),norm=nm) You could just use the vmin/vmax keywords in the scatter() call, but I've just always preferred using Normalize(); you have more control over what happens that way (see docs for Normalize). ref: http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.scatter On Mon, Oct 31, 2011 at 12:02 PM, Tommy Grav <tg...@ma...> wrote: > Hi, > > I have been looking around but can't find what I want. > I have two arrays, one with numbers from 0.02 to 0.20 and > the other from 0.03 to 0.50. I am trying to plot them together > with other arrays in a scatterplot where these two are the > color term > > plt.scatter(x1,y1,c=myarr1,cmap=plt.get_cmap("gist_heat)) > plt.scatter(x2,y2,c=myarr2,cmap=plt.get_cmap("gist_heat)) > > but it seems that each instance of the plot command rescales > the array such that myarr1.max() and myarr2.max() are both with, > which means that the two color scales are out of sync. Is there > a way to force the two plots to respect the values in the array > have the cmap go from 0 to 1, not from myarr1.min() to myarr1.max()? > > Cheers > Tommy > > ------------------------------------------------------------------------------ > Get your Android app more play: Bring it to the BlackBerry PlayBook > in minutes. BlackBerry App World™ now supports Android™ Apps > for the BlackBerry® PlayBook™. Discover just how easy and simple > it is! http://p.sf.net/sfu/android-dev2dev > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > -- Daniel Hyams dh...@gm... |
From: Benjamin R. <ben...@ou...> - 2011-10-31 16:10:28
|
On Mon, Oct 31, 2011 at 11:02 AM, Tommy Grav <tg...@ma...> wrote: > Hi, > > I have been looking around but can't find what I want. > I have two arrays, one with numbers from 0.02 to 0.20 and > the other from 0.03 to 0.50. I am trying to plot them together > with other arrays in a scatterplot where these two are the > color term > > plt.scatter(x1,y1,c=myarr1,cmap=plt.get_cmap("gist_heat)) > plt.scatter(x2,y2,c=myarr2,cmap=plt.get_cmap("gist_heat)) > > but it seems that each instance of the plot command rescales > the array such that myarr1.max() and myarr2.max() are both with, > which means that the two color scales are out of sync. Is there > a way to force the two plots to respect the values in the array > have the cmap go from 0 to 1, not from myarr1.min() to myarr1.max()? > > Cheers > Tommy > > Tommy, The general method is to use a Normalize object and pass it as kwarg 'norm'. However, as a convenience, some plotting functions has a 'vmin' and 'vmax' kwarg that can be specified: plt.scatter(x1,y1,c=myarr1,cmap=plt.get_cmap("gist_heat), vmin=0.0, vmax=1.0) plt.scatter(x2,y2,c=myarr2,cmap=plt.get_cmap("gist_heat), vmin=0.0, vmax=1.0) Cheers! Ben Root |
From: Tommy G. <tg...@ma...> - 2011-10-31 16:02:12
|
Hi, I have been looking around but can't find what I want. I have two arrays, one with numbers from 0.02 to 0.20 and the other from 0.03 to 0.50. I am trying to plot them together with other arrays in a scatterplot where these two are the color term plt.scatter(x1,y1,c=myarr1,cmap=plt.get_cmap("gist_heat)) plt.scatter(x2,y2,c=myarr2,cmap=plt.get_cmap("gist_heat)) but it seems that each instance of the plot command rescales the array such that myarr1.max() and myarr2.max() are both with, which means that the two color scales are out of sync. Is there a way to force the two plots to respect the values in the array have the cmap go from 0 to 1, not from myarr1.min() to myarr1.max()? Cheers Tommy |
From: John H. <jd...@gm...> - 2011-10-30 16:07:10
|
.draw() On Sun, Oct 30, 2011 at 10:51 AM, Daniel Welling <dan...@gm...> wrote: > Greetings, MatPlotLibbers. > > Since 1.1, pyplot.draw() in interactive mode only updates the current axis. > If I want to update many axes, I need to use sca() and draw() for each one. > Is there a way to update all axes? I'm not seeing this, and I'm not sure *why* it would be occurring for you. plt.draw triggers a call to fig.canvas.draw which calls draw on all axes. Here is some example code in ipython, which has 'ion". In [2]: fig, axes = plt.subplots(2) In [3]: axes[0].plot([1,2,3]) Out[3]: [<matplotlib.lines.Line2D at 0x4b90550>] In [4]: axes[1].plot([1,2,3]) Out[4]: [<matplotlib.lines.Line2D at 0x4b90610>] In [5]: plt.draw() The call to 'plt.draw' on line 5 triggers a draw to both axes. Can you provide an example which exposes your problem? Please also provide backend and OS information In [6]: !uname -a Linux pinchiepie 3.0.0-12-generic #20-Ubuntu SMP Fri Oct 7 14:56:25 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux In [7]: import matplotlib; print matplotlib.__version__ 1.2.x In [8]: matplotlib.rcParams['backend'] Out[8]: 'WXAgg' JDH |
From: Daniel W. <dan...@gm...> - 2011-10-30 15:51:24
|
Greetings, MatPlotLibbers. Since 1.1, pyplot.draw() in interactive mode only updates the current axis. If I want to update many axes, I need to use sca() and draw() for each one. Is there a way to update all axes? Thanks. -dw |
From: Brendan B. <bre...@br...> - 2011-10-30 05:25:03
|
I encountered a strange error when trying to put some annotations on a graph. I was able to simplify it to this: pyplot.plot([1, 2, 3, 4], [0, -1, -2, 8]) pyplot.annotate("Blah", xy=(2, 2), xytext=(-20,-20), textcoords='offset points', bbox=dict(boxstyle='round,pad=0.5'), arrowprops=dict(arrowstyle='fancy', connectionstyle='arc3,rad=0')) On my system (matplotlib 1.1.0 with Python 2.6 on Windows XP), this causes a long traceback culminating in File "C:\Program Files\Python\lib\site-packages\matplotlib\bezier.py", line 129, in find_bezier_t_intersecting_with_closedpath raise ValueError("the segment does not seemed to intersect with the path") Increasing the xytext coordinates (in absolute value), to for instance (-50, -50) works with no error, and it also works without the special bbox style. Just guessing from the error message, it looks like certain combinations of fancy patches are causing problems because the shapes don't intersect in the way the drawing code assumes they should. I don't see anything in the docs about such edge cases, so this looks like a bug. Judging from the way that small tweaks to the code can cause the error to disappear, I imagine it could be tricky to fix, but at the least there should probably be a warning in the docs that some kinds of anootation boxes won't work with some kinds of arrows when the text is too close to the annotated point. Any ideas? Thanks. -- Brendan Barnwell "Do not follow where the path may lead. Go, instead, where there is no path, and leave a trail." --author unknown |
From: Jamie N. <nie...@gm...> - 2011-10-29 22:47:10
|
Thanks Michael and Benjamin — this answers all my questions. On Wednesday, October 26, 2011 at 11:11 AM, Michael Droettboom wrote: > On 10/26/2011 02:40 AM, Benjamin Root wrote: > > > > > > On Tuesday, October 25, 2011, jniemasik <nie...@gm... (mailto:nie...@gm...)> wrote: > > > > > > Hi all, > > > > > > Google App Engine recently added an experimental Python 2.7 option, and > > > along with it, support for numpy. > > > > > > App Engine only allows pure python code to be uploaded. But now that numpy > > > is available on the server, I was hoping I could create a pure python build > > > of matplotlib that I can run on App Engine. > > > > > > Any suggestions on how to do this (existing tutorial, or at least which > > > backend to use, etc.)? Is it possible? > > > > > > Many thanks, > > > Jamie > > > > One thing I just noticed is that PIL is available.in (http://available.in) the app engine I wonder if a PIL based backend might be suitable for replacing the compiled _png.so used for writing png images and maybe some other formats in the app engine? > With the pure Python backends (PS, PDF, SVG) you should be able to do most things, except actually rasterize an image... but since it's a webapp anyway, SVG should suffice and have it rendered in the client. Of course there are still pieces that would need to be rewritten in Python -- contouring, path simplification, geometry functions, font handling. I don't know if the PIL FontImage support would suffice as a replacement for the freetype wrapper we currently have -- otherwise reimplementing freetype in Python (even to just get the font metrics) is probably considerable work. > > In other words, it's possible, but not as it stands without rewriting a lot of C++ code in Python. > > Mike > ------------------------------------------------------------------------------ > The demand for IT networking professionals continues to grow, and the > demand for specialized networking skills is growing even more rapidly. > Take a complimentary Learning@Cisco Self-Assessment and learn > about Cisco certifications, training, and career opportunities. > http://p.sf.net/sfu/cisco-dev2dev > > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... (mailto:Mat...@li...) > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > |
From: Jarrod M. <mi...@be...> - 2011-10-28 17:43:42
|
========================== SciPy 2011 Call for Papers ========================== The third `SciPy India Conference <http://scipy.in>`_ will be held from December 4th through the 7th at the `Indian Institute of Technology, Bombay (IITB) <http://www.iitb.ac.in/>`_ in Mumbai, Maharashtra India. At this conference, novel applications and breakthroughs made in the pursuit of science using Python are presented. Attended by leading figures from both academia and industry, it is an excellent opportunity to experience the cutting edge of scientific software development. The conference is followed by two days of tutorials and a code sprint, during which community experts provide training on several scientific Python packages. We invite you to take part by submitting a talk abstract on the conference website at: http://scipy.in Talk/Paper Submission ========================== We solicit talks and accompanying papers (either formal academic or magazine-style articles) that discuss topics regarding scientific computing using Python, including applications, teaching, development and research. We welcome contributions from academia as well as industry. Important Dates ========================== November 2, 2011, Wednesday: Abstracts Due November 7, 2011, Monday: Schedule announced November 28, 2011, Monday: Proceedings paper submission due December 4-5, 2011, Sunday-Monday: Conference December 6-7 2011, Tuesday-Wednesday: Tutorials/Sprints Organizers ========================== * Jarrod Millman, Neuroscience Institute, UC Berkeley, USA (Conference Co-Chair) * Prabhu Ramachandran, Department of Aerospace Engineering, IIT Bombay, India (Conference Co-Chair) * FOSSEE Team |
From: Sterling S. <sm...@fu...> - 2011-10-28 17:14:29
|
> From: John Hunter <jd...@gm...> > Date: October 28, 2011 5:54:36 AM PDT > To: Adam Mercer <ram...@gm...> > Cc: mat...@li... > Subject: Re: [Matplotlib-users] Legend and proxy artists > > > On Thu, Oct 27, 2011 at 8:12 AM, Adam Mercer <ram...@gm...> wrote: >> value_plot = [] >> for v in value: >> value_plot.append(value_axes.plot_date(w[:,0], w[:,1], 'ro-', ms=4)) >> >> # legend >> date_axes.legend(([morning_plot], [evening_plot], [value_plot]), >> ("Morning", "Evening", "Value"), >> numpoints=1, loc=0, borderpad=1, shadow=True, fancybox=True) >> >> # save plot >> fig.savefig(plot_file) > > Your problem is that value_plot is a list of lists, and not a list of > lines. ax.plot_date returns a list of lines, so you need to do > > value_plot.extend(value_axes.plot_date(w[:,0], w[:,1], 'ro-', ms=4)) This by itself does not solve the problem. The call to legend needs a list of handles (artists) and a list of labels. If using the line JDH suggested, try date_axes.legend((morning_plot[0], evening_plot[0], value_plot[0]), ("Morning", "Evening", "Value"), numpoints=1, loc=0, borderpad=1, shadow=True, fancybox=True) With the code as it is try date_axes.legend((morning_plot[0], evening_plot[0], value_plot[0][0]), ("Morning", "Evening", "Value"), numpoints=1, loc=0, borderpad=1, shadow=True, fancybox=True) If neither works, then you might need to provide more information. -Sterling |
From: Benjamin R. <ben...@ou...> - 2011-10-28 17:00:08
|
On Fri, Oct 28, 2011 at 11:47 AM, Gousios George <gg...@wi...>wrote: > Hello , i wanted to ask how can i do what i am saying in title. > > I have a plot with some points and i have a circle. > I want to combine both data in one plot.(a circle and point data) > > I can't do it because ( i think) for the circle i use pylab.show() but > for plot ,just show(). > Is there another way to make the circle? > > > from scitools.std import * > > import pylab > > > > > > npoints=10 > > > > vectorpoint=random.uniform(-1,1,[1,2]) > > experiment=random.uniform(-1,1,[npoints,2]) > > > > #plot(experiment[:,0],experiment[:,1],'ro') > > #show() > > > > plot(experiment[:,0],experiment[:,1],'ro') > > hold('on') > > circ = pylab.Circle((0., 0.), 1.0,alpha=0.1) > > pylab.gca().add_patch(circ) > > pylab.axis('scaled') > > pylab.show() > > Thanks! > > try this: pylab.plot(experiment[:, 0], experiment[:, 1], 'ro') circ = pylab.Circle((0., 0.), 1.0, alpha=0.1) pylab.gca().add_patch(circ) pylab.axis('scaled') pylab.show() Cheers! Ben Root > > > ------------------------------------------------------------------------------ > The demand for IT networking professionals continues to grow, and the > demand for specialized networking skills is growing even more rapidly. > Take a complimentary Learning@Cisco Self-Assessment and learn > about Cisco certifications, training, and career opportunities. > http://p.sf.net/sfu/cisco-dev2dev > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
From: Gousios G. <gg...@wi...> - 2011-10-28 16:48:07
|
Hello , i wanted to ask how can i do what i am saying in title. I have a plot with some points and i have a circle. I want to combine both data in one plot.(a circle and point data) I can't do it because ( i think) for the circle i use pylab.show() but for plot ,just show(). Is there another way to make the circle? > from scitools.std import * > import pylab > > > npoints=10 > > vectorpoint=random.uniform(-1,1,[1,2]) > experiment=random.uniform(-1,1,[npoints,2]) > > #plot(experiment[:,0],experiment[:,1],'ro') > #show() > > plot(experiment[:,0],experiment[:,1],'ro') > hold('on') > circ = pylab.Circle((0., 0.), 1.0,alpha=0.1) > pylab.gca().add_patch(circ) > pylab.axis('scaled') > pylab.show() Thanks! |
From: Justin M. <jn...@gm...> - 2011-10-28 13:48:04
|
On Fri, Oct 28, 2011 at 6:31 AM, Paul Hilscher <pph...@gm...> wrote: > Dear all, > first of all thank you for the this awesome plotting library :D. > I have a logarithmic plot where I want to stress out a specific range using > a line like > y Something > | |-------------------| > | ___________ > | / \ > | / \ > |/ > |---------------------------> > x > I looked up the documentation but could find a proper arrow style or > similar. > Does anybody know how to do this the proper way ? > I did that "manualy" using 3 plot commands and text() , but I guess there > should be some nicer way ?? You can create the arrow with a = mpl.patches.FancyArrowPatch(posA=(4,4), posB=(7,4), arrowstyle="|-|") ax.add_patch(a) or ax.annotate("", xy=(4,4), xytext=(7,4), arrowprops=dict(arrowstyle='|-|')) and then adding your label manually with text(), like you said. There may be some way to do it all in the annotate command (by shifting the arrow away from the label somehow), but by default the annotate() command draws an arrow from point xytext to xy (the point you're labeling). Justin |
From: John H. <jd...@gm...> - 2011-10-28 12:55:09
|
On Thu, Oct 27, 2011 at 8:12 AM, Adam Mercer <ram...@gm...> wrote: > Hi > > I have recently updated to Matplotlib-1.1.0 and now one of my scripts > displays the following warning: > > UserWarning: Legend does not support [[<matplotlib.lines.Line2D object > at 0x1026296d0>]] > Use proxy artist instead. > > http://matplotlib.sourceforge.net/users/legend_guide.html#using-proxy-artist > > The link it refers to doesn't seem to be much help, and I can't see > what I need to do in order to correctly display the legend. Below is > the appropriate plotting section of my script, could anyone offer > suggestions as to how to correctly display the legend? > > # plot size, scale by golden ratio > fig = pyplot.figure() > fig.set_size_inches(10, 10 / ((1 + math.sqrt(5)) / 2)) > date_axes = fig.add_subplot(111) > > # setup secondary axes > value_axes = date_axes.twinx() > > # set plot labels > date_axes.set_xlabel("Date") > date_axes.set_ylabel("Time") > value_axes.set_ylabel("Value") > > # produce plot > morning_plot = date_axes.plot_date(morning[:,0], morning[:,1], 'bo-', ms=4) > evening_plot = date_axes.plot_date(evening[:,0], evening[:,1], 'go-', ms=4) > value_plot = [] > for v in value: > value_plot.append(value_axes.plot_date(w[:,0], w[:,1], 'ro-', ms=4)) > > # legend > date_axes.legend(([morning_plot], [evening_plot], [value_plot]), > ("Morning", "Evening", "Value"), > numpoints=1, loc=0, borderpad=1, shadow=True, fancybox=True) > > # save plot > fig.savefig(plot_file) Your problem is that value_plot is a list of lists, and not a list of lines. ax.plot_date returns a list of lines, so you need to do value_plot.extend(value_axes.plot_date(w[:,0], w[:,1], 'ro-', ms=4)) rather than calling "append". The legend method expects a list of matplotlib artists, not a list of lists. JDH |
From: Paul H. <pph...@gm...> - 2011-10-28 10:31:17
|
Dear all, first of all thank you for the this awesome plotting library :D. I have a logarithmic plot where I want to stress out a specific range using a line like y Something | |-------------------| | ___________ | / \ | / \ |/ |---------------------------> x I looked up the documentation but could find a proper arrow style or similar. Does anybody know how to do this the proper way ? I did that "manualy" using 3 plot commands and text() , but I guess there should be some nicer way ?? Thanks a lot for help and best wishes, Paul Hilscher |
From: Adam M. <ram...@gm...> - 2011-10-28 06:22:59
|
On Fri, Oct 28, 2011 at 00:56, Sterling Smith <sm...@fu...> wrote: > Here is a working example: > > from pylab import figure, arange > fig = figure(1) > fig.clear() > ax = fig.add_subplot(111) > x = arange(0,1,.25) > y1 = x > y2 = x**2 > y3 = x**3 > l1 = ax.plot(x,y1,'bo-') > l2 = ax.plot(x,y2,'go-') > l3 = [] > for xi,x1 in enumerate(x): > l3.append(ax.plot(x1,y3[xi],'ro-')) > print l1,l2,l3 > leg = ax.legend((l1[0],l2[0],l3[0][0]),('$x$','$x^2$','$x^3$'), > numpoints=1, loc=0, borderpad=1, shadow=True, fancybox=True) OK, you're example works but trying to modify my code is resulting in the same errors. But it's late so that's a job for tomorrow... > Note that when l1 and l2 are printed that they are 1-element lists, and l3 is a list of 1-element lists, all of which are not the type of handles that legend is looking for. Furthermore, in your code, you are trying to embed these lists in yet another layer of list. Thanks, this is starting to make sense... > If your code worked as it was with previous versions of matplotlib, then maybe someone with more knowledge could explain what changed to not allow your code to work now (it may be related to https://github.com/matplotlib/matplotlib/pull/534). It worked without issue with matplotlib-1.0.1. Cheers Adam |
From: Sterling S. <sm...@fu...> - 2011-10-28 05:56:31
|
Adam, I'm sorry that I wasn't clear before. Here is a working example: from pylab import figure, arange fig = figure(1) fig.clear() ax = fig.add_subplot(111) x = arange(0,1,.25) y1 = x y2 = x**2 y3 = x**3 l1 = ax.plot(x,y1,'bo-') l2 = ax.plot(x,y2,'go-') l3 = [] for xi,x1 in enumerate(x): l3.append(ax.plot(x1,y3[xi],'ro-')) print l1,l2,l3 leg = ax.legend((l1[0],l2[0],l3[0][0]),('$x$','$x^2$','$x^3$'), numpoints=1, loc=0, borderpad=1, shadow=True, fancybox=True) Note that when l1 and l2 are printed that they are 1-element lists, and l3 is a list of 1-element lists, all of which are not the type of handles that legend is looking for. Furthermore, in your code, you are trying to embed these lists in yet another layer of list. If your code worked as it was with previous versions of matplotlib, then maybe someone with more knowledge could explain what changed to not allow your code to work now (it may be related to https://github.com/matplotlib/matplotlib/pull/534). -Sterling On Oct 27, 2011, at 8:32PM, Adam Mercer wrote: > On Thu, Oct 27, 2011 at 12:05, Sterling Smith <sm...@fu...> wrote: > >> Your example is not complete. I don't understand the value variable that you are iterating over, or how it affects the different plots you are making. > > value is simply a list of different datasets to plot, read in using: > > value = [] > for v_file in glob.glob(value_glob): > value.append(numpy.atleast_2d(numpy.loadtxt(v_file, converters={0: > dates.datestr2num}))) > > where value_glob specifies a glob pattern of files to read in. > >> I would guess that the problem is that you have a list of tuples of handles for value_plot, instead of a list of handles. Note that each of the plot_date commands returns a length=1 tuple of lines. So you should pick out the first item of each tuple, and you probably only need the 1st item of the value_plot list, since you only give 3 labels. > > I'm not really following you, do you mean something like the following: > > # legend > date_axes.legend(([morning_plot], [evening_plot], [value_plot[0]]), > ("Morning", "Evening", "Value"), > numpoints=1, loc=0, borderpad=1, shadow=True, fancybox=True) > > as that results in the same errors? > > Cheers > > Adam |
From: Adam M. <ram...@gm...> - 2011-10-28 03:33:32
|
On Thu, Oct 27, 2011 at 12:05, Sterling Smith <sm...@fu...> wrote: > Your example is not complete. I don't understand the value variable that you are iterating over, or how it affects the different plots you are making. value is simply a list of different datasets to plot, read in using: value = [] for v_file in glob.glob(value_glob): value.append(numpy.atleast_2d(numpy.loadtxt(v_file, converters={0: dates.datestr2num}))) where value_glob specifies a glob pattern of files to read in. > I would guess that the problem is that you have a list of tuples of handles for value_plot, instead of a list of handles. Note that each of the plot_date commands returns a length=1 tuple of lines. So you should pick out the first item of each tuple, and you probably only need the 1st item of the value_plot list, since you only give 3 labels. I'm not really following you, do you mean something like the following: # legend date_axes.legend(([morning_plot], [evening_plot], [value_plot[0]]), ("Morning", "Evening", "Value"), numpoints=1, loc=0, borderpad=1, shadow=True, fancybox=True) as that results in the same errors? Cheers Adam |
From: mogliii <mo...@gm...> - 2011-10-27 17:27:09
|
<html> <head> <meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type"> </head> <body bgcolor="#FFFFFF" text="#000000"> Thanks, that fixed it. Both for the example (see attachment) and for my own document.<br> <br> So this branch resolved the issue.<br> <br> Moglliii<br> <br> On 27/10/2011 17:53, Michael Droettboom wrote: <blockquote cite="mid:4EA...@st..." type="cite"> <meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type"> It looks like the polygons that make up the arrows were not being closed correctly, so the PDF renderer was not joining the ends of the stroke.<br> <br> Can you confirm that this branch resolves your issue?<br> <br> <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> <a moz-do-not-send="true" href="https://github.com/matplotlib/matplotlib/pull/559">https://github.com/matplotlib/matplotlib/pull/559</a><br> <br> Mike<br> <br> On 10/27/2011 11:36 AM, mogliii wrote: <blockquote cite="mid:4EA...@gm..." type="cite"> <pre wrap="">This is the code <a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://matplotlib.sourceforge.net/mpl_examples/pylab_examples/arrow_demo.py">http://matplotlib.sourceforge.net/mpl_examples/pylab_examples/arrow_demo.py</a> Its this example from the gallery page <a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://matplotlib.sourceforge.net/examples/pylab_examples/arrow_demo.html">http://matplotlib.sourceforge.net/examples/pylab_examples/arrow_demo.html</a> Basically I see the same artifacts in my own plots, using the following command: ax1.arrow(9.5,15,0,-9.6,head_width=0.45,head_length=3,fc='k', length_includes_head=True) On 27/10/2011 15:56, Daniel Hyams wrote: </pre> <blockquote type="cite"> <pre wrap="">I think that the code that generated the screenshot needs to be posted; otherwise no one knows what is being attempted.... On Thu, Oct 27, 2011 at 10:50 AM, mogliii <a moz-do-not-send="true" class="moz-txt-link-rfc2396E" href="mailto:mo...@gm..."><mo...@gm...></a> wrote: </pre> <blockquote type="cite"> <pre wrap="">Hi, I am trying to place some arrows using <a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://matplotlib.sourceforge.net/api/axes_api.html?highlight=arrow#matplotlib.axes.Axes.arrow">http://matplotlib.sourceforge.net/api/axes_api.html?highlight=arrow#matplotlib.axes.Axes.arrow</a> And unfortunately the arrows are not nice (see attached screenshot). How can the line end be changed to "round" as, for example, with plot. Or anyone can give a solution? For very small print this might be acceptable, but not if the arrow/linewidth is larger. ------------------------------------------------------------------------------ The demand for IT networking professionals continues to grow, and the demand for specialized networking skills is growing even more rapidly. Take a complimentary Learning@Cisco Self-Assessment and learn about Cisco certifications, training, and career opportunities. <a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://p.sf.net/sfu/cisco-dev2dev">http://p.sf.net/sfu/cisco-dev2dev</a> _______________________________________________ Matplotlib-users mailing list <a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:Mat...@li...">Mat...@li...</a> <a moz-do-not-send="true" class="moz-txt-link-freetext" href="https://lists.sourceforge.net/lists/listinfo/matplotlib-users">https://lists.sourceforge.net/lists/listinfo/matplotlib-users</a> </pre> </blockquote> <pre wrap=""> </pre> </blockquote> <pre wrap=""> ------------------------------------------------------------------------------ The demand for IT networking professionals continues to grow, and the demand for specialized networking skills is growing even more rapidly. Take a complimentary Learning@Cisco Self-Assessment and learn about Cisco certifications, training, and career opportunities. <a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://p.sf.net/sfu/cisco-dev2dev">http://p.sf.net/sfu/cisco-dev2dev</a> _______________________________________________ Matplotlib-users mailing list <a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:Mat...@li...">Mat...@li...</a> <a moz-do-not-send="true" class="moz-txt-link-freetext" href="https://lists.sourceforge.net/lists/listinfo/matplotlib-users">https://lists.sourceforge.net/lists/listinfo/matplotlib-users</a> </pre> </blockquote> <br> <br> <fieldset class="mimeAttachmentHeader"></fieldset> <br> <pre wrap="">------------------------------------------------------------------------------ The demand for IT networking professionals continues to grow, and the demand for specialized networking skills is growing even more rapidly. Take a complimentary Learning@Cisco Self-Assessment and learn about Cisco certifications, training, and career opportunities. <a class="moz-txt-link-freetext" href="http://p.sf.net/sfu/cisco-dev2dev">http://p.sf.net/sfu/cisco-dev2dev</a></pre> <br> <fieldset class="mimeAttachmentHeader"></fieldset> <br> <pre wrap="">_______________________________________________ Matplotlib-users mailing list <a class="moz-txt-link-abbreviated" href="mailto:Mat...@li...">Mat...@li...</a> <a class="moz-txt-link-freetext" href="https://lists.sourceforge.net/lists/listinfo/matplotlib-users">https://lists.sourceforge.net/lists/listinfo/matplotlib-users</a> </pre> </blockquote> <br> </body> </html> |
From: Sterling S. <sm...@fu...> - 2011-10-27 17:05:27
|
Adam, Your example is not complete. I don't understand the value variable that you are iterating over, or how it affects the different plots you are making. I would guess that the problem is that you have a list of tuples of handles for value_plot, instead of a list of handles. Note that each of the plot_date commands returns a length=1 tuple of lines. So you should pick out the first item of each tuple, and you probably only need the 1st item of the value_plot list, since you only give 3 labels. -Sterling PS Sorry if somebody already responded; I get my list mail in digests. > > > From: Adam Mercer <ram...@gm...> > Date: October 27, 2011 6:12:50 AM PDT > To: mat...@li... > Subject: [Matplotlib-users] Legend and proxy artists > > > Hi > > I have recently updated to Matplotlib-1.1.0 and now one of my scripts > displays the following warning: > > UserWarning: Legend does not support [[<matplotlib.lines.Line2D object > at 0x1026296d0>]] > Use proxy artist instead. > > http://matplotlib.sourceforge.net/users/legend_guide.html#using-proxy-artist > > The link it refers to doesn't seem to be much help, and I can't see > what I need to do in order to correctly display the legend. Below is > the appropriate plotting section of my script, could anyone offer > suggestions as to how to correctly display the legend? > > # plot size, scale by golden ratio > fig = pyplot.figure() > fig.set_size_inches(10, 10 / ((1 + math.sqrt(5)) / 2)) > date_axes = fig.add_subplot(111) > > # setup secondary axes > value_axes = date_axes.twinx() > > # set plot labels > date_axes.set_xlabel("Date") > date_axes.set_ylabel("Time") > value_axes.set_ylabel("Value") > > # produce plot > morning_plot = date_axes.plot_date(morning[:,0], morning[:,1], 'bo-', ms=4) > evening_plot = date_axes.plot_date(evening[:,0], evening[:,1], 'go-', ms=4) > value_plot = [] > for v in value: > value_plot.append(value_axes.plot_date(w[:,0], w[:,1], 'ro-', ms=4)) > > # legend > date_axes.legend(([morning_plot], [evening_plot], [value_plot]), > ("Morning", "Evening", "Value"), > numpoints=1, loc=0, borderpad=1, shadow=True, fancybox=True) > > # save plot > fig.savefig(plot_file) > > Cheers > > Adam > |
From: Michael D. <md...@st...> - 2011-10-27 16:53:08
|
It looks like the polygons that make up the arrows were not being closed correctly, so the PDF renderer was not joining the ends of the stroke. Can you confirm that this branch resolves your issue? https://github.com/matplotlib/matplotlib/pull/559 Mike On 10/27/2011 11:36 AM, mogliii wrote: > This is the code > http://matplotlib.sourceforge.net/mpl_examples/pylab_examples/arrow_demo.py > > Its this example from the gallery page > http://matplotlib.sourceforge.net/examples/pylab_examples/arrow_demo.html > > Basically I see the same artifacts in my own plots, using the following > command: > ax1.arrow(9.5,15,0,-9.6,head_width=0.45,head_length=3,fc='k', length_includes_head=True) > > > > On 27/10/2011 15:56, Daniel Hyams wrote: >> I think that the code that generated the screenshot needs to be >> posted; otherwise no one knows what is being attempted.... >> >> On Thu, Oct 27, 2011 at 10:50 AM, mogliii<mo...@gm...> wrote: >>> Hi, >>> >>> I am trying to place some arrows using >>> http://matplotlib.sourceforge.net/api/axes_api.html?highlight=arrow#matplotlib.axes.Axes.arrow >>> >>> And unfortunately the arrows are not nice (see attached screenshot). How >>> can the line end be changed to "round" as, for example, with plot. Or >>> anyone can give a solution? >>> >>> For very small print this might be acceptable, but not if the >>> arrow/linewidth is larger. >>> >>> >>> ------------------------------------------------------------------------------ >>> The demand for IT networking professionals continues to grow, and the >>> demand for specialized networking skills is growing even more rapidly. >>> Take a complimentary Learning@Cisco Self-Assessment and learn >>> about Cisco certifications, training, and career opportunities. >>> http://p.sf.net/sfu/cisco-dev2dev >>> _______________________________________________ >>> Matplotlib-users mailing list >>> Mat...@li... >>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >>> >>> >> > > ------------------------------------------------------------------------------ > The demand for IT networking professionals continues to grow, and the > demand for specialized networking skills is growing even more rapidly. > Take a complimentary Learning@Cisco Self-Assessment and learn > about Cisco certifications, training, and career opportunities. > http://p.sf.net/sfu/cisco-dev2dev > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
From: mogliii <mo...@gm...> - 2011-10-27 15:36:57
|
This is the code http://matplotlib.sourceforge.net/mpl_examples/pylab_examples/arrow_demo.py Its this example from the gallery page http://matplotlib.sourceforge.net/examples/pylab_examples/arrow_demo.html Basically I see the same artifacts in my own plots, using the following command: ax1.arrow(9.5,15,0,-9.6,head_width=0.45,head_length=3,fc='k', length_includes_head=True) On 27/10/2011 15:56, Daniel Hyams wrote: > I think that the code that generated the screenshot needs to be > posted; otherwise no one knows what is being attempted.... > > On Thu, Oct 27, 2011 at 10:50 AM, mogliii <mo...@gm...> wrote: >> Hi, >> >> I am trying to place some arrows using >> http://matplotlib.sourceforge.net/api/axes_api.html?highlight=arrow#matplotlib.axes.Axes.arrow >> >> And unfortunately the arrows are not nice (see attached screenshot). How >> can the line end be changed to "round" as, for example, with plot. Or >> anyone can give a solution? >> >> For very small print this might be acceptable, but not if the >> arrow/linewidth is larger. >> >> >> ------------------------------------------------------------------------------ >> The demand for IT networking professionals continues to grow, and the >> demand for specialized networking skills is growing even more rapidly. >> Take a complimentary Learning@Cisco Self-Assessment and learn >> about Cisco certifications, training, and career opportunities. >> http://p.sf.net/sfu/cisco-dev2dev >> _______________________________________________ >> Matplotlib-users mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> >> > > |
From: Daniel H. <dh...@gm...> - 2011-10-27 14:56:41
|
I think that the code that generated the screenshot needs to be posted; otherwise no one knows what is being attempted.... On Thu, Oct 27, 2011 at 10:50 AM, mogliii <mo...@gm...> wrote: > Hi, > > I am trying to place some arrows using > http://matplotlib.sourceforge.net/api/axes_api.html?highlight=arrow#matplotlib.axes.Axes.arrow > > And unfortunately the arrows are not nice (see attached screenshot). How > can the line end be changed to "round" as, for example, with plot. Or > anyone can give a solution? > > For very small print this might be acceptable, but not if the > arrow/linewidth is larger. > > > ------------------------------------------------------------------------------ > The demand for IT networking professionals continues to grow, and the > demand for specialized networking skills is growing even more rapidly. > Take a complimentary Learning@Cisco Self-Assessment and learn > about Cisco certifications, training, and career opportunities. > http://p.sf.net/sfu/cisco-dev2dev > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > -- Daniel Hyams dh...@gm... |