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
(12) |
2
(14) |
3
(13) |
4
(6) |
5
(6) |
6
(21) |
7
(29) |
8
(30) |
9
(13) |
10
(4) |
11
(4) |
12
(4) |
13
(15) |
14
(22) |
15
(23) |
16
(23) |
17
(9) |
18
(23) |
19
(12) |
20
(10) |
21
(26) |
22
(5) |
23
(32) |
24
(5) |
25
(7) |
26
(4) |
27
(3) |
28
(19) |
29
(20) |
|
|
|
Hello all. I have a rather long code and get always a strange error: can't invoke "event" command: application has been destroyed while executing "event generate $w " (procedure "ttk::ThemeChanged" line 6) invoked from within "ttk::ThemeChanged" The code is too long but I found some other code that produces exactly same type of error (see below). Does anybody have an idea what can be done in this case? Thx for some help. Frank. I use: Ubuntu 10.10, 64 bit, Tkinter, Python 2.6, etc ... *************************************************************** import matplotlib.pyplot as plt fig1 = plt.figure() plt.plot(range(10), 'ro-') plt.title('This figure will be saved but not shown') fig1.savefig('fig1.png') plt.close(fig1) fig2 = plt.figure() plt.plot(range(10), 'bo') plt.title('This figure will be shown') plt.show()
On 02/18/2012 01:14 PM, Michael Rawlins wrote: > > ------------------------------------------------------------------------ > *From:* Eric Firing <ef...@ha...> > *To:* Michael Rawlins <raw...@ya...> > *Cc:* "mat...@li..." > <mat...@li...> > *Sent:* Saturday, February 18, 2012 5:42 PM > *Subject:* Re: [Matplotlib-users] installed python-scipy causing errors > with numpy > > On 02/18/2012 11:54 AM, Michael Rawlins wrote: > > > > > > The version of numpy I installed last month from source is 1.61. I've > > just found a couple files: > > > > /usr/bin/numpy-1.6.1/doc/release/1.3.0-notes.rst > > This looks wrong. Did you untar the tarball in /usr/bin? Don't. Untar > it in some non-system location, maybe a subdirectory of your home > directory, and then > > cd numpy > python setup.py build > sudo python setup.py install > > > Thanks. Yes, I did untar numpy.tar in /usr/bin. Won't do that again. > When I installed matplotlib I untared that tarball in a subdirectory of > my home directory. > > Any suggestions for being sure I completely remove all potentially > conflicting traces of numpy and matplotlib before reinstall? I usually > use the locate command to find files with those names in them. As you > know, the files are most often found in just a few directories. > > Mike Mike, I think that using synaptic to uninstall what you installed with synaptic, together with manually removing the misplaced untarred tree, should take care of everything. locate is indeed very helpful, but don't forget that its database is updated at intervals, not continuously. Eric
________________________________ From: Eric Firing <ef...@ha...> To: Michael Rawlins <raw...@ya...> Cc: "mat...@li..." <mat...@li...> Sent: Saturday, February 18, 2012 5:42 PM Subject: Re: [Matplotlib-users] installed python-scipy causing errors with numpy On 02/18/2012 11:54 AM, Michael Rawlins wrote: > > > The version of numpy I installed last month from source is 1.61. I've > just found a couple files: > > /usr/bin/numpy-1.6.1/doc/release/1.3.0-notes.rst This looks wrong. Did you untar the tarball in /usr/bin? Don't. Untar it in some non-system location, maybe a subdirectory of your home directory, and then cd numpy python setup.py build sudo python setup.py install Thanks. Yes, I did untar numpy.tar in /usr/bin. Won't do that again. When I installed matplotlib I untared that tarball in a subdirectory of my home directory. Any suggestions for being sure I completely remove all potentially conflicting traces of numpy and matplotlib before reinstall? I usually use the locate command to find files with those names in them. As you know, the files are most often found in just a few directories. Mike
I created an issue here: https://github.com/matplotlib/matplotlib/issues/707 On 02/18/2012 11:00 AM, Benjamin Root wrote: > > > On Saturday, February 18, 2012, Jerzy Karczmarczuk wrote: > > Saurav Pathak : > > I am trying to generate key press events in matplotlib (imshow) > embedded > > in pyqt4, but I am getting nowhere. > Yes, another victim... > > My small animation test program > > http://users.info.unicaen.fr/~karczma/TEACH/Test/isingVZ.py > <http://users.info.unicaen.fr/%7Ekarczma/TEACH/Test/isingVZ.py> > > run under Windows XP / Python 2.7, shows the following > > 1. For WX and GTK the timing doesn't work properly. > 2. For QT4 key event processing doesn't work > > Only Ye Olde Tkinter backend seems to behave decently. > Well, the animation in matplotlib - as I have already mentioned some > week ago - is really imperfect, and should be re-analysed (in > particular > not giving to the user the access to the event loop is a severe > handycap). Now I see that events in general need to be looked into in > details. I feel sorry that I have no time to dig more thoroughly. > (Of course, I may be doing some rubbish..., then mes plus plates > excuses). > > Jerzy Karczmarczuk > > > > Please file bug reports on these issues, as they are critical. > > Ben Root > > > ------------------------------------------------------------------------------ > Virtualization& Cloud Management Using Capacity Planning > Cloud computing makes use of virtualization - but cloud computing > also focuses on allowing computing to be delivered as a service. > http://www.accelacomm.com/jaw/sfnl/114/51521223/ > > > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
On 02/18/2012 11:54 AM, Michael Rawlins wrote: > > > ------------------------------------------------------------------------ > *From:* Eric Firing <ef...@ha...> > *To:* Michael Rawlins <raw...@ya...> > *Cc:* "mat...@li..." > <mat...@li...> > *Sent:* Saturday, February 18, 2012 3:57 PM > *Subject:* Re: [Matplotlib-users] installed python-scipy causing errors > with numpy > > On 02/18/2012 10:49 AM, Michael Rawlins wrote: > > > > > > ------------------------------------------------------------------------ > > *From:* Eric Firing <ef...@ha... <mailto:ef...@ha...>> > > *To:* mat...@li... > <mailto:mat...@li...> > > *Sent:* Saturday, February 18, 2012 12:26 PM > > *Subject:* Re: [Matplotlib-users] installed python-scipy causing errors > > with numpy > > > > On 02/18/2012 07:17 AM, Michael Rawlins wrote: > > > > > > A couple weeks ago I installed version 1.2 from sources, as described > > here: > > > > > > http://matplotlib.sourceforge.net/users/installing.html > > > > > > I'm running Ubuntu 10.04 LTS. Everything was working fine. Looks like > > > numpy version 1.3 in place. A few minutes ago I installed python-scipy > > > from the Ubuntu Synaptic package manager. Getting this any time I run a > > > program: > > > > > > >python colorbar_testing.py <http://colorbar_testing.py> > <http://colorbar_testing.py> > > > Traceback (most recent call last): > > > File "colorbar_testing.py", line 5, in <module> > > > from matplotlib import pyplot, mpl > > > File "/usr/local/lib/python2.6/dist-packages/matplotlib/__init__.py", > > > line 173, in <module> > > > __version__numpy__, numpy.__version__)) > > > ImportError: numpy 1.4 or later is required; you have 1.3.0 > > > > > > > > > Version control with python, matplotlib, numpy, etc problematic when > > > compiled from source? Shall I reinstall everything again, including > > > python-scipy? What order? Thanks. > > > > You need to remove your numpy and scipy packages and install both of > > these from source (just use the most recent releases), and then rebuild > > matplotlib. Numpy has to be installed before building either scipy or > > mpl, but mpl and scipy are independent of each other so either can be > > built once a suitable numpy is there. > > > > Eric > > > > > > > > Thanks Eric. One things escapes me. Are scipy and python redundant? > > Should both be installed? > > > > I'd installed numpy and matplotlib from source. Working right now on > > locating and remove all traces of those programs before re-installing. > > Can python 2.6 that I installed through Synapic Package manager stay in > > place. Perhaps I should remove it too just to be sure everything works > > right? > > No! The python 2.6 package is perfectly fine. Try to remove that, and > you are likely to hose your whole system. It sounds like your only > problem was that you had the numpy package installed, and it was being > found instead of the one installed from source. > > Eric > > > I don't understand what you mean when you say "...you had the numpy > package installed,.." Are you saying a version of numpy came along with > scipy, and that was the one "being found"? Also, to run programs which No, scipy builds on numpy but does not include it. > need scipy.stats I'll have to again install scipy. When I did that using > Synaptic it broke my system. In summary, I don't understand what caused Installing the scipy package will pull in numpy as its dependency, so if you need a newer version of numpy, as you do for mpl, then you also need to remove any packages that depend on it and install them from source. > the problem. Shall I install scipy from source? Yes, after completely removing the numpy package and installing numpy from source. > > The version of numpy I installed last month from source is 1.61. I've > just found a couple files: > > /usr/bin/numpy-1.6.1/doc/release/1.3.0-notes.rst This looks wrong. Did you untar the tarball in /usr/bin? Don't. Untar it in some non-system location, maybe a subdirectory of your home directory, and then cd numpy python setup.py build sudo python setup.py install which should install in /usr/local/lib/python2.6/dist-packages. Same drill for scipy and matplotlib. The idea is that synaptic packages get installed in the /usr tree, and anything you install from source gets installed in the /usr/local tree, so they don't get mixed up. > /usr/lib/python2.6/dist-packages/numpy-1.3.0.egg-info. Not good. This is from the ubuntu package. > > I'll assume those numbers 1.3.0 are not an issue. I wouldn't assume that. Things seem rather scrambled up. Eric > > Mike >
________________________________ From: Eric Firing <ef...@ha...> To: Michael Rawlins <raw...@ya...> Cc: "mat...@li..." <mat...@li...> Sent: Saturday, February 18, 2012 3:57 PM Subject: Re: [Matplotlib-users] installed python-scipy causing errors with numpy On 02/18/2012 10:49 AM, Michael Rawlins wrote: > > > ------------------------------------------------------------------------ > *From:* Eric Firing <ef...@ha...> > *To:* mat...@li... > *Sent:* Saturday, February 18, 2012 12:26 PM > *Subject:* Re: [Matplotlib-users] installed python-scipy causing errors > with numpy > > On 02/18/2012 07:17 AM, Michael Rawlins wrote: > > > > A couple weeks ago I installed version 1.2 from sources, as described > here: > > > > http://matplotlib.sourceforge.net/users/installing.html > > > > I'm running Ubuntu 10.04 LTS. Everything was working fine. Looks like > > numpy version 1.3 in place. A few minutes ago I installed python-scipy > > from the Ubuntu Synaptic package manager. Getting this any time I run a > > program: > > > > >python colorbar_testing.py <http://colorbar_testing.py> > > Traceback (most recent call last): > > File "colorbar_testing.py", line 5, in <module> > > from matplotlib import pyplot, mpl > > File "/usr/local/lib/python2.6/dist-packages/matplotlib/__init__.py", > > line 173, in <module> > > __version__numpy__, numpy.__version__)) > > ImportError: numpy 1.4 or later is required; you have 1.3.0 > > > > > > Version control with python, matplotlib, numpy, etc problematic when > > compiled from source? Shall I reinstall everything again, including > > python-scipy? What order? Thanks. > > You need to remove your numpy and scipy packages and install both of > these from source (just use the most recent releases), and then rebuild > matplotlib. Numpy has to be installed before building either scipy or > mpl, but mpl and scipy are independent of each other so either can be > built once a suitable numpy is there. > > Eric > > > > Thanks Eric. One things escapes me. Are scipy and python redundant? > Should both be installed? > > I'd installed numpy and matplotlib from source. Working right now on > locating and remove all traces of those programs before re-installing. > Can python 2.6 that I installed through Synapic Package manager stay in > place. Perhaps I should remove it too just to be sure everything works > right? No! The python 2.6 package is perfectly fine. Try to remove that, and you are likely to hose your whole system. It sounds like your only problem was that you had the numpy package installed, and it was being found instead of the one installed from source. Eric I don't understand what you mean when you say "...you had the numpy package installed,.." Are you saying a version of numpy came along with scipy, and that was the one "being found"? Also, to run programs which need scipy.stats I'll have to again install scipy. When I did that using Synaptic it broke my system. In summary, I don't understand what caused the problem. Shall I install scipy from source? The version of numpy I installed last month from source is 1.61. I've just found a couple files: /usr/bin/numpy-1.6.1/doc/release/1.3.0-notes.rst /usr/lib/python2.6/dist-packages/numpy-1.3.0.egg-info. I'll assume those numbers 1.3.0 are not an issue. Mike
On 02/18/2012 10:49 AM, Michael Rawlins wrote: > > > ------------------------------------------------------------------------ > *From:* Eric Firing <ef...@ha...> > *To:* mat...@li... > *Sent:* Saturday, February 18, 2012 12:26 PM > *Subject:* Re: [Matplotlib-users] installed python-scipy causing errors > with numpy > > On 02/18/2012 07:17 AM, Michael Rawlins wrote: > > > > A couple weeks ago I installed version 1.2 from sources, as described > here: > > > > http://matplotlib.sourceforge.net/users/installing.html > > > > I'm running Ubuntu 10.04 LTS. Everything was working fine. Looks like > > numpy version 1.3 in place. A few minutes ago I installed python-scipy > > from the Ubuntu Synaptic package manager. Getting this any time I run a > > program: > > > > >python colorbar_testing.py <http://colorbar_testing.py> > > Traceback (most recent call last): > > File "colorbar_testing.py", line 5, in <module> > > from matplotlib import pyplot, mpl > > File "/usr/local/lib/python2.6/dist-packages/matplotlib/__init__.py", > > line 173, in <module> > > __version__numpy__, numpy.__version__)) > > ImportError: numpy 1.4 or later is required; you have 1.3.0 > > > > > > Version control with python, matplotlib, numpy, etc problematic when > > compiled from source? Shall I reinstall everything again, including > > python-scipy? What order? Thanks. > > You need to remove your numpy and scipy packages and install both of > these from source (just use the most recent releases), and then rebuild > matplotlib. Numpy has to be installed before building either scipy or > mpl, but mpl and scipy are independent of each other so either can be > built once a suitable numpy is there. > > Eric > > > > Thanks Eric. One things escapes me. Are scipy and python redundant? > Should both be installed? > > I'd installed numpy and matplotlib from source. Working right now on > locating and remove all traces of those programs before re-installing. > Can python 2.6 that I installed through Synapic Package manager stay in > place. Perhaps I should remove it too just to be sure everything works > right? No! The python 2.6 package is perfectly fine. Try to remove that, and you are likely to hose your whole system. It sounds like your only problem was that you had the numpy package installed, and it was being found instead of the one installed from source. Eric > > Mike > >
________________________________ From: Eric Firing <ef...@ha...> To: mat...@li... Sent: Saturday, February 18, 2012 12:26 PM Subject: Re: [Matplotlib-users] installed python-scipy causing errors with numpy On 02/18/2012 07:17 AM, Michael Rawlins wrote: > > A couple weeks ago I installed version 1.2 from sources, as described here: > > http://matplotlib.sourceforge.net/users/installing.html > > I'm running Ubuntu 10.04 LTS. Everything was working fine. Looks like > numpy version 1.3 in place. A few minutes ago I installed python-scipy > from the Ubuntu Synaptic package manager. Getting this any time I run a > program: > > >python colorbar_testing.py > Traceback (most recent call last): > File "colorbar_testing.py", line 5, in <module> > from matplotlib import pyplot, mpl > File "/usr/local/lib/python2.6/dist-packages/matplotlib/__init__.py", > line 173, in <module> > __version__numpy__, numpy.__version__)) > ImportError: numpy 1.4 or later is required; you have 1.3.0 > > > Version control with python, matplotlib, numpy, etc problematic when > compiled from source? Shall I reinstall everything again, including > python-scipy? What order? Thanks. You need to remove your numpy and scipy packages and install both of these from source (just use the most recent releases), and then rebuild matplotlib. Numpy has to be installed before building either scipy or mpl, but mpl and scipy are independent of each other so either can be built once a suitable numpy is there. Eric Thanks Eric. One things escapes me. Are scipy and python redundant? Should both be installed? I'd installed numpy and matplotlib from source. Working right now on locating and remove all traces of those programs before re-installing. Can python 2.6 that I installed through Synapic Package manager stay in place. Perhaps I should remove it too just to be sure everything works right? Mike
On Saturday, February 18, 2012, Tony Yu wrote: > > > On Tue, Feb 14, 2012 at 12:49 PM, Olе Streicher <ole...@gm...<javascript:_e({}, 'cvml', 'ole...@gm...');> > > wrote: > >> Jerzy Karczmarczuk >> <jer...@un... <javascript:_e({}, 'cvml', >> 'jer...@un...');>> writes: >> > Could you provide a /working/ example with the geometry you really want? >> > I believe I thought more or less about it as Tony Yu did. If it is >> > wrong, be more precise, please. >> >> I have a data set that looks like this: >> >> mydata = numpy.copy([ >> >> # lambda, data >> >> # First data row >> [[5002., 0.5], >> [5200., 0.34], >> [5251., -1.2], >> # ... >> [8997., 2.4]], >> >> # second data row >> [[5002., 0.72], >> [5251., 0.9], >> # ... >> [8997., 0.1]], >> >> # other data rows to follow >> # ... >> ]) >> >> where I want to put the first column (lambda) on the Y axis, which each >> data row as one colorbar (like in your code), and the data as the color >> of that data point -- interpolated vertically. >> >> Best regards >> >> Ole >> >> > OK, I see now. > > Unfortunately, this makes it quite a bit more complex, but it's still > doable. Part of the complexity arises because of (what I believe to be) a > quirk in NonUniformImage: You can pass an extent argument, but this only > rescales the data---it doesn't clip the data. You have to manually clip the > borders of each bar. > > Here's an example: > > #--- > import numpy as np > import matplotlib.pyplot as plt > from matplotlib.image import NonUniformImage > > width = 0.5 > height = 10 > > ax = plt.gca() > > for x0 in np.arange(11): > y = np.sort(np.random.uniform(high=height, size=10)) > z = np.random.random(size=(10, 1)) > # Note NonUniformImage fails with single column; double up data > z = np.repeat(z, 2, axis=1) > x = [x0, x0] > > extent = (x0-width/2., x0+width/2, y[0], y[-1]) > im = NonUniformImage(ax, interpolation='bilinear', extent=extent) > im.set_data(x, y, z) > > # clip image > x_left = extent[0] > xm = [x_left, x_left + width, x_left + width, x_left] > ym = [0, 0, height, height] > mask, = ax.fill(xm, ym, facecolor='none', edgecolor='none') > im.set_clip_path(mask) > > ax.images.append(im) > > ax.set_xlim(-width, x0+width) > > plt.show() > #--- > > HTH, > -Tony > Not a quirk. Extent is used to define a domain for the passed in data. If none is given, one is assumed from the input data. If you want clipping, either set x and y limits or pass in a slice of the data. Ben Root
________________________________ From: Eric Firing <ef...@ha...> To: mat...@li... Sent: Saturday, February 18, 2012 12:26 PM Subject: Re: [Matplotlib-users] installed python-scipy causing errors with numpy On 02/18/2012 07:17 AM, Michael Rawlins wrote: > > A couple weeks ago I installed version 1.2 from sources, as described here: > > http://matplotlib.sourceforge.net/users/installing.html > > I'm running Ubuntu 10.04 LTS. Everything was working fine. Looks like > numpy version 1.3 in place. A few minutes ago I installed python-scipy > from the Ubuntu Synaptic package manager. Getting this any time I run a > program: > > >python colorbar_testing.py > Traceback (most recent call last): > File "colorbar_testing.py", line 5, in <module> > from matplotlib import pyplot, mpl > File "/usr/local/lib/python2.6/dist-packages/matplotlib/__init__.py", > line 173, in <module> > __version__numpy__, numpy.__version__)) > ImportError: numpy 1.4 or later is required; you have 1.3.0 > > > Version control with python, matplotlib, numpy, etc problematic when > compiled from source? Shall I reinstall everything again, including > python-scipy? What order? Thanks. You need to remove your numpy and scipy packages and install both of these from source (just use the most recent releases), and then rebuild matplotlib. Numpy has to be installed before building either scipy or mpl, but mpl and scipy are independent of each other so either can be built once a suitable numpy is there. Eric I did not mention that I already had python 2.6 installed when I
On Tue, Feb 14, 2012 at 12:49 PM, Olе Streicher <ole...@gm...>wrote: > Jerzy Karczmarczuk > <jer...@un...> writes: > > Could you provide a /working/ example with the geometry you really want? > > I believe I thought more or less about it as Tony Yu did. If it is > > wrong, be more precise, please. > > I have a data set that looks like this: > > mydata = numpy.copy([ > > # lambda, data > > # First data row > [[5002., 0.5], > [5200., 0.34], > [5251., -1.2], > # ... > [8997., 2.4]], > > # second data row > [[5002., 0.72], > [5251., 0.9], > # ... > [8997., 0.1]], > > # other data rows to follow > # ... > ]) > > where I want to put the first column (lambda) on the Y axis, which each > data row as one colorbar (like in your code), and the data as the color > of that data point -- interpolated vertically. > > Best regards > > Ole > > OK, I see now. Unfortunately, this makes it quite a bit more complex, but it's still doable. Part of the complexity arises because of (what I believe to be) a quirk in NonUniformImage: You can pass an extent argument, but this only rescales the data---it doesn't clip the data. You have to manually clip the borders of each bar. Here's an example: #--- import numpy as np import matplotlib.pyplot as plt from matplotlib.image import NonUniformImage width = 0.5 height = 10 ax = plt.gca() for x0 in np.arange(11): y = np.sort(np.random.uniform(high=height, size=10)) z = np.random.random(size=(10, 1)) # Note NonUniformImage fails with single column; double up data z = np.repeat(z, 2, axis=1) x = [x0, x0] extent = (x0-width/2., x0+width/2, y[0], y[-1]) im = NonUniformImage(ax, interpolation='bilinear', extent=extent) im.set_data(x, y, z) # clip image x_left = extent[0] xm = [x_left, x_left + width, x_left + width, x_left] ym = [0, 0, height, height] mask, = ax.fill(xm, ym, facecolor='none', edgecolor='none') im.set_clip_path(mask) ax.images.append(im) ax.set_xlim(-width, x0+width) plt.show() #--- HTH, -Tony
On 02/18/2012 07:17 AM, Michael Rawlins wrote: > > A couple weeks ago I installed version 1.2 from sources, as described here: > > http://matplotlib.sourceforge.net/users/installing.html > > I'm running Ubuntu 10.04 LTS. Everything was working fine. Looks like > numpy version 1.3 in place. A few minutes ago I installed python-scipy > from the Ubuntu Synaptic package manager. Getting this any time I run a > program: > > >python colorbar_testing.py > Traceback (most recent call last): > File "colorbar_testing.py", line 5, in <module> > from matplotlib import pyplot, mpl > File "/usr/local/lib/python2.6/dist-packages/matplotlib/__init__.py", > line 173, in <module> > __version__numpy__, numpy.__version__)) > ImportError: numpy 1.4 or later is required; you have 1.3.0 > > > Version control with python, matplotlib, numpy, etc problematic when > compiled from source? Shall I reinstall everything again, including > python-scipy? What order? Thanks. You need to remove your numpy and scipy packages and install both of these from source (just use the most recent releases), and then rebuild matplotlib. Numpy has to be installed before building either scipy or mpl, but mpl and scipy are independent of each other so either can be built once a suitable numpy is there. Eric
A couple weeks ago I installed version 1.2 from sources, as described here: http://matplotlib.sourceforge.net/users/installing.html I'm running Ubuntu 10.04 LTS. Everything was working fine. Looks like numpy version 1.3 in place. A few minutes ago I installed python-scipy from the Ubuntu Synaptic package manager. Getting this any time I run a program: >python colorbar_testing.py Traceback (most recent call last): File "colorbar_testing.py", line 5, in <module> from matplotlib import pyplot, mpl File "/usr/local/lib/python2.6/dist-packages/matplotlib/__init__.py", line 173, in <module> __version__numpy__, numpy.__version__)) ImportError: numpy 1.4 or later is required; you have 1.3.0 Version control with python, matplotlib, numpy, etc problematic when compiled from source? Shall I reinstall everything again, including python-scipy? What order? Thanks.
On Saturday, February 18, 2012, Jerzy Karczmarczuk wrote: > Saurav Pathak : > > I am trying to generate key press events in matplotlib (imshow) embedded > > in pyqt4, but I am getting nowhere. > Yes, another victim... > > My small animation test program > > http://users.info.unicaen.fr/~karczma/TEACH/Test/isingVZ.py > > run under Windows XP / Python 2.7, shows the following > > 1. For WX and GTK the timing doesn't work properly. > 2. For QT4 key event processing doesn't work > > Only Ye Olde Tkinter backend seems to behave decently. > Well, the animation in matplotlib - as I have already mentioned some > week ago - is really imperfect, and should be re-analysed (in particular > not giving to the user the access to the event loop is a severe > handycap). Now I see that events in general need to be looked into in > details. I feel sorry that I have no time to dig more thoroughly. > (Of course, I may be doing some rubbish..., then mes plus plates excuses). > > Jerzy Karczmarczuk > > > Please file bug reports on these issues, as they are critical. Ben Root
You're exactly right. That does fix it. Unfortunately, it means I have to refactor some of my code because the Pyside slot doesn't currently have access to the original data, but that's not a huge deal. Thanks, Ray On Feb 18, 2012, at 4:35 AM, Jerzy Karczmarczuk wrote: > Ray Osborn: >> >> OK - it turns out I can reproduce it in a simple ipython session using ipython --pylab=qt. >> >> I set up an image plot as follows: >> >> import numpy as np >> import matplotlib.pyplot as plt >> from matplotlib.image import NonUniformImage >> >> x=y=np.linspace(0,2*np.pi,101) >> X,Y=np.meshgrid(x,y) >> z=sin(X)*sin(Y) >> >> ax=plt.gca() >> extent = (x[0],x[-1],y[0],y[-1]) >> im = NonUniformImage(ax, extent=extent, origin=None) >> im.set_data(x,y,z) >> >> ax.images.append(im) >> ax.set_xlim(x[0],x[-1]) >> ax.set_ylim(y[0],y[-1]) >> >> plt.colorbar(im) >> >> plt.gcf().canvas.draw() >> >> >> After that, I try to change the color scale using: >> >> im.set_clim(0,0.5) >> plt.gcf().canvas.draw() >> >> The colorbar changes scale, but the plot is untouched. Is that the expected behavior? >> >> Thanks, >> Ray > > Try, perhaps, after set_clim, to reinstall the data: > > im.set_data(x,y,z) > plt.gcf().canvas.draw() > > = > > Jerzy Karczmarczuk > > ------------------------------------------------------------------------------ > Virtualization & Cloud Management Using Capacity Planning > Cloud computing makes use of virtualization - but cloud computing > also focuses on allowing computing to be delivered as a service. > http://www.accelacomm.com/jaw/sfnl/114/51521223/_______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Ray Osborn Materials Science Division Argonne National Laboratory Argonne, IL 60439, USA Phone: +1 (630) 252-9011 Email: RO...@an...
Saurav Pathak : > I am trying to generate key press events in matplotlib (imshow) embedded > in pyqt4, but I am getting nowhere. Yes, another victim... My small animation test program http://users.info.unicaen.fr/~karczma/TEACH/Test/isingVZ.py run under Windows XP / Python 2.7, shows the following 1. For WX and GTK the timing doesn't work properly. 2. For QT4 key event processing doesn't work Only Ye Olde Tkinter backend seems to behave decently. Well, the animation in matplotlib - as I have already mentioned some week ago - is really imperfect, and should be re-analysed (in particular not giving to the user the access to the event loop is a severe handycap). Now I see that events in general need to be looked into in details. I feel sorry that I have no time to dig more thoroughly. (Of course, I may be doing some rubbish..., then mes plus plates excuses). Jerzy Karczmarczuk
Hi, I am trying to generate key press events in matplotlib (imshow) embedded in pyqt4, but I am getting nowhere. My code is given below. Even though the imshow seems to work OK, there is no response when I press keys. I am using an mpl_connect self.canvas.mpl_connect('key_press_event', self.on_key_press) and define a function on_key_press: def on_key_press(self, event): print 'you pressed', event.key The complete code is given below. I hope someone will show me where I am going wrong. I am running this on Ubuntu, with python 2.6.x and matplotlib 1.1.0. Thanks for your help! Saurav ==code begins== import sys import numpy as np from matplotlib.figure import Figure from PyQt4.QtCore import * from PyQt4.QtGui import * from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas from matplotlib.backends.backend_qt4agg import NavigationToolbar2QTAgg as NavigationToolbar class AppForm(QMainWindow): def __init__(self, parent=None): QMainWindow.__init__(self, parent) self.data = self.get_data2() self.create_main_frame() self.on_draw() def create_main_frame(self): self.main_frame = QWidget() self.fig = Figure((5.0, 4.0), dpi=100) self.canvas = FigureCanvas(self.fig) self.canvas.setParent(self.main_frame) self.mpl_toolbar = NavigationToolbar(self.canvas, self.main_frame) self.canvas.mpl_connect('key_press_event', self.on_key_press) vbox = QVBoxLayout() vbox.addWidget(self.canvas) # the matplotlib canvas vbox.addWidget(self.mpl_toolbar) self.main_frame.setLayout(vbox) self.setCentralWidget(self.main_frame) def get_data2(self): return np.arange(20).reshape([4,5]).copy() def on_draw(self): self.fig.clear() self.axes = self.fig.add_subplot(111) #self.axes.plot(self.x, self.y, 'ro') self.axes.imshow(self.data, interpolation='nearest') self.canvas.draw() def on_key_press(self, event): print 'you pressed', event.key def main(): app = QApplication(sys.argv) form = AppForm() form.show() app.exec_() if __name__ == "__main__": main() ==code ends==
Ray Osborn: > OK - it turns out I can reproduce it in a simple ipython session using > ipython --pylab=qt. > > I set up an image plot as follows: > > import numpy as np > import matplotlib.pyplot as plt > from matplotlib.image import NonUniformImage > > x=y=np.linspace(0,2*np.pi,101) > X,Y=np.meshgrid(x,y) > z=sin(X)*sin(Y) > > ax=plt.gca() > extent = (x[0],x[-1],y[0],y[-1]) > im = NonUniformImage(ax, extent=extent, origin=None) > im.set_data(x,y,z) > > ax.images.append(im) > ax.set_xlim(x[0],x[-1]) > ax.set_ylim(y[0],y[-1]) > > plt.colorbar(im) > > plt.gcf().canvas.draw() > > > After that, I try to change the color scale using: > > im.set_clim(0,0.5) > plt.gcf().canvas.draw() > > The colorbar changes scale, but the plot is untouched. Is that the > expected behavior? > > Thanks, > Ray Try, perhaps, after set_clim, to reinstall the data: im.set_data(x,y,z) plt.gcf().canvas.draw() = Jerzy Karczmarczuk
would be great! Maybe you could submit it to matplotlib's github. On Sat, Dec 31, 2011 at 2:23 AM, fdu...@gm... <fdu...@gm...>wrote: > Dear all, > > I couldn't find a function to plot venn diagram with python, so I > written one for my daily use (with a lot inspirations from the internet > and R). Hope it could be of any help to someone else, so I put it on > github. The path to it is > https://github.com/icetime/pyinfor/blob/master/venn.py . > > I'm wondering if there is any chance that the function be included in > matplotlib. I think matplotlib need a function for venn diagram. > > Also, could someone kindly help to review the code, so I can make it > better? > > Any suggestions or comments will be greatly appreciated. Thanks a lot. > > Best Regards, > Jianfeng > > > > ------------------------------------------------------------------------------ > Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex > infrastructure or vast IT resources to deliver seamless, secure access to > virtual desktops. With this all-in-one solution, easily deploy virtual > desktops for less than the cost of PCs and save 60% on VDI infrastructure > costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users >
OK - it turns out I can reproduce it in a simple ipython session using ipython --pylab=qt. I set up an image plot as follows: import numpy as np import matplotlib.pyplot as plt from matplotlib.image import NonUniformImage x=y=np.linspace(0,2*np.pi,101) X,Y=np.meshgrid(x,y) z=sin(X)*sin(Y) ax=plt.gca() extent = (x[0],x[-1],y[0],y[-1]) im = NonUniformImage(ax, extent=extent, origin=None) im.set_data(x,y,z) ax.images.append(im) ax.set_xlim(x[0],x[-1]) ax.set_ylim(y[0],y[-1]) plt.colorbar(im) plt.gcf().canvas.draw() After that, I try to change the color scale using: im.set_clim(0,0.5) plt.gcf().canvas.draw() The colorbar changes scale, but the plot is untouched. Is that the expected behavior? Thanks, Ray On Feb 17, 2012, at 9:05 PM, Benjamin Root wrote: > > > On Friday, February 17, 2012, Ray Osborn wrote: > I am embedding a matplotlib canvas in a Pyside GUI and wanted to attach a slider to adjust the color scale of a 2D plot made using NonUnitformImage. I am connecting the slider value to im.set_clim([vmin,vmax]). I have got my axis sliders to work, but the intensity slider only adjusts the colorbar without touching the image itself. Is there some trick to making this work with NonUniformImage? > > My plotting routine has the following code: > > ax = plt.gca() > im = NonUniformImage(ax, extent=extent, origin=None, **opts) > im.set_data(x,y,z) > ax.images.append(im) > self.imgplot = im > plt.colorbar(im) > > while the Pyside slot has: > > zhi = self.zmin + (self.ztab.maxslider.value() * range / 100) > im = self.imgplot > im.set_clim([zlo,zhi]) > > The slider dynamically adjusts the colorbar beautifully, but leaves the color plot untouched. Any suggestions welcome. > > Thanks in advance, > Ray > > Without a more complete example, it is hard to say. Can you make a small stand-alone example that we can try out? > > Ben Root > -- Ray Osborn Materials Science Division Argonne National Laboratory Argonne, IL 60439, USA Phone: +1 (630) 252-9011 Email: RO...@an...
Andrea Gavana continues to struggle with his parallel lines: > I managed to get *almost* there, but there still is a small glitch. I > attach a self-evident sample, which generates data very similar to the > real ones I have and shows the two "parallel" curves to the main one. > > You will notice that the "parallel" curves look parallel almost all > the time, except in a few areas (I have annotated the plot for > reference). I can't see the reason for this difference, but it is > obvious I am missing something. Yes. I am afraid it it not a small glitch, but a serious bug. Actually, there are still two things. The second one is the purely visual scaling based on the aspect of your figure on the screen, and I will not discuss it now, you can get into your axes, pick the frame, dig out the extent, extract the "points" of the rectangle, and do some other dirty stuff, which will get wrong when you touch your figure... So, here - I believe - is better to adjust things by hand. But the REAL STUFF is elsewhere. You added a vertical scaling, as I suggested, based on the aspect ratio of your data. You rescaled the offsets. I believe that I might have suggested that, if this is the case, I am sorry, it was a mental abbreviation... Rescaling JUST the offsets, and keeping the function itself in a "distorted frame" is sinful. Here you are another attempt. With (or without) your permission, I reconstruct the offset without your !*##$%*!! arctan... This is my equivalent of your "get-normal points" : def adp(x): # This computes the derivative without splines or other heavy artillery. xa=numpy.concatenate(([2*x[0]-x[1]],x,[2*x[-1]-x[-2]])) return xa[2:]-xa[:-2] def para(x,y,dst,ax): # ax is the current axes set, dst is the offset. scal=ax.get_data_ratio() # Don't send human make the work of a machine! y0=y/scal # Warp the original dx=adp(x); dy=adp(y0) ds=dst/numpy.sqrt(dx*dx+dy*dy) x1=x-ds*dy; x2=x+ds*dy y1=y0+ds*dx; y2=y0-ds*dx return (x1,y1*scal,x2,y2*scal) As you see, the function got "undistorted", the offsets calculated, and Mister Sulu, get us back into the real space ! Now, within your main() : ... fig = plt.figure(figsize=(fw,fh)) # whatever... ax = plt.subplot(111) ax.plot(x, y, color='orange', ls='-', lw=3, label='data', zorder=30) # It should be done first ... ax.set_xlim(xlims) ax.set_ylim(ylims) ax.grid() ax.invert_yaxis() ... xh,yh,xl,yl = para(x,y,distance,ax) # Here you are. ax.plot(xl, yl, 'g-',zorder=30) ax.plot(xh, yh, 'b-',zorder=30) ================= OK, let's get back to the second problem. Here you have the additional scaling. def vscal(ax): gf=ax.get_frame() ex=gf.get_extents() po=ex.get_points() # What a lousy way ! Probably Ben R. knows some more direct access. w,h = po[1,0]-po[0,0], po[1,1]-po[0,1] return h/w And within para(), the first line becomes: scal=ax.get_data_ratio()/vscal(ax) However, since my insomnia doesn't necessarily mean that I am fully conscious, check everything twice. Add your fig.subplots_adjust, and recheck. Good luck. Jerzy K.
On Friday, February 17, 2012, Ray Osborn wrote: > I am embedding a matplotlib canvas in a Pyside GUI and wanted to attach a > slider to adjust the color scale of a 2D plot made using NonUnitformImage. > I am connecting the slider value to im.set_clim([vmin,vmax]). I have got my > axis sliders to work, but the intensity slider only adjusts the colorbar > without touching the image itself. Is there some trick to making this work > with NonUniformImage? > > My plotting routine has the following code: > > ax = plt.gca() > im = NonUniformImage(ax, extent=extent, origin=None, **opts) > im.set_data(x,y,z) > ax.images.append(im) > self.imgplot = im > plt.colorbar(im) > > while the Pyside slot has: > > zhi = self.zmin + (self.ztab.maxslider.value() * range / 100) > im = self.imgplot > im.set_clim([zlo,zhi]) > > The slider dynamically adjusts the colorbar beautifully, but leaves the > color plot untouched. Any suggestions welcome. > > Thanks in advance, > Ray Without a more complete example, it is hard to say. Can you make a small stand-alone example that we can try out? Ben Root
I am embedding a matplotlib canvas in a Pyside GUI and wanted to attach a slider to adjust the color scale of a 2D plot made using NonUnitformImage. I am connecting the slider value to im.set_clim([vmin,vmax]). I have got my axis sliders to work, but the intensity slider only adjusts the colorbar without touching the image itself. Is there some trick to making this work with NonUniformImage? My plotting routine has the following code: ax = plt.gca() im = NonUniformImage(ax, extent=extent, origin=None, **opts) im.set_data(x,y,z) ax.images.append(im) self.imgplot = im plt.colorbar(im) while the Pyside slot has: zhi = self.zmin + (self.ztab.maxslider.value() * range / 100) im = self.imgplot im.set_clim([zlo,zhi]) The slider dynamically adjusts the colorbar beautifully, but leaves the color plot untouched. Any suggestions welcome. Thanks in advance, Ray -- Ray Osborn Materials Science Division Argonne National Laboratory Argonne, IL 60439, USA Phone: +1 (630) 252-9011 Email: RO...@an...