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
(16) |
2
(22) |
3
(28) |
4
(17) |
5
(17) |
6
(7) |
7
|
8
(15) |
9
(28) |
10
(26) |
11
(28) |
12
(19) |
13
(5) |
14
(3) |
15
(21) |
16
(28) |
17
(11) |
18
(18) |
19
(6) |
20
(5) |
21
(18) |
22
(11) |
23
(22) |
24
(28) |
25
(17) |
26
(17) |
27
(7) |
28
(16) |
29
(24) |
30
(25) |
31
(14) |
|
|
|
From: Jae-Joon L. <lee...@gm...> - 2010-03-30 18:46:36
|
Doing this in a general way is quite difficult (if possible) because a user can set an arbitrary transform for an artist. What we may try to do is recycling artists whose transform is simple, e.g., transData, rather than try to come up with a general solution. I'll see what I can do but I must admit that I'm not very kin to this kind of feature and it may take a while. I recommend you to open a new ticket in the feature requests tracker hoping that other developers or contributors can take a look. http://sourceforge.net/tracker/?atid=560723&group_id=80706&func=browse Regards, -JJ On Mon, Mar 29, 2010 at 1:54 PM, Thomas Robitaille <tho...@gm...> wrote: > Hi Jae-Joon, > > Thanks for your quick reply! Since for example LineCollections can be created independent of the Axes in which they are going to be plotted through the creation of a LineCollection instance, would it not be possible to have a method that allows one to retrieve an Axes-independent LineCollection from an Axes instance? (for example a get_collection method) This would then allow one to 'recycle' existing collections. > > Cheers, > > Thomas > > On Mar 29, 2010, at 1:40 PM, Jae-Joon Lee wrote: > >> As far as I can say, moving around artists from one axes to the other >> is NOT recommended. And I encourage you to create separate artists for >> each axes rather than try to reuse the existing ones. >> >> For your particular example, >> >> fig = mpl.figure() >> ax2 = fig.add_subplot(1,1,1) >> for c in ax1.collections: >> c._transOffset=ax2.transData >> ax2.add_collection(c) >> >> should work. >> >> Regards, >> >> -JJ >> >> >> >> >> On Mon, Mar 29, 2010 at 12:24 PM, Thomas Robitaille >> <tho...@gm...> wrote: >>> Hello, >>> >>> In the following example, I am trying to copy over existing collections from one plot to another: >>> >>> import matplotlib.pyplot as mpl >>> >>> fig = mpl.figure() >>> ax1 = fig.add_subplot(1,1,1) >>> ax1.scatter([0.5],[0.5]) >>> fig.savefig('test1.png') >>> >>> fig = mpl.figure() >>> ax2 = fig.add_subplot(1,1,1) >>> for c in ax1.collections: >>> ax2.add_collection(c) >>> fig.savefig('test2.png') >>> >>> However, the circle appears in the wrong place in test2.png (close to 0.4, 0.4 instead of 0.5,0.5). Is it not possible/safe to copy over collections in this way? If not, then how should this be done? >>> >>> Thanks, >>> >>> Thomas >>> ------------------------------------------------------------------------------ >>> Download Intel® Parallel Studio Eval >>> Try the new software tools for yourself. Speed compiling, find bugs >>> proactively, and fine-tune applications for parallel performance. >>> See why Intel Parallel Studio got high marks during beta. >>> http://p.sf.net/sfu/intel-sw-dev >>> _______________________________________________ >>> Matplotlib-users mailing list >>> Mat...@li... >>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >>> > > > ------------------------------------------------------------------------------ > Download Intel® Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
From: Chloe L. <ch...@be...> - 2010-03-30 17:15:57
|
But this example doesn't solve the problem I was thinking of: it shows lots of colors in the colorbar that aren't used in the plot. &C On Mar 30, 2010, at 6:52 AM, Friedrich Romstedt wrote: > 2010/3/30 Ariel Rokem <ar...@be...>: >> I ended up with the code below, using Chloe's previously posted >> 'subcolormap' and, in order to make the colorbar nicely attached to >> the main >> imshow plot, I use make_axes_locatable in order to generate the >> colorbar >> axes. I tried it out with a couple of use-cases and it seems to do >> what it >> is supposed to, (with ticks only for the edges of the range of the >> data and >> 0, if that is within that range), but I am not entirely sure. Do >> you think >> it works? > > I think even Chloe would agree that you should avoid the subcolormap() > if you can. I tried to create an as minimalistic as possible but > working self-contained example, please find the code also attached as > .py file: > > from matplotlib import pyplot as plt > import matplotlib as mpl > from mpl_toolkits.axes_grid import make_axes_locatable > import numpy as np > > fig = plt.figure() > ax_im = fig.add_subplot(1, 1, 1) > divider = make_axes_locatable(ax_im) > ax_cb = divider.new_vertical(size = '20%', pad = 0.2, pack_start = > True) > fig.add_axes(ax_cb) > > x = np.linspace(-5, 5, 101) > y = x > Z = np.sin(x*y[:,None]).clip(-1,1-0.1) > > # Leave out if you want: > Z += 2 > > min_val = Z.min() > max_val = Z.max() > bound = max(np.abs(Z.max()), np.abs(Z.min())) > > patch = ax_im.imshow(Z, origin = 'upper', interpolation = 'nearest', > vmin = -bound, vmax = bound) > > cb = fig.colorbar(patch, cax = ax_cb, orientation = 'horizontal', > norm = patch.norm, > boundaries = np.linspace(-bound, bound, 256), > ticks = [min_val, 0, max_val], > format = '%.2f') > > plt.show() > > Friedrich > <cbar.py><cbar.png> |
From: Filipe P. A. F. <oc...@gm...> - 2010-03-30 16:31:42
|
Thanks Friedrich, However, my knowledge of python is very limited, even though I think I understood what you suggested I do not know how to get the shape (of the figure?) for this part: >>> fig.set_size_inches(float(shape[0]) / dpi, float(shape[1]) / dpi) error is: Traceback (most recent call last): File "blueearth-map.py", line 108, in <module> fig.set_size_inches(float(shape[0]) / dpi, float(shape[1]) / dpi) TypeError: 'function' object is unsubscriptable It seems that it ended up calling a function shape instead of a variable shape. I'm sending attached the script if you are interested in looking at it. Thanks again. Filipe. On Sun, Mar 28, 2010 at 3:35 PM, Friedrich Romstedt <fri...@gm...> wrote: > > 2010/3/28 Filipe Pires Alvarenga Fernandes <oc...@gm...>: > > Hello list > > I've trying for a while a "python only" solution to remove white spaces that > > Basemap generate to keep the aspect ratio. I found these two threads that > > explain the issue better: > > I think maybe you can make use of the Agg Backend to achieve a > Python-only solution to obtain a PIL Image from a figure without > bypassing over the HDD: > > Furthemore, if this doesn't work, maybe you can use a StringIO as > "file", then seek() the StringIO and reread with PIL from the > "file-like" StringIO, or something like that? > > # > # Render the Figure to a PIL Image ... > # > > # Prepare figure to be of pixel extent *shape* ... > > dpi = figure.dpi > figure.set_size_inches(float(shape[0]) / dpi, float(shape[1]) / dpi) > > # Create the rendering Canvas ... > # > # We also convert the picture to an RGB string. > > canvas = matplotlib.backends.backend_agg.FigureCanvasAgg(figure) > canvas.draw() > image_string = canvas.tostring_rgb() > > # Create a PIL Image from RGB string ... > > image = Image.fromstring("RGB", shape, image_string) > > # Now do whatever you want with the Image. > > Friedrich |
From: Alan G I. <ala...@gm...> - 2010-03-30 16:28:20
|
> 2010/3/29 Alan G Isaac <ala...@gm...>: > > Can you explain this: > > norm = colors.Normalize(vmin = -1, vmax = 1) On 3/28/2010 10:05 PM, Friedrich Romstedt wrote: > The normaliser takes some arbitrary value and returns a value in [0, > 1]. Hence the name. The value \in [0, 1] is handed over to the > cmap's __call__(), resulting in the color value. And yes, I guess you > can use vmin and vmax directly, it's just a matter of taste. OK, thanks! Alan |
From: Julien <ju_...@ya...> - 2010-03-30 15:12:17
|
Hello All. I just found a bug with the histogramme fonction of matplotlib. It might been already known, in this case don't pay attention to my message. The bug append with both OS: Windows XP and Linux (ubuntu). Both using the latest matplotlib release: 0.99.1 The bug is reproductible, with the folliwng script: What the script shall do: Let's say you are looking at the color of wagons on trains. Every trains has 31 wagons. Each time you see a red one, you write down it's number At the end, you want to draw the histogramme with X axis: Number of the wagon in the tain Y axis: Number of wagon of a specific number which is red. My script #------------------------------------------------------------------------------------------------------------------------------ import matplotlib.pyplot as plt liste_histo=[2,2,2,6,1,2,7,2,1,2,1,2,2,1,2,2,11,1,2,12,2,2,14,2,2,1,2,6,1,2,2] plt.figure(1) plt.hist(sorted(liste_histo),bins=31) plt.axis([0,31,0,20]) plt.show() #----------------------------------------------------------------------------------------------------------------------------- This script should give you a srange historamme, with bins that are half the size they shoud be. With the same script, but a different countdown of my wagons, it works well: #----------------------------------------------------------------------------------------------------------------------------- import matplotlib.pyplot as plt liste_histo=[2,2,2,6,1,2,7,2,1,2,1,2,2,1,2,2,11,1,2,12,2,2,14,2,2,1,2,6,15,25] plt.figure(1) plt.hist(sorted(liste_histo),bins=31) plt.axis([0,31,0,20]) plt.show() #----------------------------------------------------------------------------------------------------------------------------- I corrected this error by adding a 32 (my max value on the histogramme should be a 31). asking 32 bins, and drawing the histogramme between 1 and 31: #------------------------------------------------------------------------------------------------------------------------------ import matplotlib.pyplot as plt liste_histo=[2,2,2,6,1,2,7,2,1,2,1,2,2,1,2,2,11,1,2,12,2,2,14,2,2,1,2,6,1,2,2,32] plt.figure(1) plt.hist(sorted(liste_histo),bins=32) plt.axis([0,31,0,20]) plt.show() #----------------------------------------------------------------------------------------------------------------------------- And it works... Am I the only one to get a probleme here? Thanks for reading me Julien |
From: Ariel R. <ar...@be...> - 2010-03-30 14:38:28
|
Hi Friedrich, Thanks a lot - very nice! Cheers - Ariel On Tue, Mar 30, 2010 at 6:52 AM, Friedrich Romstedt < fri...@gm...> wrote: > 2010/3/30 Ariel Rokem <ar...@be...>: > > I ended up with the code below, using Chloe's previously posted > > 'subcolormap' and, in order to make the colorbar nicely attached to the > main > > imshow plot, I use make_axes_locatable in order to generate the colorbar > > axes. I tried it out with a couple of use-cases and it seems to do what > it > > is supposed to, (with ticks only for the edges of the range of the data > and > > 0, if that is within that range), but I am not entirely sure. Do you > think > > it works? > > I think even Chloe would agree that you should avoid the subcolormap() > if you can. I tried to create an as minimalistic as possible but > working self-contained example, please find the code also attached as > .py file: > > from matplotlib import pyplot as plt > import matplotlib as mpl > from mpl_toolkits.axes_grid import make_axes_locatable > import numpy as np > > fig = plt.figure() > ax_im = fig.add_subplot(1, 1, 1) > divider = make_axes_locatable(ax_im) > ax_cb = divider.new_vertical(size = '20%', pad = 0.2, pack_start = True) > fig.add_axes(ax_cb) > > x = np.linspace(-5, 5, 101) > y = x > Z = np.sin(x*y[:,None]).clip(-1,1-0.1) > > # Leave out if you want: > Z += 2 > > min_val = Z.min() > max_val = Z.max() > bound = max(np.abs(Z.max()), np.abs(Z.min())) > > patch = ax_im.imshow(Z, origin = 'upper', interpolation = 'nearest', > vmin = -bound, vmax = bound) > > cb = fig.colorbar(patch, cax = ax_cb, orientation = 'horizontal', > norm = patch.norm, > boundaries = np.linspace(-bound, bound, 256), > ticks = [min_val, 0, max_val], > format = '%.2f') > > plt.show() > > Friedrich > -- Ariel Rokem Helen Wills Neuroscience Institute University of California, Berkeley http://argentum.ucbso.berkeley.edu/ariel |
From: Amenity A. <am...@en...> - 2010-03-30 14:08:00
|
Email not displaying correctly? View it in your browser. Hello Amenity, Spring is upon us and arrangements for SciPy 2010 are in full swing. We're already nearing on some important deadlines for conference participants: April 11th is the deadline for submitting an abstract for a paper, and April 15th is the deadline for submitting a tutorial proposal. Help choose tutorials for SciPy 2010... We set up a UserVoice page to brainstorm tutorial topics last week and we already have some great ideas. The top ones at the moment are: Effective multi-core programming with Cython and Python Building your own app with Mayavi High performance computing with Python Propose your own or vote on the existing suggestions here. ...Or instruct a tutorial and cover your conference costs. Did you know that we're awarding generous stipends to tutorial instructors this year? So if you believe you could lead a tutorial, by all means submit your proposal — soon! They're due April 15th. Call for Papers Continues Submitting a paper for to present at SciPy 2010 is easy, so remember to prepare one and have your friends and colleagues follow suit. Send us your abstract before April 11th and let us know whether you'd like to speak at the main conference or one of the specialized tracks. Details here. Have you registered? Booking your tickets early should save you money — not to mention the early registration prices you will qualify for if you register before May 10th. Best, The SciPy 2010 Team @SciPy2010 on Twitter You are receiving this email because you have registered for the SciPy 2010 conference in Austin, TX. Unsubscribe am...@en... from this list | Forward to a friend | Update your profile Our mailing address is: Enthought, Inc. 515 Congress Ave. Austin, TX 78701 Add us to your address book Copyright (C) 2010 Enthought, Inc. All rights reserved. |
From: Friedrich R. <fri...@gm...> - 2010-03-30 13:52:18
|
2010/3/30 Ariel Rokem <ar...@be...>: > I ended up with the code below, using Chloe's previously posted > 'subcolormap' and, in order to make the colorbar nicely attached to the main > imshow plot, I use make_axes_locatable in order to generate the colorbar > axes. I tried it out with a couple of use-cases and it seems to do what it > is supposed to, (with ticks only for the edges of the range of the data and > 0, if that is within that range), but I am not entirely sure. Do you think > it works? I think even Chloe would agree that you should avoid the subcolormap() if you can. I tried to create an as minimalistic as possible but working self-contained example, please find the code also attached as .py file: from matplotlib import pyplot as plt import matplotlib as mpl from mpl_toolkits.axes_grid import make_axes_locatable import numpy as np fig = plt.figure() ax_im = fig.add_subplot(1, 1, 1) divider = make_axes_locatable(ax_im) ax_cb = divider.new_vertical(size = '20%', pad = 0.2, pack_start = True) fig.add_axes(ax_cb) x = np.linspace(-5, 5, 101) y = x Z = np.sin(x*y[:,None]).clip(-1,1-0.1) # Leave out if you want: Z += 2 min_val = Z.min() max_val = Z.max() bound = max(np.abs(Z.max()), np.abs(Z.min())) patch = ax_im.imshow(Z, origin = 'upper', interpolation = 'nearest', vmin = -bound, vmax = bound) cb = fig.colorbar(patch, cax = ax_cb, orientation = 'horizontal', norm = patch.norm, boundaries = np.linspace(-bound, bound, 256), ticks = [min_val, 0, max_val], format = '%.2f') plt.show() Friedrich |
From: Jon O. V. <jo...@gm...> - 2010-03-30 09:08:58
|
David Carmean <dlc-sfl@...> writes: > At what point is a line Collection useful? More efficient for adding or manipulating many lines in one go. It saved my life (some hours of it, anyway) the other day: http://article.gmane.org/gmane.comp.python.matplotlib.general/22149 |
From: Ariel R. <ar...@be...> - 2010-03-30 05:00:15
|
Hi - I ended up with the code below, using Chloe's previously posted 'subcolormap' and, in order to make the colorbar nicely attached to the main imshow plot, I use make_axes_locatable in order to generate the colorbar axes. I tried it out with a couple of use-cases and it seems to do what it is supposed to, (with ticks only for the edges of the range of the data and 0, if that is within that range), but I am not entirely sure. Do you think it works? Cheers, Ariel from mpl_toolkits.axes_grid import make_axes_locatable fig=plt.figure() ax_im = fig.add_subplot(1,1,1) divider = make_axes_locatable(ax_im) ax_cb = divider.new_vertical(size="20%", pad=0.2, pack_start=True) fig.add_axes(ax_cb) #Extract the minimum and maximum values for scaling of the colormap/colorbar: max_val = np.max(m[np.where(m<1)]) min_val = np.min(m) #This makes sure that 0 is always the center of the colormap: if min_val<-max_val: ax_max = -min_val ax_min = min_val else: ax_max = max_val ax_min = -max_val #Keyword args to imshow: kw = {'origin': 'upper', 'interpolation': 'nearest', 'cmap':cmap, 'vmin':ax_min, 'vmax':ax_max} im=ax_im.imshow(m,**kw) #The following produces the colorbar and sets the ticks if colorbar: delta = ax_max-ax_min #The size of the entire interval of data min_p = (min_val-ax_min)/delta max_p = (max_val-ax_min)/delta print min_p print max_p cnorm = mpl.colors.Normalize(vmin=min_val,vmax=max_val) subcmap = subcolormap(min_p,max_p,cmap) cb = mpl.colorbar.ColorbarBase(ax_cb, cmap=subcmap, orientation='horizontal',norm=cnorm) #Set the ticks - if 0 is in the interval of values, set that, as well #as the maximal and minimal values: if min_val<0: cb.set_ticks([min_val,0,max_val]) cb.set_ticklabels(['%.2f'%min_val,'0','%.2f'%max_val]) #Otherwise - only set the minimal and maximal value: else: cb.set_ticks([min_val,max_val]) cb.set_ticklabels(['%.2f'%min_val,'%.2f'%max_val]) On Mon, Mar 29, 2010 at 6:41 AM, Friedrich Romstedt < fri...@gm...> wrote: > 2010/3/29 Friedrich Romstedt <fri...@gm...>: > > Note that the ticking is a bit weird, there is also a bug in > > matplotlib I will report on right after this e-mail, whose bugfix you > > will maybe want to apply to get ticking properly working. When you > > have insane values for C.min() and C.max() anyway, I'm afraid you have > > to retick manually with *ticks* to colorbar(). The ticker.MaxNLocator > > is only used when not using the *boundaries* arg to colorbar(), > > unfortunately. Otherwise it tries to create maximal many and less > > than 11 ticks by using the lowest value and an appropriate step in > > *boundaries*. I think the implementation of ticking is cumbersome and > > never optimal. > > You can get rid of this night mare by giving the kwarg "ticks = > matplotlib.ticker.MaxNLocator()" to fig.colorbar(). Then the > *boundaries* aren't used for ticking (but still for plotting). > > Friedrich > -- Ariel Rokem Helen Wills Neuroscience Institute University of California, Berkeley http://argentum.ucbso.berkeley.edu/ariel |
From: <Rac...@HM...> - 2010-03-30 03:35:59
|
Hello, This is my first time trying out this list, so please forgive me if I've doing this wrong. I'm trying to create a plot that has its origin in the upper-left hand corner, rather than the lower-left hand corner. I've discovered that I get the same effect if I do: plt.plot( xcoords, ycoords, 'ro' ) plt.axis( [0, maxX, maxY, 0] ) However, the x-axis still appears on the bottom of the graph rather than the top. Is there a way that I can shift the location of the origin more easily, or at least shift where the axis is written at? Thanks! |
From: Mathew Y. <mat...@gm...> - 2010-03-29 23:05:49
|
Solved. Sort of. If I run using python it works. It fails if I run using ipython with --pylab. On Mon, Mar 29, 2010 at 3:46 PM, Mathew Yeates <mat...@gm...> wrote: > I don't understand why the following fails. > > fig = Figure(figsize=(5,5), dpi=100) > canvas = FigureCanvas(fig) > ax = fig.add_subplot(111) > m = Basemap(resolution='c',projection='cyl',lon_0=0,ax=ax) > m.drawcoastlines(color='gray',ax=ax) > > fails with > mpl_toolkits\basemap\__init__.pyc in set_axes_limits .... > 2531 if is_interactive(): > 2532 figManager = _pylab_helpers.Gcf.get_active() > -> 2533 figManager.canvas.draw() > > AttributeError: 'NoneType' object has no attribute 'canvas' > > Why isn't my figure being set as active?? > > Mathew > > > > > > > > > On Mon, Mar 29, 2010 at 11:12 AM, Yeates, Mathew C (388D) < > mat...@jp...> wrote: > >> Hi >> >> Anyone have an example? I found some older examples which no longer work. >> >> >> >> TIA >> >> >> >> Mathew >> >> >> >> For grins …. The following does not work. I’ve tried many different >> variations … >> >> >> >> import matplotlib.pyplot as plt >> >> >> >> import gtk >> >> from mpl_toolkits.basemap import Basemap >> >> import matplotlib >> >> from matplotlib.figure import Figure >> >> fig=plt.Figure() >> >> ax=fig.add_subplot(111) >> >> m = Basemap(llcrnrlon=1, \ >> >> llcrnrlat=40.6, \ >> >> urcrnrlon=8.8, \ >> >> urcrnrlat = 49.6, \ >> >> projection = 'tmerc', \ >> >> lon_0 = 4.9, \ >> >> lat_0 = 45.1,ax=ax) >> >> >> >> from matplotlib.backends.backend_gtkagg import \ >> >> FigureCanvasGTKAgg as FigureCanvas >> >> canvas = FigureCanvas(fig) >> >> m.drawcoastlines(color='gray') >> >> m.drawcountries(color='gray') >> >> m.fillcontinents(color='beige') >> >> builder = gtk.Builder() >> >> builder.add_from_file("fluxtool.glade") >> >> window1=builder.get_object("window1") >> >> window1.connect("destroy", lambda x: gtk.main_quit()) >> >> >> >> >> >> vbox=builder.get_object("vbox1") >> >> vbox.pack_start(canvas) >> >> window1.show() >> >> gtk.main() >> >> >> >> >> ------------------------------------------------------------------------------ >> Download Intel® Parallel Studio Eval >> Try the new software tools for yourself. Speed compiling, find bugs >> proactively, and fine-tune applications for parallel performance. >> See why Intel Parallel Studio got high marks during beta. >> http://p.sf.net/sfu/intel-sw-dev >> _______________________________________________ >> Matplotlib-users mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> >> > |
From: Mathew Y. <mat...@gm...> - 2010-03-29 22:46:38
|
I don't understand why the following fails. fig = Figure(figsize=(5,5), dpi=100) canvas = FigureCanvas(fig) ax = fig.add_subplot(111) m = Basemap(resolution='c',projection='cyl',lon_0=0,ax=ax) m.drawcoastlines(color='gray',ax=ax) fails with mpl_toolkits\basemap\__init__.pyc in set_axes_limits .... 2531 if is_interactive(): 2532 figManager = _pylab_helpers.Gcf.get_active() -> 2533 figManager.canvas.draw() AttributeError: 'NoneType' object has no attribute 'canvas' Why isn't my figure being set as active?? Mathew On Mon, Mar 29, 2010 at 11:12 AM, Yeates, Mathew C (388D) < mat...@jp...> wrote: > Hi > > Anyone have an example? I found some older examples which no longer work. > > > > TIA > > > > Mathew > > > > For grins …. The following does not work. I’ve tried many different > variations … > > > > import matplotlib.pyplot as plt > > > > import gtk > > from mpl_toolkits.basemap import Basemap > > import matplotlib > > from matplotlib.figure import Figure > > fig=plt.Figure() > > ax=fig.add_subplot(111) > > m = Basemap(llcrnrlon=1, \ > > llcrnrlat=40.6, \ > > urcrnrlon=8.8, \ > > urcrnrlat = 49.6, \ > > projection = 'tmerc', \ > > lon_0 = 4.9, \ > > lat_0 = 45.1,ax=ax) > > > > from matplotlib.backends.backend_gtkagg import \ > > FigureCanvasGTKAgg as FigureCanvas > > canvas = FigureCanvas(fig) > > m.drawcoastlines(color='gray') > > m.drawcountries(color='gray') > > m.fillcontinents(color='beige') > > builder = gtk.Builder() > > builder.add_from_file("fluxtool.glade") > > window1=builder.get_object("window1") > > window1.connect("destroy", lambda x: gtk.main_quit()) > > > > > > vbox=builder.get_object("vbox1") > > vbox.pack_start(canvas) > > window1.show() > > gtk.main() > > > > > ------------------------------------------------------------------------------ > Download Intel® Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > |
From: Eric F. <ef...@ha...> - 2010-03-29 19:56:41
|
Sami-Matias Niemi wrote: > Hi, > > When using scatter plotting method and linestyles argument the output > seems to ignore the linestyles keyword value at least in SVN. Can > someone confirm this or did I misunderstood the functionality? Yes, scatter is designed to plot markers only, and it does ignore the linestyles kw. > > I am trying to make a plot where the colour of the line changes as a > function of data value, but I don't want that each point (marker) is > plotted separately, but that the colour changes smoothly. I believe > scatter method could be used when optional arguments "c = values" and > linestyles = 'solid' are used. However, independent what the > linestyles argument value is, I always get the markers plotted and no > line appears. We don't have anything that gives this behavior directly, but it can be simulated with a LineCollection. See http://www.scipy.org/Cookbook/Matplotlib/MulticoloredLine. Eric > > > Cheers, > Sami > > > Example code (markers, but no solid line!?): > > import numpy as np > import pylab as p > > data = np.arange(10) > > p.scatter(data, data, c = data, s = data*10, linestyles = 'solid') > > > > ------------------------------------------------------------------------------ > Download Intel® Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
From: Yeates, M. C (388D) <mat...@jp...> - 2010-03-29 18:13:24
|
Hi Anyone have an example? I found some older examples which no longer work. TIA Mathew For grins .... The following does not work. I've tried many different variations ... import matplotlib.pyplot as plt import gtk from mpl_toolkits.basemap import Basemap import matplotlib from matplotlib.figure import Figure fig=plt.Figure() ax=fig.add_subplot(111) m = Basemap(llcrnrlon=1, \ llcrnrlat=40.6, \ urcrnrlon=8.8, \ urcrnrlat = 49.6, \ projection = 'tmerc', \ lon_0 = 4.9, \ lat_0 = 45.1,ax=ax) from matplotlib.backends.backend_gtkagg import \ FigureCanvasGTKAgg as FigureCanvas canvas = FigureCanvas(fig) m.drawcoastlines(color='gray') m.drawcountries(color='gray') m.fillcontinents(color='beige') builder = gtk.Builder() builder.add_from_file("fluxtool.glade") window1=builder.get_object("window1") window1.connect("destroy", lambda x: gtk.main_quit()) vbox=builder.get_object("vbox1") vbox.pack_start(canvas) window1.show() gtk.main() |
From: Sami-Matias N. <ni...@st...> - 2010-03-29 18:01:06
|
Hi, When using scatter plotting method and linestyles argument the output seems to ignore the linestyles keyword value at least in SVN. Can someone confirm this or did I misunderstood the functionality? I am trying to make a plot where the colour of the line changes as a function of data value, but I don't want that each point (marker) is plotted separately, but that the colour changes smoothly. I believe scatter method could be used when optional arguments "c = values" and linestyles = 'solid' are used. However, independent what the linestyles argument value is, I always get the markers plotted and no line appears. Cheers, Sami Example code (markers, but no solid line!?): import numpy as np import pylab as p data = np.arange(10) p.scatter(data, data, c = data, s = data*10, linestyles = 'solid') |
From: Thomas R. <tho...@gm...> - 2010-03-29 17:55:04
|
Hi Jae-Joon, Thanks for your quick reply! Since for example LineCollections can be created independent of the Axes in which they are going to be plotted through the creation of a LineCollection instance, would it not be possible to have a method that allows one to retrieve an Axes-independent LineCollection from an Axes instance? (for example a get_collection method) This would then allow one to 'recycle' existing collections. Cheers, Thomas On Mar 29, 2010, at 1:40 PM, Jae-Joon Lee wrote: > As far as I can say, moving around artists from one axes to the other > is NOT recommended. And I encourage you to create separate artists for > each axes rather than try to reuse the existing ones. > > For your particular example, > > fig = mpl.figure() > ax2 = fig.add_subplot(1,1,1) > for c in ax1.collections: > c._transOffset=ax2.transData > ax2.add_collection(c) > > should work. > > Regards, > > -JJ > > > > > On Mon, Mar 29, 2010 at 12:24 PM, Thomas Robitaille > <tho...@gm...> wrote: >> Hello, >> >> In the following example, I am trying to copy over existing collections from one plot to another: >> >> import matplotlib.pyplot as mpl >> >> fig = mpl.figure() >> ax1 = fig.add_subplot(1,1,1) >> ax1.scatter([0.5],[0.5]) >> fig.savefig('test1.png') >> >> fig = mpl.figure() >> ax2 = fig.add_subplot(1,1,1) >> for c in ax1.collections: >> ax2.add_collection(c) >> fig.savefig('test2.png') >> >> However, the circle appears in the wrong place in test2.png (close to 0.4, 0.4 instead of 0.5,0.5). Is it not possible/safe to copy over collections in this way? If not, then how should this be done? >> >> Thanks, >> >> Thomas >> ------------------------------------------------------------------------------ >> Download Intel® Parallel Studio Eval >> Try the new software tools for yourself. Speed compiling, find bugs >> proactively, and fine-tune applications for parallel performance. >> See why Intel Parallel Studio got high marks during beta. >> http://p.sf.net/sfu/intel-sw-dev >> _______________________________________________ >> Matplotlib-users mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> |
From: yogesh k. <yog...@gm...> - 2010-03-29 17:53:07
|
Dear All, I want to make minor ticks working in following program. Here only major ticks are dis[played in grpah though i have declared the minor ticks minorticks_on() doesnt work in my code. How to fix that.Please help me out.Thanks in advance !!!!!!!!!!!!' Regards Yogesh from numpy import * from scipy import * from scipy import signal, misc import sys,time,os,gc import matplotlib import matplotlib.pyplot as plt from numpy.random import * from pylab import plot, show, ylim, yticks,xlim from pylab import * x=loadtxt('/home/jaguar/Desktop/45.txt') x=x[0:1399] y=arange(len(x)) plt.figure(2) plt.plot(y,x,'k-') #minorticks_on() grid(True)#, color="r", ls="-") gca().xaxis.grid(True, which="minor", color="r") #gca().yaxis.grid(True, which='minor') #grid(True, which="minor", color="r") show()#l |
From: Jae-Joon L. <lee...@gm...> - 2010-03-29 17:41:02
|
As far as I can say, moving around artists from one axes to the other is NOT recommended. And I encourage you to create separate artists for each axes rather than try to reuse the existing ones. For your particular example, fig = mpl.figure() ax2 = fig.add_subplot(1,1,1) for c in ax1.collections: c._transOffset=ax2.transData ax2.add_collection(c) should work. Regards, -JJ On Mon, Mar 29, 2010 at 12:24 PM, Thomas Robitaille <tho...@gm...> wrote: > Hello, > > In the following example, I am trying to copy over existing collections from one plot to another: > > import matplotlib.pyplot as mpl > > fig = mpl.figure() > ax1 = fig.add_subplot(1,1,1) > ax1.scatter([0.5],[0.5]) > fig.savefig('test1.png') > > fig = mpl.figure() > ax2 = fig.add_subplot(1,1,1) > for c in ax1.collections: > ax2.add_collection(c) > fig.savefig('test2.png') > > However, the circle appears in the wrong place in test2.png (close to 0.4, 0.4 instead of 0.5,0.5). Is it not possible/safe to copy over collections in this way? If not, then how should this be done? > > Thanks, > > Thomas > ------------------------------------------------------------------------------ > Download Intel® Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
From: Thomas R. <tho...@gm...> - 2010-03-29 16:25:01
|
Hello, In the following example, I am trying to copy over existing collections from one plot to another: import matplotlib.pyplot as mpl fig = mpl.figure() ax1 = fig.add_subplot(1,1,1) ax1.scatter([0.5],[0.5]) fig.savefig('test1.png') fig = mpl.figure() ax2 = fig.add_subplot(1,1,1) for c in ax1.collections: ax2.add_collection(c) fig.savefig('test2.png') However, the circle appears in the wrong place in test2.png (close to 0.4, 0.4 instead of 0.5,0.5). Is it not possible/safe to copy over collections in this way? If not, then how should this be done? Thanks, Thomas |
From: Atomfried <mx...@us...> - 2010-03-29 15:24:08
|
Hi Matthias, Thanks for the help. The problem is, however, that the 'extent' parameter only manipulates the range of the (integer) values on the axis. Before setting the *axis_date property, I need to set the axes data to arrays of (non-equidistant) floats. Best Regards, Micha Matthias Michler wrote: > > > Did you already set the date-xaxis by hand? > -> for axes 'ax' using e.g. > ax.xaxis_date(tz=None) > ax.yaxis_date(tz=None) > > -- View this message in context: http://old.nabble.com/matshow---imshow-with-date-axis-tp28068228p28070890.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
From: Eric F. <ef...@ha...> - 2010-03-29 13:57:02
|
Friedrich Romstedt wrote: > 2010/3/29 Eric Firing <ef...@ha...>: >> It already has this. You can pass in a custom locator or set of tick >> locations via the "ticks" kwarg, but if you don't, a locator is chosen >> automatically. Except in special cases, this will be a MaxNLocator. See the >> ColorbarBase._ticker method. > > Ah, thanks, It escaped my notice that there is a toplevel "if > self.locator is None:" statement ... ok. > >> Ah, maybe what you mean is a text option to the "ticks" kwarg that would >> specify MaxNLocator without requiring one to instantiate a MaxNLocator? I >> don't think this makes sense for the case when boundaries are specified >> explicitly. > > No, what I intended is exactly what you pointed out. > > Btw, can you tell me what the *values* kwarg's semantic is? I guess, > it shall be the center values of the values displayed, but then the > implementation for this in ColorbarBase._process_values() would be > broken. The ColorbarBase simply makes a strip of colored blocks, with their sizes and locations determined by the boundaries kwarg (together with the "spacing" kwarg) and their colors determined from the values kwarg via color mapping. If either or both of these kwargs is None, the boundaries and/or values will be generated in _process_values. The use of the non-default values kwarg is illustrated by the special-case handling of colorbars for contouring in the Colorbar class. Can you give a test case showing a problem with _process_values? > > Friedrich > > P.S.: I assume you have be caught by the "misconfiguration" of the > list that the sender is used as the default recipient, so I post back > to the list? The mpl lists have been unusual (at least compared to lists for numpy, scipy, and cython) in this respect for years. Usually I remember to reply to all, but you are right--this time I goofed. Eric |
From: Friedrich R. <fri...@gm...> - 2010-03-29 13:41:39
|
2010/3/29 Friedrich Romstedt <fri...@gm...>: > Note that the ticking is a bit weird, there is also a bug in > matplotlib I will report on right after this e-mail, whose bugfix you > will maybe want to apply to get ticking properly working. When you > have insane values for C.min() and C.max() anyway, I'm afraid you have > to retick manually with *ticks* to colorbar(). The ticker.MaxNLocator > is only used when not using the *boundaries* arg to colorbar(), > unfortunately. Otherwise it tries to create maximal many and less > than 11 ticks by using the lowest value and an appropriate step in > *boundaries*. I think the implementation of ticking is cumbersome and > never optimal. You can get rid of this night mare by giving the kwarg "ticks = matplotlib.ticker.MaxNLocator()" to fig.colorbar(). Then the *boundaries* aren't used for ticking (but still for plotting). Friedrich |
From: Thomas R. <tho...@gm...> - 2010-03-29 13:12:23
|
Hello, It looks like the zlib website removes previous version of its library that were previously available for download, so the part in make.osx where http://www.zlib.net/zlib-1.2.3.tar.gz is fetched now fails (since the current version is 1.2.4). The error in the matplotlib building is not explicit enough (incorrect archive type) - maybe one could catch such 404s and print out an error suggesting to increase the ZLIBVERSION variable? I tried changing ZLIBVERSION to 1.2.4 and the following occurs when building zlib: ... gcc -arch i386 -arch x86_64 -I/Users/tom/install/include -I/Users/tom/install/include/freetype2 -isysroot /Developer/SDKs/MacOSX10.6.sdk -c -o inftrees.o inftrees.c gcc -arch i386 -arch x86_64 -I/Users/tom/install/include -I/Users/tom/install/include/freetype2 -isysroot /Developer/SDKs/MacOSX10.6.sdk -c -o trees.o trees.c gcc -arch i386 -arch x86_64 -I/Users/tom/install/include -I/Users/tom/install/include/freetype2 -isysroot /Developer/SDKs/MacOSX10.6.sdk -c -o uncompr.o uncompr.c gcc -arch i386 -arch x86_64 -I/Users/tom/install/include -I/Users/tom/install/include/freetype2 -isysroot /Developer/SDKs/MacOSX10.6.sdk -c -o zutil.o zutil.c make[1]: *** No rule to make target `libz.dylib', needed by `install-libs'. Stop. make[1]: *** Waiting for unfinished jobs.... make: *** [zlib] Error 2 If I manually go to the zlib directory and type make, it builds without a problem, so it looks like there is some kind of problem in the make.osx script. Thanks in advance for any help, Thomas |
From: Friedrich R. <fri...@gm...> - 2010-03-29 12:35:33
|
2010/3/29 Eric Firing <ef...@ha...>: > It already has this. You can pass in a custom locator or set of tick > locations via the "ticks" kwarg, but if you don't, a locator is chosen > automatically. Except in special cases, this will be a MaxNLocator. See the > ColorbarBase._ticker method. Ah, thanks, It escaped my notice that there is a toplevel "if self.locator is None:" statement ... ok. > Ah, maybe what you mean is a text option to the "ticks" kwarg that would > specify MaxNLocator without requiring one to instantiate a MaxNLocator? I > don't think this makes sense for the case when boundaries are specified > explicitly. No, what I intended is exactly what you pointed out. Btw, can you tell me what the *values* kwarg's semantic is? I guess, it shall be the center values of the values displayed, but then the implementation for this in ColorbarBase._process_values() would be broken. Friedrich P.S.: I assume you have be caught by the "misconfiguration" of the list that the sender is used as the default recipient, so I post back to the list? |