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
(20) |
2
(21) |
3
(21) |
4
(14) |
5
(8) |
6
(12) |
7
(16) |
8
(27) |
9
(39) |
10
(19) |
11
(12) |
12
(3) |
13
(3) |
14
(18) |
15
(14) |
16
(6) |
17
(7) |
18
(19) |
19
(5) |
20
(8) |
21
(24) |
22
(42) |
23
(12) |
24
(11) |
25
(16) |
26
(2) |
27
(4) |
28
(10) |
|
|
|
|
|
On Wed, Feb 16, 2011 at 9:16 AM, Stephan Markus <zw...@we...> wrote: > > Hi, > > I am trying to display some complex values in a polar plot. Displaying > linear magnitude vs. angle - of course - works without any issues. But I'd > rather display the logarithmic magnitute vs. angle. Since the data for the > radius gets negative then, it'll be wrapped around / rotated by 180deg by > matplotlib. > > How can I display negative values for the radius w/o having them rotated by > 180deg? > > Of course I can add an offset to the data before plotting it but since my > plot is interactive and I use the xdata/ydata of events I'd like them to > represent the real data, without an offset. I thought it might be possible > to achieve with a custom transformation but I don't actually get it to > work. > > -Stephan > -- > View this message in context: > http://old.nabble.com/Polar-plot---problem-with-negative-values-for-radius-tp30936638p30936638.html > Sent from the matplotlib - users mailing list archive at Nabble.com. > > Stephan, >From the polar axes object, you can call ax.set_rscale('log') and that will automatically make the radial ticks scale and label the axes properly. You can then input the original data as you would without worry of negative values. Let us know how that works for you! Ben Root
Hi, I've written two plot scripts for plotting functions f: R -> C. (Scalar mappings of a real to a complex domain.) The function plotcf(...) plots the modulus as y value and the phase as color code. The function stemcf(...) does the same, but emulates a stem plot. I attached also two demo scripts that show these functions in action. If you have any questions or improvements, please tell me. Feel free to add these scripts to the gallery if you think they could be of a broader interest. -- Raoul
Hi, I am trying to display some complex values in a polar plot. Displaying linear magnitude vs. angle - of course - works without any issues. But I'd rather display the logarithmic magnitute vs. angle. Since the data for the radius gets negative then, it'll be wrapped around / rotated by 180deg by matplotlib. How can I display negative values for the radius w/o having them rotated by 180deg? Of course I can add an offset to the data before plotting it but since my plot is interactive and I use the xdata/ydata of events I'd like them to represent the real data, without an offset. I thought it might be possible to achieve with a custom transformation but I don't actually get it to work. -Stephan -- View this message in context: http://old.nabble.com/Polar-plot---problem-with-negative-values-for-radius-tp30936638p30936638.html Sent from the matplotlib - users mailing list archive at Nabble.com.
> Ben, John: Later this week or next, I'll take a crack at adding both of these to quiver.py and > axes.py (one under the name "streamlines", the other as "streamplot"). This is a great idea. I've had some time to improve the code, and so you have something better to work with! If you have any questions or need the code modifying, I'm happy to help - should have free time at the weekend and next week. I've also added density in both directions (nice idea - hadn't thought about this) and variable color as well as width. The new code is at http://www.atm.damtp.cam.ac.uk/people/tjf37/streamplot.py and there are new sample plots at http://www.atm.damtp.cam.ac.uk/people/tjf37/streamlines1.png and http://www.atm.damtp.cam.ac.uk/people/tjf37/streamlines2.png . > You probably want to use a compound path (one object for the entire > plot). See the tutorial athttp://matplotlib.sourceforge.net/users/path_tutorial.html, in > particular the compound path for the histogram example near the end, > and let me know if you have any questions. John, thanks for the hints. In the end I used a LineCollection for each streamline because I didn't see how to set different properties (colour and width) for different portions of the line in the compound path. LineCollection performs well enough for this plot so I'm happy with this solution. Tom
heya, Is there an easy way to colour-code a Matplotlib histogram with a single set of data? So for example, you'd have a bell-shaped histogram, and the middle 50% might be green, the regions 20% to the left and right of that might be yellow, and the 5% either side beyond that could be red. I couldn't seem to find anything in the Matplotlib options for this - any suggestions? Cheers, Victor
On Tue, Feb 15, 2011 at 6:29 PM, Paul Leopardi <pau...@ii...>wrote: > Hi Benjamin, > On 2011年2月16日 03:07:25 AM you wrote: > > I have not figured out what is causing the difference between my > computers. > > This might be backend-dependent (and maybe version-dependent). Have you > > tested your code on different backends? > > I don't know what you mean by different backends. What are the possible > ones, > and how do you configure them? Where is this documented? > Best, Paul > http://matplotlib.sourceforge.net/faq/installing_faq.html#what-is-a-backend Personally, I use the second approach with "matplotlib.use('GTKAgg')" or whatnot. Based on what I saw you listed as available packages, you should have TkAgg and WxAgg available. Ben Root
Hi all, I'm using a matplotlib.widgets.Slider on my animated figure. Sometime, I want to refresh the maximum value of the slider (since new values to plot were generated). Is it possible to update the "valmax" value of the slider? If not, is it possible to delete the slider and create a new one? Thanx!
wukan, on 2011年02月14日 23:39, wrote: > Hi ,When I use matplotlib to draw 2D graphics in django web site,I encounter > a problem. > when server users use matplotlib to draw graphics simultaneously will > cause website collapse. > when one user use matplotlib to draw graphics will have no problem. Is there an error / stack trace generated? Can you give an example of how you are using matplotlib from django? I can imagine there being some issue if you are using the pyplot interface to deal with all user requests (e.g. plt.plot, instead of allocating an axes object for each user and calling ax.plot). There's no way for us to know unless you provide more details. > i suppose matplotlib doesnot support multithreading drawing. > so i put the draw function in a thread . it can't work as before. I don't follow. > so why matplotlib doesnot support multithreading drawing? > How to solve this problem. Depending on the load, the nature of desired plots, and the need for user intervention, you might be able to get around the issues you're having just by spawning a new process to do the plotting. P.S. I try to answer all of the questions I feel capable of answering on the mailing list, there is no need to send duplicates of mailing list questions directly to me. best, -- Paul Ivanov 314 address only used for lists, off-list direct email at: http://pirsquared.org | GPG/PGP key id: 0x0F3E28F7
Bala subramanian, on 2011年02月15日 16:06, wrote: > Friends, > I created a histogram plot using data files that have discrete values > (sample file attached 'test.dat').However when i view the plot, i see that > the bars are not located exactly over the values. For example in the > attached figure (test.png), i see a bar (gray) placed between values 1 and > 2, while there is no such value between 1 and 2. Precisely i would like to > know how to make histogram for discrete data values. Hi Bala, Hist by default will make 10 bins with the same width, so depending on the distribution of your data, it will shift the locations of the bins (which is the effect you are seeing). What you'll want to do is pass the 'bins' keyword to ax.hist to avoid this. From the docstring *bins*: Either an integer number of bins or a sequence giving the bins. If *bins* is an integer, *bins* + 1 bin edges will be returned, consistent with :func:`numpy.histogram` for numpy version >= 1.3, and with the *new* = True argument in earlier versions. Unequally spaced bins are supported if *bins* is a sequence. Here's an example: In [8]: a = np.random.randint(20,size=(20)) In [9]: ax = plt.gca() In [10]: ax.hist(a,bins=np.arange(a.min(),a.max()+2,1)-.5) Out[10]: (array([1, 3, 1, 1, 0, 3, 1, 0, 0, 0, 0, 2, 1, 0, 1, 1, 0, 0, 2, 3]), array([ -0.5, 0.5, 1.5, 2.5, 3.5, 4.5, 5.5, 6.5, 7.5, 8.5, 9.5, 10.5, 11.5, 12.5, 13.5, 14.5, 15.5, 16.5, 17.5, 18.5, 19.5]), <a list of 20 Patch objects>) In [11]: ax.hist(a) # the default bins=10 (array([4, 2, 3, 1, 0, 2, 1, 2, 0, 5]), array([ 0. , 1.9, 3.8, 5.7, 7.6, 9.5, 11.4, 13.3, 15.2, 17.1, 19. ]), <a list of 10 Patch objects>) best, -- Paul Ivanov 314 address only used for lists, off-list direct email at: http://pirsquared.org | GPG/PGP key id: 0x0F3E28F7
On Tue, Feb 8, 2011 at 8:43 PM, Benjamin Root <ben...@ou...> wrote: > On Tue, Feb 8, 2011 at 5:53 PM, Paul Leopardi <pau...@ii...>wrote: > >> Hi Ben, >> On Wed, 9 Feb 2011 03:15:19 AM you wrote: >> > As formatted, the code would not run. I presume that everything after >> "for >> > j in range(0,M):" should be indented? When I did that and ran it in >> > ipython, I could not reproduce your problem. What version of matplotlib >> > are you running? >> >> Thanks for your continued close attention to this undoubted problem. >> >> Your email system mangled the indentation. The correct indentation is >> displayed at >> http://sourceforge.net/mailarchive/message.php?msg_id=27020771 >> >> I have also included a copy of the script matplotlib_bug_example.py with >> this >> message. [*Not* posted to the list.] Here is how I run it: >> >> ipython -pylab >> Python 2.6.2 (r262:71600, Oct 28 2010, 20:54:41) >> Type "copyright", "credits" or "license" for more information. >> >> IPython 0.10 -- An enhanced Interactive Python. >> ? -> Introduction and overview of IPython's features. >> %quickref -> Quick reference. >> help -> Python's own help system. >> object? -> Details about 'object'. ?object also works, ?? prints more. >> >> Welcome to pylab, a matplotlib-based Python environment. >> For more information, type 'help(pylab)'. >> >> In [1]: run matplotlib_bug_example.py >> >> My original post >> http://sourceforge.net/mailarchive/message.php?msg_id=27016368 >> listed what I thought were the relevant versions: >> >> Quote >> I am using openSUSE 11.2 with >> python-base-2.6.2-6.7.1.x86_64 >> python-matplotlib-1.0.1-20.1.x86_64 >> python-matplotlib-tk-1.0.1-20.1.x86_64 >> python-matplotlib-wx-1.0.1-20.1.x86_64 >> Unquote >> >> I have since run the script on a second machine which uses Ubuntu Karmic, >> with >> identical results. >> >> Versions in brief: >> Linux linfinit 2.6.31.12-0.1-default #1 SMP PREEMPT 2010年12月10日 11:18:32 >> +0100 >> x86_64 x86_64 x86_64 GNU/Linux >> >> IPython-0.10-3.2.noarch >> python-2.6.2-6.7.1.x86_64 >> python-matplotlib-1.0.1-20.1.x86_64 >> python-matplotlib-tk-1.0.1-20.1.x86_64 >> python-matplotlib-wx-1.0.1-20.1.x86_64 >> python-numpy-1.5.0-17.2.x86_64 >> python-tk-2.6.2-6.7.1.x86_64 >> >> Linux cheeze 2.6.31-22-generic #70-Ubuntu SMP Wed Dec 1 23:51:13 UTC 2010 >> i686 GNU/Linux >> >> ipython 0.10-1 >> python 2.6.4-0ubuntu1 >> python-matplotlib 0.99.0-1ubuntu1 >> python-numpy 1:1.3.0-3 >> python-tk 2.6.3-0ubuntu1 >> >> >> I have included a listing showing all versions of all packages with names >> containing the string "python", on both machines. [*Not* posted to the >> list.] >> Best, Paul >> >> > Trying out the script on another machine of mine, I was able to reproduce > the problem. I will have to see what is the difference between my two > computers that would cause the other one to work perfectly fine. > > Ben Root > > Paul, I have not figured out what is causing the difference between my computers. This might be backend-dependent (and maybe version-dependent). Have you tested your code on different backends? Ben Root
On Tue, Feb 15, 2011 at 9:24 AM, Sebastian Busch <web...@th...> wrote: > Dear list, > > if I do a > > plot([1,2],[1,2]) > plot([1,2],[1,3]) > plot([1,2],[1,4]) > > I will get three lines. All have linestyle='-', the colour is changed > automatically: blue, green, red, ... > > Can I change this behaviour to: All have the colour black, and the > linestyle is changed /automatically/ '-', '--', '-.', ...? You can use itertools.cycle, that will repeatedly loop over a sequence of items: import matplotlib.pyplot as pl from itertools import cycle styles = cycle(['k-', 'k--', 'k-.']) plot([1,2], [1,2], styles.next()) plot([1,2], [1,3], styles.next()) plot([1,2], [1,4], styles.next()) Ryan -- Ryan May Graduate Research Assistant School of Meteorology University of Oklahoma
2011年2月14日 Gaël KANEKO <kan...@ho...> > Hi, > I have some problems to plot a 3d plot_surface (and contour plot) in log > scale (y and z or x,y and z). > There is nothink in the help sections of thus plot to plot them in log > scale (neither in thus plot code commentary). > I tried to find a solution by myself (many try as "log=True", > "xscale='log'", "scale='log'", or "set_xscale('log')"...) but it doesn't > work. > I tried to use "LogFormatter" (ticker) but i failed (maybe I am doing > something wrong (I am a newbe) but i tried many things). > I try to found a solution on forums and this mailing list and what i found > nearest of my problem is this topic: > > http://stackoverflow.com/questions/3909794/plotting-mplot3d-axes3d-xyz-surface-plot-with-log-scale > They said this problem had no solution. Is it true? have somebody solved > this problem? > > An other solution is to plot log(Data) and change ticks with "set_ticks" > (for exemple) but it seems to only work with 2D plot. I tried too :( > > To be unterstanding easier, this is an exemple of the code to plot in log > scale: > import matplotlib.pyplot as plt# (i am under '1.0.0') > import numpy as np > > #Data > x = np.logspace(0, 4, 10) > y = np.logspace(0, 4, 10) > Z = np.arange(100).reshape((10,10)) > > #Min and Max for x,y and Z > minx=np.min(x) > maxx=np.max(x) > miny=np.min(y) > maxy=np.max(y) > minz=np.min(Z) > maxz=np.max(Z) > > #figure > fig = plt.figure() > ax = fig.gca(projection='3d') > > > ax.plot_surface(X, Y, Z, rstride=8, cstride=8, alpha=0.3) > cset = ax.contour(X, Y, Z, zdir='z', offset=minz) > cset = ax.contour(X, Y, Z, zdir='x', offset=minx) > cset = ax.contour(X, Y, Z, zdir='y', offset=miny) > > ax.set_xlabel("X") > ax.set_xlim3d(minx,maxx) > ax.set_ylabel("Y") > ax.set_ylim3d(miny,maxy) > ax.set_zlabel("Z") > ax.set_zlim3d(minz,maxz) > fig.savefig("plot00.png") > > > > Has someone got a solution? > Thanks! > Regards, > Gaël > > I can confirm (with a modified version of your script) that mplot3d does not properly handle non-linear scaling. While it is possible to set the axis scale through a command like: ax.w_xaxis.set_scale('log') but the placement of the tickers are wrong and it fails because mplot3d does some weird stuff with the ticker formatter rather than just letting the formatter do its job. I will look into this further to see if I can fix this. Ben Root
Dear list, if I do a plot([1,2],[1,2]) plot([1,2],[1,3]) plot([1,2],[1,4]) I will get three lines. All have linestyle='-', the colour is changed automatically: blue, green, red, ... Can I change this behaviour to: All have the colour black, and the linestyle is changed /automatically/ '-', '--', '-.', ...? Thanks in advance, Sebastian.
On 2/14/11 4:54 PM, Benjamin Root wrote: > On Mon, Feb 14, 2011 at 5:30 PM, John Hunter <jd...@gm... > <mailto:jd...@gm...>> wrote: > > On Sun, Feb 13, 2011 at 11:45 PM, Tom Flannaghan <tj...@ca... > <mailto:tj...@ca...>> wrote: > > > It would also be helpful if anyone has suggestions on a > particular issue I had. > > Currently, to plot variable-width lines (i.e. streamlines2.png) > I use a plot > > command for each line segment which is very slow and nasty. Is > there a better > > way I'm missing? > > You probably want to use a compound path (one object for the entire > plot). See the tutorial at > http://matplotlib.sourceforge.net/users/path_tutorial.html, in > particular the compound path for the histogram example near the end, > and let me know if you have any questions. > > JDH > > > Personally, I am more a fan of Ray's version, although Tom's version > would integrate more nicely with the current mpl codebase. There are > some nice features with Ray's version such as allowing to choose > density in both x and y directions. > > I guess the major question is which style do we like better? Maybe we > could use both of these code bases to come up with a nice, generalized > version? > > Ben Root > Ben, John: Later this week or next, I'll take a crack at adding both of these to quiver.py and axes.py (one under the name "streamlines", the other as "streamplot"). -Jeff -- Jeffrey S. Whitaker Phone : (303)497-6313 Meteorologist FAX : (303)497-6449 NOAA/OAR/PSD R/PSD1 Email : Jef...@no... 325 Broadway Office : Skaggs Research Cntr 1D-113 Boulder, CO, USA 80303-3328 Web : http://tinyurl.com/5telg
Hi Aman, Thanks a lot for your help and providing me the link to the function. It sorted out my query :) Cheers Omer On Tue, Feb 15, 2011 at 14:44, Aman Thakral <ama...@gm...> wrote: > Hi Omer, > > use the subplots_adjust keyword argument (or click on the adjust > subplots icon in the navigation toolbar at the bottom of the figure). > > > http://matplotlib.sourceforge.net/api/figure_api.html#matplotlib.figure.Figure.subplots_adjust > > -Aman > > On Tue, Feb 15, 2011 at 6:05 AM, Omer Khalid <okh...@gm...> > wrote: > > Hi, > > I am trying to create two subplots in the same figure. Currently, the > x-axis > > of first plot overlaps with the title of second plot. > > I was wondering if there is a function for figure object that allows to > > create vertical space between two plots so that the axis and title text > > doesn't overlap? > > Regards > > omer > > > ------------------------------------------------------------------------------ > > The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE: > > Pinpoint memory and threading errors before they happen. > > Find and fix more than 250 security defects in the development cycle. > > Locate bottlenecks in serial and parallel code that limit performance. > > http://p.sf.net/sfu/intel-dev2devfeb > > _______________________________________________ > > Matplotlib-users mailing list > > Mat...@li... > > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > > > >
Hi Omer, use the subplots_adjust keyword argument (or click on the adjust subplots icon in the navigation toolbar at the bottom of the figure). http://matplotlib.sourceforge.net/api/figure_api.html#matplotlib.figure.Figure.subplots_adjust -Aman On Tue, Feb 15, 2011 at 6:05 AM, Omer Khalid <okh...@gm...> wrote: > Hi, > I am trying to create two subplots in the same figure. Currently, the x-axis > of first plot overlaps with the title of second plot. > I was wondering if there is a function for figure object that allows to > create vertical space between two plots so that the axis and title text > doesn't overlap? > Regards > omer > ------------------------------------------------------------------------------ > The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE: > Pinpoint memory and threading errors before they happen. > Find and fix more than 250 security defects in the development cycle. > Locate bottlenecks in serial and parallel code that limit performance. > http://p.sf.net/sfu/intel-dev2devfeb > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > >
Hi, I am trying to create two subplots in the same figure. Currently, the x-axis of first plot overlaps with the title of second plot. I was wondering if there is a function for figure object that allows to create vertical space between two plots so that the axis and title text doesn't overlap? Regards omer
Hi everyone, I'm not quite sure what to call my problem so searching for it is difficult, but I'll try and describe it the best I can: Matplotlib in python on OSX seems to have an issue with the pan/zoom tool. When I click it and drag the plot around, it does not update until I release the mouse. I've used this function on other *nix machines and it seems to be fine. Here's a quick video describing what I mean if my description is unclear: http://www.youtube.com/watch?v=_cqUGpHGrl0 I have tried to switch the backend to osx in the matplotlibrc file, but the result is the same. Any help you can provide would be greatly appreciated. Thanks! -Robert
jules hummon, on 2011年02月14日 07:23, wrote: > Feel free to 'save and run', pass along, or ignore. > This was my valentine's day present today. Thank you for sharing! I took the liberty of livening it up for my sweetheart. #--------------------------------------------------- # hohumheartbeat.py - a more lively hohumheart.py ;) import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt from matplotlib.patches import Polygon # force square figure and square axes looks better for polar, IMO width, height = mpl.rcParams['figure.figsize'] size = min(width, height) # make a square figure fig = plt.figure(figsize=(size, size)) ax = fig.add_axes([0.1, 0.1, 0.8, 0.8], polar=True, axisbg='#ffffff') ax2 = fig.add_axes([0.45, .9, 0.1, 0.1], polar=True, axisbg='#ffffff') ax.set_rmax(2.0) ax2.set_rmax(4.0) ax2.spines['polar'].set_visible(False) ax2.patch.set_alpha(.3) for a in ax,ax2: a.set_xticks([]) a.set_yticks([]) ax.grid(False) theta = np.linspace(0,1,100)*np.pi*2 r = 1*(1-np.cos(theta)) ncards = 5 step = 2*np.pi/ncards pdict = dict(fc='r',ec='k', alpha=.5) for ii in range(ncards): tr = np.column_stack((theta+ii*step, r)) ax.add_patch(Polygon(tr, **pdict)) # from WolframMath "Heart Curve" r2 = 2 - 2*np.sin(theta) r2 += np.sin(theta) * np.sqrt(np.abs(np.cos(theta))) / (np.sin(theta)+1.4) tr2 = np.column_stack((theta, r2)) ax2.add_patch(Polygon(tr2,**pdict)) # heart kwargs = dict(transform=ax2.transAxes, va='center', fontsize=20) ax2.text(0,.45,"I",ha='right',**kwargs) ax2.text(1,.4,"you",ha='left',**kwargs) beat = np.tan(np.linspace(0, np.pi*2, 100)) beat[0:20] = beat[60:80] beat[-20:] = beat[20:40] beat -= beat.min() beat /= beat.max() i=0; beatlen = len(beat)-1; def heartbeat(e): global i; i = (i+1) % (beatlen) y = beat[i] ax2.set_rmax(y*4. + 4.) ax2.draw(ax.figure.canvas.get_renderer()) ax2.figure.canvas.blit(ax2.bbox) #plt.draw() #use if the last two lines cause trouble # even your mouse movements make my heart skip a bit! cid = ax.figure.canvas.mpl_connect('idle_event', heartbeat) print "ax.figure.canvas.mpl_disconnect(%d)" %cid print "#run the line above to 'flatline' (stop heartbeat)" plt.show() best, -- Paul Ivanov 314 address only used for lists, off-list direct email at: http://pirsquared.org | GPG/PGP key id: 0x0F3E28F7
On Mon, Feb 14, 2011 at 5:30 PM, John Hunter <jd...@gm...> wrote: > On Sun, Feb 13, 2011 at 11:45 PM, Tom Flannaghan <tj...@ca...> wrote: > > > It would also be helpful if anyone has suggestions on a particular issue > I had. > > Currently, to plot variable-width lines (i.e. streamlines2.png) I use a > plot > > command for each line segment which is very slow and nasty. Is there a > better > > way I'm missing? > > You probably want to use a compound path (one object for the entire > plot). See the tutorial at > http://matplotlib.sourceforge.net/users/path_tutorial.html, in > particular the compound path for the histogram example near the end, > and let me know if you have any questions. > > JDH > > Personally, I am more a fan of Ray's version, although Tom's version would integrate more nicely with the current mpl codebase. There are some nice features with Ray's version such as allowing to choose density in both x and y directions. I guess the major question is which style do we like better? Maybe we could use both of these code bases to come up with a nice, generalized version? Ben Root
On Sun, Feb 13, 2011 at 11:45 PM, Tom Flannaghan <tj...@ca...> wrote: > It would also be helpful if anyone has suggestions on a particular issue I had. > Currently, to plot variable-width lines (i.e. streamlines2.png) I use a plot > command for each line segment which is very slow and nasty. Is there a better > way I'm missing? You probably want to use a compound path (one object for the entire plot). See the tutorial at http://matplotlib.sourceforge.net/users/path_tutorial.html, in particular the compound path for the histogram example near the end, and let me know if you have any questions. JDH
On 2/13/11 10:45 PM, Tom Flannaghan wrote: > Hi, > > I've written a script to roughly emulate the elegant streamline plots found in > Mathematica. The code is available at > http://www.atm.damtp.cam.ac.uk/people/tjf37/streamplot.py and example plots at > http://www.atm.damtp.cam.ac.uk/people/tjf37/streamlines1.png and > streamlines2.png. It's a pretty hacky script, but fast and fairly robust. If > anyone finds this script useful and has comments/suggestions, I'm happy to do a > bit more work. > > It would also be helpful if anyone has suggestions on a particular issue I had. > Currently, to plot variable-width lines (i.e. streamlines2.png) I use a plot > command for each line segment which is very slow and nasty. Is there a better > way I'm missing? > > Tom Tom: This is really nice! I'd like to see some version of your code incorporated into matplotlib. Regarding your question about variable-width lines, I don't know of any way to do that - but perhaps someone with more detailed knowledge of matplotlib internals will comment. -Jeff -- Jeffrey S. Whitaker Phone : (303)497-6313 Meteorologist FAX : (303)497-6449 NOAA/OAR/PSD R/PSD1 Email : Jef...@no... 325 Broadway Office : Skaggs Research Cntr 1D-113 Boulder, CO, USA 80303-3328 Web : http://tinyurl.com/5telg
Thank you for your help. I upgraded to the latest development version, and as you said, memory use dropped a ton. I will have to test more to confirm that the problem is completely gone, but this appears to bring memory usage down to something quite manageable (at least on my 8gb box ...). Tom On 02/09/2011 07:30 PM, Robert Abiad wrote: > Tom, > > I just went through this, though with version 1.01 of mpl, so it may be different. You can read the > very long thread at: > > http://www.mail-archive.com/mat...@li.../msg20031.html > > Those who maintain mpl don't think there is a memory leak. What I found was that imshow() does > consume a lot of memory (now fixed in the development version) and that the first 2 or so uses build > on each other, but after that it levels off giving back memory after close(). There is a > discrepancy between what python reports it's using and what the OS reports (I had 500MB from the OS, > but only 150MB from python). There is a chance that ipython is caching your results (try ipython > -pylab -cs 0), but when I ran without ipython, python still had a large portion of memory. > > -robert > > On 2/9/2011 3:52 PM, Tom Dimiduk wrote: >> I am using matplotlib pylab in association with ipython -pylab to show >> many large (~2000x2000 or larger) images. Each time I show another >> image it consumes more memory until eventually exhausting all system >> memory and making my whole system unresponsive. >> >> The easiest way to replicate this behaviour is with >> a = ones((3333,3333)) >> imshow(a) >> >> optionally >> >> close() >> >> and then >> >> imshow(a) >> >> again. I am using ipython .10.1 and matplotlib 0.99.3. Is there >> something I should be doing differently to avoid this problem? Is it >> fixed in a later version? >> >> Thanks, >> Tom >> >> ------------------------------------------------------------------------------ >> The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE: >> Pinpoint memory and threading errors before they happen. >> Find and fix more than 250 security defects in the development cycle. >> Locate bottlenecks in serial and parallel code that limit performance. >> http://p.sf.net/sfu/intel-dev2devfeb >> _______________________________________________ >> Matplotlib-users mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > ------------------------------------------------------------------------------ > The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE: > Pinpoint memory and threading errors before they happen. > Find and fix more than 250 security defects in the development cycle. > Locate bottlenecks in serial and parallel code that limit performance. > http://p.sf.net/sfu/intel-dev2devfeb > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Aman Thakral, on 2011年02月09日 15:40, wrote: > Hi, > > I was just wondering, how would I go about redrawing only a single element > (i.e. an artist)? I know that matplotlib.artist.Artist has a draw() method > that accepts a renderer as the argument. > > I tried something along the lines of: > > renderer = fig.canvas.get_renderer() > title = ax.set_title("This is my title") > title.draw(renderer) > > But have not had any luck. I'm not sure what I'm missing. Any help would > be greatly appreciated. Hi Aman, To see the affects of rendering something new, you can use: ax.figure.canvas.blit(ax.title.get_bbox_patch()) If you intend to change the title several times, however, the above will just keep over-plotting on top of the previous titles. In that case, you'll want to use the animated=True keyword and canvas.restore_region along with the blitting -- see the animation examples for how to do that. best, -- Paul Ivanov 314 address only used for lists, off-list direct email at: http://pirsquared.org | GPG/PGP key id: 0x0F3E28F7
Bartosz Telenczuk, on 2011年02月13日 23:16, wrote: > Hi, > > I am writting an application in which I update dynamically the state > of the figures. When I am done I call the Figure.canvas.draw function > to redraw the figure. However, when the window was previously closed > by the user the update can be skipped. > > Is there a way to tell from a figure handle if the figure is shown on > screen or not? > > Currently, I solve this problem with a callback which sets the figure > handle to None on figure close event. However, I guess there might be > a more direct way of doing that. What would you suggest? > > Thanks a lot for your help. Hi Bartosz, I don't think there's currently a backend independent way of doing it outside of the approach you have taken. Having a quick look using f = plt.gcf() before and after closing the figure, with a WX backend, the f.canvas object changes to an instance of <class 'wx._core._wxPyDeadObject'>, and loses all of its usual methods. For GTK - looks like f.canvas.window gets set to None. So if you're only targeting one backend, there might be some simple way like this to find out if a figure is being shown using from the figure handle. best, -- Paul Ivanov 314 address only used for lists, off-list direct email at: http://pirsquared.org | GPG/PGP key id: 0x0F3E28F7