You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(3) |
Jun
|
Jul
|
Aug
(12) |
Sep
(12) |
Oct
(56) |
Nov
(65) |
Dec
(37) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(59) |
Feb
(78) |
Mar
(153) |
Apr
(205) |
May
(184) |
Jun
(123) |
Jul
(171) |
Aug
(156) |
Sep
(190) |
Oct
(120) |
Nov
(154) |
Dec
(223) |
2005 |
Jan
(184) |
Feb
(267) |
Mar
(214) |
Apr
(286) |
May
(320) |
Jun
(299) |
Jul
(348) |
Aug
(283) |
Sep
(355) |
Oct
(293) |
Nov
(232) |
Dec
(203) |
2006 |
Jan
(352) |
Feb
(358) |
Mar
(403) |
Apr
(313) |
May
(165) |
Jun
(281) |
Jul
(316) |
Aug
(228) |
Sep
(279) |
Oct
(243) |
Nov
(315) |
Dec
(345) |
2007 |
Jan
(260) |
Feb
(323) |
Mar
(340) |
Apr
(319) |
May
(290) |
Jun
(296) |
Jul
(221) |
Aug
(292) |
Sep
(242) |
Oct
(248) |
Nov
(242) |
Dec
(332) |
2008 |
Jan
(312) |
Feb
(359) |
Mar
(454) |
Apr
(287) |
May
(340) |
Jun
(450) |
Jul
(403) |
Aug
(324) |
Sep
(349) |
Oct
(385) |
Nov
(363) |
Dec
(437) |
2009 |
Jan
(500) |
Feb
(301) |
Mar
(409) |
Apr
(486) |
May
(545) |
Jun
(391) |
Jul
(518) |
Aug
(497) |
Sep
(492) |
Oct
(429) |
Nov
(357) |
Dec
(310) |
2010 |
Jan
(371) |
Feb
(657) |
Mar
(519) |
Apr
(432) |
May
(312) |
Jun
(416) |
Jul
(477) |
Aug
(386) |
Sep
(419) |
Oct
(435) |
Nov
(320) |
Dec
(202) |
2011 |
Jan
(321) |
Feb
(413) |
Mar
(299) |
Apr
(215) |
May
(284) |
Jun
(203) |
Jul
(207) |
Aug
(314) |
Sep
(321) |
Oct
(259) |
Nov
(347) |
Dec
(209) |
2012 |
Jan
(322) |
Feb
(414) |
Mar
(377) |
Apr
(179) |
May
(173) |
Jun
(234) |
Jul
(295) |
Aug
(239) |
Sep
(276) |
Oct
(355) |
Nov
(144) |
Dec
(108) |
2013 |
Jan
(170) |
Feb
(89) |
Mar
(204) |
Apr
(133) |
May
(142) |
Jun
(89) |
Jul
(160) |
Aug
(180) |
Sep
(69) |
Oct
(136) |
Nov
(83) |
Dec
(32) |
2014 |
Jan
(71) |
Feb
(90) |
Mar
(161) |
Apr
(117) |
May
(78) |
Jun
(94) |
Jul
(60) |
Aug
(83) |
Sep
(102) |
Oct
(132) |
Nov
(154) |
Dec
(96) |
2015 |
Jan
(45) |
Feb
(138) |
Mar
(176) |
Apr
(132) |
May
(119) |
Jun
(124) |
Jul
(77) |
Aug
(31) |
Sep
(34) |
Oct
(22) |
Nov
(23) |
Dec
(9) |
2016 |
Jan
(26) |
Feb
(17) |
Mar
(10) |
Apr
(8) |
May
(4) |
Jun
(8) |
Jul
(6) |
Aug
(5) |
Sep
(9) |
Oct
(4) |
Nov
|
Dec
|
2017 |
Jan
(5) |
Feb
(7) |
Mar
(1) |
Apr
(5) |
May
|
Jun
(3) |
Jul
(6) |
Aug
(1) |
Sep
|
Oct
(2) |
Nov
(1) |
Dec
|
2018 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2020 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2025 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
S | M | T | W | T | F | S |
---|---|---|---|---|---|---|
|
|
|
1
(19) |
2
(30) |
3
(14) |
4
(1) |
5
(16) |
6
(7) |
7
(12) |
8
(14) |
9
(35) |
10
(16) |
11
(31) |
12
(6) |
13
(14) |
14
(13) |
15
(20) |
16
(15) |
17
(27) |
18
(5) |
19
(10) |
20
(22) |
21
(20) |
22
(30) |
23
(25) |
24
(11) |
25
(2) |
26
(2) |
27
(23) |
28
(20) |
29
(26) |
30
(25) |
31
(7) |
|
Hello, the matplotlib widget has an incorrect default size (the left one in the attatched screenshot). I couldn't reproduce this behaviour with any Qt widget - so it seems that this is specific to matplotlib. But as I'm not really sure of the cause I posted it to both lists. Lukas Am Dienstag 21 Juli 2009 20:31:55 schrieb Darren Dale: > On Tue, Jul 21, 2009 at 12:06 PM, Lukas Hetzenecker<Lu...@gm...> wrote: > > Sorry for annoying you, but I attatched a new example to this message: > > I've rewritten the PyQt4-example from the website to draw the Figure in a > > tab widget. The same happens ;) > > In your original post, you said: > > "the widget in the Tab is incorrectly sized. > If I embed the FigureCanvas in a QTabWidget the widget is to big, but if I > put it in a QWidget it is shown correctly." > > Could you be more specific? What does "incorrectly sized" mean? What > do you mean by the widget is "too big", as opposed to "shown > correctly"? Is this really a PyQt issue, or is it specific to > matplotlib? If the latter we should continue the discussion on the mpl > mailing list instead of cross-posting. > > Darren
On Tue, Jul 21, 2009 at 12:06 PM, Lukas Hetzenecker<Lu...@gm...> wrote: > Sorry for annoying you, but I attatched a new example to this message: I've > rewritten the PyQt4-example from the website to draw the Figure in a tab > widget. The same happens ;) In your original post, you said: "the widget in the Tab is incorrectly sized. If I embed the FigureCanvas in a QTabWidget the widget is to big, but if I put it in a QWidget it is shown correctly." Could you be more specific? What does "incorrectly sized" mean? What do you mean by the widget is "too big", as opposed to "shown correctly"? Is this really a PyQt issue, or is it specific to matplotlib? If the latter we should continue the discussion on the mpl mailing list instead of cross-posting. Darren
Robert C, Robert K, folks, messing with the nice delaunay/testfuncs.py to time linear_interpolate_grid nn_interpolate_grid and nn_interpolate_unstructured in _delaunay, I see linear ~ 100 times faster than the nn_ s: # from: trigrid Ntri=1000 Ngrid=100 run: 21 Jul 2009 17:33 mac 10.4.11 ppc time: 0.027 sec trigrid: build Triangulation 1000 time: 0.0059 sec trigrid 100 "linear" corners: 0 1 2 1 time: 0.5 sec trigrid 100 "nn_grid" corners: 0 1 2 1 time: 0.49 sec trigrid 100 "nn_unstruct" corners: 0 1 2 1 Correct me: if all 3 methods do gridpoint-to-triangle in the same way, then the huge diff is in find-neighboring-triangles (6 on average ?), not in gridpoint-to-triangle ? This is with the _delaunay.so that comes with the mac 98.5.3 egg, however that was compiled (-O3 ?) What to do ? 1) does it matter, how many people care ? (all who believe in telekinesis, raise my right hand) 2) natgrid ? don't see it in matplotlib.sf.net 3) stick with fast linear, smooth the triangle planes a la 3t^2 - 2t^3 or fancier smoothing In any case, add griddata( ... method = "linear" / "nn" ... ) so users have a choice. Can a real user or two tell us about the flow, with some rough numbers for Ntri Ngrid Npix -- Ntri = nr original sample points, say 1000 Ngrid 100 x 100 Npix 800 x 600 ? (Ntri -> Ngrid slowly and accurately, then Ngrid -> Npix w fast inaccurate image interpolation ? hmm.) cheers -- denis -- View this message in context: http://www.nabble.com/speeding-up-griddata%28%29-tp24467055p24591133.html Sent from the matplotlib - users mailing list archive at Nabble.com.
On Tue, Jul 21, 2009 at 10:51 AM, Domenico Nappo<dom...@gm...> wrote: > "C:\Python25\Lib\site-packages\matplotlib\backends\backend_gtkagg.py", line > 14, in <module> > from matplotlib.backends._gtkagg import agg_to_gtk_drawable > ImportError: No module named _gtkagg > > I have the suspect that matplotlib windows support simply doesn't exist:) > I'll try prepackaged windows distributions like EPD or Python(x,y) and hope > this will solve this issue... I'm pretty sure they do not package mpl with the gtk backend, but Christoph Gohlke has a version that does http://www.lfd.uci.edu/~gohlke/#pythonlibs
Hi Blaine, let me first of all give you the reference to some documentation about the usage of show: http://matplotlib.sourceforge.net/faq/howto_faq.html#use-show Furthermore I may recommend you to replace your call of show in 'p' by a call of draw, which will yield the expected behaviour in ipythons pylab mode. Hopefully these hints are helpful to you. best regards Matthias On Monday 20 July 2009 19:36:24 Blaine Booher wrote: > hey everyone, > I have an interactive python application that I am using pylab with. I > am having a problem where I can only create a graph ONE time. all other > calls to plot() and show() cause nothing to happen. > > I have used ipython -pylab as well, but the problem I am having with > ipython is that all the graphs will show up AFTER i close my interactive > shell. Of course, ipython works interatively every time I 'plot' or 'show' > at the ipython command line. > > Is this a backend issue? Does anyone else have this problem? > > issue can be summarized as such: > >>>from pylab import * > >>>def p(): > > plot([1,2], [1,2]) > show() > > >>>p() // works fine. graph pops up. > >>>p() //returns nothing, no graph shows up > >>>p() //same as above > > I am on Debian Lenny, pylab .98.3-5 > > Blaine
Sorry for annoying you, but I attatched a new example to this message: I've rewritten the PyQt4-example from the website to draw the Figure in a tab widget. The same happens ;) Am Montag 20 Juli 2009 21:58:46 schrieb Lukas Hetzenecker: > Hm.. I added a resize() after the show(): > > class Plot_tab(QTabWidget, tab): > def __init__(self): > super(Plot_tab, self).__init__() > self.setupUi(self) > > self.show() > self.resize(self.size().width()+1, self.size().height()+1) > self.resize(self.size().width()-1, self.size().height()-1) > > if __name__ == "__main__": > import sys > app = QApplication(sys.argv) > > plot_t = Plot_tab() > > sys.exit(app.exec_()) > > > Now it works, but I really want to know why..? > Is there a way to avoid this ugly workaround? > > Thanks, > Lukas > > Am Sonntag 19 Juli 2009 12:58:53 schrieb Lukas Hetzenecker: > > Hello, > > > > I've tried to resize the QTabWidget, I've searched for examples on the > > internet, added a QTabWidget and used this as the Mainwindows central > > widget - but exactly the same happened. > > > > It works if I replace the FigureCanvas with a Qt Widget - for example a > > text edit or a QWebView. > > > > Am Sonntag 19 Juli 2009 11:54:12 schrieb projetmbc: > > > Lukas Hetzenecker a écrit : > > > > I tried to embed a Matplotlib FigureCanvas into a QTabWidget. > > > > But at the first start of my script - the main.py in the attatched > > > > example - the widget in the Tab is incorrectly sized. > > > > If I embed the FigureCanvas in a QTabWidget the widget is to big, but > > > > if I put it in a QWidget it is shown correctly. > > > > > > I'm not sure that is a pure MatPlotLib issue. Have you try with a big > > > standard widget instead of the FigureCanvas ? > > > > > > Christophe > > > > ------------------------------------------------------------------------- > >-- --- Enter the BlackBerry Developer Challenge > > This is your chance to win up to 100,000ドル in prizes! For a limited time, > > vendors submitting new applications to BlackBerry App World(TM) will have > > the opportunity to enter the BlackBerry Developer Challenge. See full > > prize details at: http://p.sf.net/sfu/Challenge > > _______________________________________________ > > Matplotlib-users mailing list > > Mat...@li... > > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > --------------------------------------------------------------------------- >--- Enter the BlackBerry Developer Challenge > This is your chance to win up to 100,000ドル in prizes! For a limited time, > vendors submitting new applications to BlackBerry App World(TM) will have > the opportunity to enter the BlackBerry Developer Challenge. See full prize > details at: http://p.sf.net/sfu/Challenge > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Hi all, I'd like to do a histogram with barstacked style. Well, I'm not able to make it in any way :( - what is the format of the the data to pass? - what's the value of bins? (related to the above question, I suppose) for example, let's say I want to plot this series s1 = 2,3,6,3,1 s2 = 1,2,2,4,1 s3 = 4,1,0,3,7 what's the format of data to pass to hist() ? by row? by column? Thanks a lot in advance, -- Sandro Tosi (aka morph, morpheus, matrixhasu) My website: http://matrixhasu.altervista.org/ Me at Debian: http://wiki.debian.org/SandroTosi
Thanks for your reply, anyway. I've tried to change the backend to GTKAgg and now when I startt ipython -pylab I receive: Traceback (most recent call last): File "C:\Python25\scripts\ipython.py", line 28, in <module> IPython.Shell.start().mainloop() File "C:\Python25\Lib\site-packages\IPython\Shell.py", line 1233, in start return shell(user_ns = user_ns) File "C:\Python25\Lib\site-packages\IPython\Shell.py", line 1108, in __init__ shell_class=MatplotlibMTShell) File "C:\Python25\Lib\site-packages\IPython\Shell.py", line 793, in __init__ on_kill=[mainquit]) File "C:\Python25\Lib\site-packages\IPython\ipmaker.py", line 103, in make_IPython embedded=embedded,**kw) File "C:\Python25\Lib\site-packages\IPython\Shell.py", line 639, in __init__ user_ns,user_global_ns,b2 = self._matplotlib_config(name,user_ns,user_global_ns) File "C:\Python25\Lib\site-packages\IPython\Shell.py", line 559, in _matplotlib_config import matplotlib.pylab as pylab File "C:\Python25\Lib\site-packages\matplotlib\pylab.py", line 253, in <module> from matplotlib.pyplot import * File "C:\Python25\Lib\site-packages\matplotlib\pyplot.py", line 75, in <module> new_figure_manager, draw_if_interactive, show = pylab_setup() File "C:\Python25\Lib\site-packages\matplotlib\backends\__init__.py", line 25, in pylab_setup globals(),locals(),[backend_name]) File "C:\Python25\Lib\site-packages\matplotlib\backends\backend_gtkagg.py", line 14, in <module> from matplotlib.backends._gtkagg import agg_to_gtk_drawable ImportError: No module named _gtkagg I have the suspect that matplotlib windows support simply doesn't exist:) I'll try prepackaged windows distributions like EPD or Python(x,y) and hope this will solve this issue... Thanks again. 2009年7月21日 Jae-Joon Lee <lee...@gm...> > As the warning message indicates, I think this is a backend issue. > The recommended backend (for screen display) is the Agg family, e.g., > TkAgg, GTKAgg, etc. > > I rarely use Windows and I never used matplotlib on Windows, so there > is not much I can help. > I'm not sure which backend is available on Windows, but try some other > backend. > > http://matplotlib.sourceforge.net/faq/installing_faq.html#what-is-a-backend > > Also, please check out the binary installer for windows, > > http://matplotlib.sourceforge.net/faq/installing_faq.html#windows-questions > > Regards, > > -JJ > > > On Tue, Jul 21, 2009 at 4:01 AM, Domenico Nappo<dom...@gm...> > wrote: > > Hi JJ, > > thanks for your reply. > > Let me say first that I've some problems with installation, I think: when > I > > try to run ipython -pylab I got the following: > > C:\Documents and Settings\user>ipython -pylab > > Traceback (most recent call last): > > File "C:\Python25\scripts\ipython.py", line 28, in <module> > > IPython.Shell.start().mainloop() > > File "C:\Python25\Lib\site-packages\IPython\Shell.py", line 1233, in > start > > return shell(user_ns = user_ns) > > File "C:\Python25\Lib\site-packages\IPython\Shell.py", line 1108, in > > __init__ > > shell_class=MatplotlibMTShell) > > File "C:\Python25\Lib\site-packages\IPython\Shell.py", line 793, in > > __init__ > > on_kill=[mainquit]) > > File "C:\Python25\Lib\site-packages\IPython\ipmaker.py", line 103, in > > make_IPython > > embedded=embedded,**kw) > > File "C:\Python25\Lib\site-packages\IPython\Shell.py", line 639, in > > __init__ > > user_ns,user_global_ns,b2 = > > self._matplotlib_config(name,user_ns,user_global_ns) > > File "C:\Python25\Lib\site-packages\IPython\Shell.py", line 559, in > > _matplotlib_config > > import matplotlib.pylab as pylab > > File "C:\Python25\Lib\site-packages\matplotlib\pylab.py", line 253, in > > <module> > > from matplotlib.pyplot import * > > File "C:\Python25\Lib\site-packages\matplotlib\pyplot.py", line 75, in > > <module> > > new_figure_manager, draw_if_interactive, show = pylab_setup() > > File "C:\Python25\Lib\site-packages\matplotlib\backends\__init__.py", > line > > 25, in pylab_setup > > globals(),locals(),[backend_name]) > > File > "C:\Python25\Lib\site-packages\matplotlib\backends\backend_gtk.py", > > line 25, in <module> > > from matplotlib.backends.backend_gdk import RendererGDK, > FigureCanvasGDK > > File > "C:\Python25\lib\site-packages\matplotlib\backends\backend_gdk.py", > > line 29, in <module> > > from matplotlib.backends._backend_gdk import pixbuf_get_pixels_array > > ImportError: No module named _backend_gdk > > > > If I comment the import statement for _backend_gdk in backend_gdk.py, > > ipython runs well. > > Below, the code: > > In [20]: > > > X=load('E:\\user\\Applicazioni\\EFGExtractor\\dataJan03Dec08.matplotlibtest',converters={0:strpdate2num('%Y-%m-%d')}) > > > > In [21]: time = X[:,0] > > > > In [22]: time > > Out[22]: array([ 731216., 731217., 731218., ..., 733040., 733041., > 733042.]) > > > > In [23]: data = X[:,1] > > > > In [24]: data > > Out[24]: array([ 150., 140., 142., ..., 92., 84., 76.]) > > > > > > In [30]: fig = figure() > > > > In [31]: ax = fig.add_subplot(111) > > > > In [32]: ax.plot_date(time, data, '-') > > Out[32]: [<matplotlib.lines.Line2D object at 0x0218B030>] > > > > In [33]: show() > > > > In [34]: fig.autofmt_xdate() > > > > > > In [37]: > > C:\Python25\lib\site-packages\matplotlib\backends\backend_gdk.py:148: > > UserWarning: backend_gdk: unable to draw text at angles other than 0 or > 90 > > 'other than 0 or 90') > > This time I've noticed the warning above: "unable to draw text at angles > > other than 0 or 90" > > Thanks in advance for any clarification... > > 2009年7月17日 Jae-Joon Lee <lee...@gm...> > >> > >> Please post a simple, standalone script that reproduces your problem, > >> so that we can track down what is causing the problem. I don't think > >> there has been any report of a similar issue (but not sure). As far as > >> I know, autofmt_xdata only adjusts the alignment and rotation of the > >> ticklabels and does not change the font property. > >> > >> -JJ > >> > >> > >> On Thu, Jul 16, 2009 at 10:55 AM, Domenico > >> Nappo<dom...@gm...> wrote: > >> > Whenever I try to use autofmt_xdate() on a Figure(), dates on x axis > >> > disappear...I guess this is related with something concerning font > >> > management... > >> > Anyone experienced this kind of issues? > >> > > >> > I use most recent versions of matplotlib, numpy, gtk2, pygtk on a > Python > >> > 2.5 > >> > platform (installed via binaries on a window xp machine). > >> > > >> > > >> > > ------------------------------------------------------------------------------ > >> > Enter the BlackBerry Developer Challenge > >> > This is your chance to win up to 100,000ドル in prizes! For a limited > time, > >> > vendors submitting new applications to BlackBerry App World(TM) will > >> > have > >> > the opportunity to enter the BlackBerry Developer Challenge. See full > >> > prize > >> > details at: http://p.sf.net/sfu/Challenge > >> > _______________________________________________ > >> > Matplotlib-users mailing list > >> > Mat...@li... > >> > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > >> > > >> > > > > > >
As the warning message indicates, I think this is a backend issue. The recommended backend (for screen display) is the Agg family, e.g., TkAgg, GTKAgg, etc. I rarely use Windows and I never used matplotlib on Windows, so there is not much I can help. I'm not sure which backend is available on Windows, but try some other backend. http://matplotlib.sourceforge.net/faq/installing_faq.html#what-is-a-backend Also, please check out the binary installer for windows, http://matplotlib.sourceforge.net/faq/installing_faq.html#windows-questions Regards, -JJ On Tue, Jul 21, 2009 at 4:01 AM, Domenico Nappo<dom...@gm...> wrote: > Hi JJ, > thanks for your reply. > Let me say first that I've some problems with installation, I think: when I > try to run ipython -pylab I got the following: > C:\Documents and Settings\user>ipython -pylab > Traceback (most recent call last): > File "C:\Python25\scripts\ipython.py", line 28, in <module> > IPython.Shell.start().mainloop() > File "C:\Python25\Lib\site-packages\IPython\Shell.py", line 1233, in start > return shell(user_ns = user_ns) > File "C:\Python25\Lib\site-packages\IPython\Shell.py", line 1108, in > __init__ > shell_class=MatplotlibMTShell) > File "C:\Python25\Lib\site-packages\IPython\Shell.py", line 793, in > __init__ > on_kill=[mainquit]) > File "C:\Python25\Lib\site-packages\IPython\ipmaker.py", line 103, in > make_IPython > embedded=embedded,**kw) > File "C:\Python25\Lib\site-packages\IPython\Shell.py", line 639, in > __init__ > user_ns,user_global_ns,b2 = > self._matplotlib_config(name,user_ns,user_global_ns) > File "C:\Python25\Lib\site-packages\IPython\Shell.py", line 559, in > _matplotlib_config > import matplotlib.pylab as pylab > File "C:\Python25\Lib\site-packages\matplotlib\pylab.py", line 253, in > <module> > from matplotlib.pyplot import * > File "C:\Python25\Lib\site-packages\matplotlib\pyplot.py", line 75, in > <module> > new_figure_manager, draw_if_interactive, show = pylab_setup() > File "C:\Python25\Lib\site-packages\matplotlib\backends\__init__.py", line > 25, in pylab_setup > globals(),locals(),[backend_name]) > File "C:\Python25\Lib\site-packages\matplotlib\backends\backend_gtk.py", > line 25, in <module> > from matplotlib.backends.backend_gdk import RendererGDK, FigureCanvasGDK > File "C:\Python25\lib\site-packages\matplotlib\backends\backend_gdk.py", > line 29, in <module> > from matplotlib.backends._backend_gdk import pixbuf_get_pixels_array > ImportError: No module named _backend_gdk > > If I comment the import statement for _backend_gdk in backend_gdk.py, > ipython runs well. > Below, the code: > In [20]: > X=load('E:\\user\\Applicazioni\\EFGExtractor\\dataJan03Dec08.matplotlibtest',converters={0:strpdate2num('%Y-%m-%d')}) > > In [21]: time = X[:,0] > > In [22]: time > Out[22]: array([ 731216., 731217., 731218., ..., 733040., 733041., 733042.]) > > In [23]: data = X[:,1] > > In [24]: data > Out[24]: array([ 150., 140., 142., ..., 92., 84., 76.]) > > > In [30]: fig = figure() > > In [31]: ax = fig.add_subplot(111) > > In [32]: ax.plot_date(time, data, '-') > Out[32]: [<matplotlib.lines.Line2D object at 0x0218B030>] > > In [33]: show() > > In [34]: fig.autofmt_xdate() > > > In [37]: > C:\Python25\lib\site-packages\matplotlib\backends\backend_gdk.py:148: > UserWarning: backend_gdk: unable to draw text at angles other than 0 or 90 > 'other than 0 or 90') > This time I've noticed the warning above: "unable to draw text at angles > other than 0 or 90" > Thanks in advance for any clarification... > 2009年7月17日 Jae-Joon Lee <lee...@gm...> >> >> Please post a simple, standalone script that reproduces your problem, >> so that we can track down what is causing the problem. I don't think >> there has been any report of a similar issue (but not sure). As far as >> I know, autofmt_xdata only adjusts the alignment and rotation of the >> ticklabels and does not change the font property. >> >> -JJ >> >> >> On Thu, Jul 16, 2009 at 10:55 AM, Domenico >> Nappo<dom...@gm...> wrote: >> > Whenever I try to use autofmt_xdate() on a Figure(), dates on x axis >> > disappear...I guess this is related with something concerning font >> > management... >> > Anyone experienced this kind of issues? >> > >> > I use most recent versions of matplotlib, numpy, gtk2, pygtk on a Python >> > 2.5 >> > platform (installed via binaries on a window xp machine). >> > >> > >> > ------------------------------------------------------------------------------ >> > Enter the BlackBerry Developer Challenge >> > This is your chance to win up to 100,000ドル in prizes! For a limited time, >> > vendors submitting new applications to BlackBerry App World(TM) will >> > have >> > the opportunity to enter the BlackBerry Developer Challenge. See full >> > prize >> > details at: http://p.sf.net/sfu/Challenge >> > _______________________________________________ >> > Matplotlib-users mailing list >> > Mat...@li... >> > https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> > >> > > >
Hi, I just created a hsv-like color map with gray levels only, now I'd like to use this as default color map. But how? Calling it like hsv() does not work and I did not find a hint in the documentation how to set a user defined color map interactively as default color map. Cheers Philipp -- View this message in context: http://www.nabble.com/setting-user-defined-color-map-as-default-tp24587528p24587528.html Sent from the matplotlib - users mailing list archive at Nabble.com.
Hi, Darren, many thanks for your answer. Now all works. Regards, Alexander Bruy -- реклама ----------------------------------------------------------- http://FREEhost.com.ua - еще больше места и возможностей. При заказе хостинга - домен бесплатно.
Thanks! On Mon, Jul 20, 2009 at 3:44 PM, Jae-Joon Lee<lee...@gm...> wrote: > index for subplot starts from 1, not 0 (the convention is from Matlab). > > Regards, > > -JJ > > > On Mon, Jul 20, 2009 at 6:31 PM, W. Augustine Dunn > III<wad...@gm...> wrote: >> Hello y'all: >> >> I am trying to plot a fig with three subplots. However when I run my >> script the subplots are all shifted way too high >> (http://img.skitch.com/20090720-fp462u8ww4bq38j29u9bjtr2cx.png) and >> the top subplot is cut off. >> >> I tried doing something like this from reading another poster's thread >> but this did absolutely nothing: >> mpl.figure.SubplotParams(left= (48 / 72.0) / figW, # 48-point left margin >> bottom= (36 / 72.0) / figH, # etc. >> right= 1 - (18 / 72.0) / figW, >> top= 1 - (12 / 72.0) / figH) >> >> Anyone have an idea how to fix this. >> >> Thank you for your time. >> >> Gus >> >> The code is below for those interested: >> <code> >> supTitle = 'Ortholog Pairs Matching "Real" or "Control" Ag miRNA seeds.' >> >> data = [] >> for dFile in iFiles: >> data.append(pickle.load(open(dFile,'rU'))) >> >> ks = [] >> for i in range(len(data)): >> ks.append(sorted(data[i].keys())) >> >> for i in range(len(ks)): >> if "!doc" in ks[i]: ks[i].pop(0) # if the pkl has a !doc entry. pop it >> assert odd_or_even(len(ks[i])) == 'even', 'Error: len(ks[i]) must be even.' >> pos1Data = eval('[%s]' % ('[],'*len(data))) >> pos1Keys = eval('[%s]' % ('[],'*len(data))) >> pos2Data = eval('[%s]' % ('[],'*len(data))) >> pos2Keys = eval('[%s]' % ('[],'*len(data))) >> >> for i in range(len(ks)): >> for j in range(len(ks[i])): >> if odd_or_even(j) == 'even': # remember that we start with 0 >> which is even. >> pos1Data[i].append(data[i][ks[i][j]]) >> pos1Keys[i].append(ks[i][j]) >> else: >> pos2Data[i].append(data[i][ks[i][j]]) >> pos2Keys[i].append(ks[i][j]) >> >> figW = 16 >> figH = 8 >> plt.figure(num=None, figsize=None, dpi=None, facecolor='w', edgecolor='k') >> subplotpars=mpl.figure.SubplotParams(left= (48 / 72.0) / figW, >> # 48-point left margin >> bottom= (36 / 72.0) / figH, # etc. >> right= 1 - (18 / 72.0) / figW, >> top= 1 - (12 / 72.0) / figH) >> >> plt.suptitle(supTitle) >> for i in range(len(data)): >> matches1 = [x[0] for x in pos1Data[i]] >> ctrls1 = [-x[1] for x in pos1Data[i]] >> matches2 = [x[0] for x in pos2Data[i]] >> ctrls2 = [-x[1] for x in pos2Data[i]] >> >> assert len(matches1) == len(matches2), 'Error: matches1 and >> matches 2 do not have the same number of elements!' >> N = len(matches1) >> >> >> >> ind = np.arange(N) # the x locations for the groups >> width = 0.35 # the width of the bars: can also be len(x) sequence >> >> >> plt.subplot(len(data),1,i,) >> p1 = plt.bar(ind, ctrls1, width, color='w',) >> p2 = plt.bar(ind, matches1, width, color='b',) >> p3 = plt.bar(ind+width, ctrls2, width, color='w',) >> p4 = plt.bar(ind+width, matches2, width, color='b', ) >> plt.ylabel(subTitles[i]) >> if i == len(data)-1: >> plt.xlabel('miRNA seed') >> >> axMax = max(matches1+matches2)*1.1 >> axMin = min(ctrls1+ctrls2)*1.1 >> #plt.axis([0,len(matches1),axMin,axMax]) >> if i == 0: >> plt.legend( (p2[0], p1[0]), ('Real', 'Ctrls'), loc=(1.01,0.65) ) >> </code> >> >> ------------------------------------------------------------------------------ >> Enter the BlackBerry Developer Challenge >> This is your chance to win up to 100,000ドル in prizes! For a limited time, >> vendors submitting new applications to BlackBerry App World(TM) will have >> the opportunity to enter the BlackBerry Developer Challenge. See full prize >> details at: http://p.sf.net/sfu/Challenge >> _______________________________________________ >> Matplotlib-users mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> > -- Experience is not what happens to a man; it is what a man does with what happens to him. - Aldous Huxley
index for subplot starts from 1, not 0 (the convention is from Matlab). Regards, -JJ On Mon, Jul 20, 2009 at 6:31 PM, W. Augustine Dunn III<wad...@gm...> wrote: > Hello y'all: > > I am trying to plot a fig with three subplots. However when I run my > script the subplots are all shifted way too high > (http://img.skitch.com/20090720-fp462u8ww4bq38j29u9bjtr2cx.png) and > the top subplot is cut off. > > I tried doing something like this from reading another poster's thread > but this did absolutely nothing: > mpl.figure.SubplotParams(left= (48 / 72.0) / figW, # 48-point left margin > bottom= (36 / 72.0) / figH, # etc. > right= 1 - (18 / 72.0) / figW, > top= 1 - (12 / 72.0) / figH) > > Anyone have an idea how to fix this. > > Thank you for your time. > > Gus > > The code is below for those interested: > <code> > supTitle = 'Ortholog Pairs Matching "Real" or "Control" Ag miRNA seeds.' > > data = [] > for dFile in iFiles: > data.append(pickle.load(open(dFile,'rU'))) > > ks = [] > for i in range(len(data)): > ks.append(sorted(data[i].keys())) > > for i in range(len(ks)): > if "!doc" in ks[i]: ks[i].pop(0) # if the pkl has a !doc entry. pop it > assert odd_or_even(len(ks[i])) == 'even', 'Error: len(ks[i]) must be even.' > pos1Data = eval('[%s]' % ('[],'*len(data))) > pos1Keys = eval('[%s]' % ('[],'*len(data))) > pos2Data = eval('[%s]' % ('[],'*len(data))) > pos2Keys = eval('[%s]' % ('[],'*len(data))) > > for i in range(len(ks)): > for j in range(len(ks[i])): > if odd_or_even(j) == 'even': # remember that we start with 0 > which is even. > pos1Data[i].append(data[i][ks[i][j]]) > pos1Keys[i].append(ks[i][j]) > else: > pos2Data[i].append(data[i][ks[i][j]]) > pos2Keys[i].append(ks[i][j]) > > figW = 16 > figH = 8 > plt.figure(num=None, figsize=None, dpi=None, facecolor='w', edgecolor='k') > subplotpars=mpl.figure.SubplotParams(left= (48 / 72.0) / figW, > # 48-point left margin > bottom= (36 / 72.0) / figH, # etc. > right= 1 - (18 / 72.0) / figW, > top= 1 - (12 / 72.0) / figH) > > plt.suptitle(supTitle) > for i in range(len(data)): > matches1 = [x[0] for x in pos1Data[i]] > ctrls1 = [-x[1] for x in pos1Data[i]] > matches2 = [x[0] for x in pos2Data[i]] > ctrls2 = [-x[1] for x in pos2Data[i]] > > assert len(matches1) == len(matches2), 'Error: matches1 and > matches 2 do not have the same number of elements!' > N = len(matches1) > > > > ind = np.arange(N) # the x locations for the groups > width = 0.35 # the width of the bars: can also be len(x) sequence > > > plt.subplot(len(data),1,i,) > p1 = plt.bar(ind, ctrls1, width, color='w',) > p2 = plt.bar(ind, matches1, width, color='b',) > p3 = plt.bar(ind+width, ctrls2, width, color='w',) > p4 = plt.bar(ind+width, matches2, width, color='b', ) > plt.ylabel(subTitles[i]) > if i == len(data)-1: > plt.xlabel('miRNA seed') > > axMax = max(matches1+matches2)*1.1 > axMin = min(ctrls1+ctrls2)*1.1 > #plt.axis([0,len(matches1),axMin,axMax]) > if i == 0: > plt.legend( (p2[0], p1[0]), ('Real', 'Ctrls'), loc=(1.01,0.65) ) > </code> > > ------------------------------------------------------------------------------ > Enter the BlackBerry Developer Challenge > This is your chance to win up to 100,000ドル in prizes! For a limited time, > vendors submitting new applications to BlackBerry App World(TM) will have > the opportunity to enter the BlackBerry Developer Challenge. See full prize > details at: http://p.sf.net/sfu/Challenge > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users >
Hello y'all: I am trying to plot a fig with three subplots. However when I run my script the subplots are all shifted way too high (http://img.skitch.com/20090720-fp462u8ww4bq38j29u9bjtr2cx.png) and the top subplot is cut off. I tried doing something like this from reading another poster's thread but this did absolutely nothing: mpl.figure.SubplotParams(left= (48 / 72.0) / figW, # 48-point left margin bottom= (36 / 72.0) / figH, # etc. right= 1 - (18 / 72.0) / figW, top= 1 - (12 / 72.0) / figH) Anyone have an idea how to fix this. Thank you for your time. Gus The code is below for those interested: <code> supTitle = 'Ortholog Pairs Matching "Real" or "Control" Ag miRNA seeds.' data = [] for dFile in iFiles: data.append(pickle.load(open(dFile,'rU'))) ks = [] for i in range(len(data)): ks.append(sorted(data[i].keys())) for i in range(len(ks)): if "!doc" in ks[i]: ks[i].pop(0) # if the pkl has a !doc entry. pop it assert odd_or_even(len(ks[i])) == 'even', 'Error: len(ks[i]) must be even.' pos1Data = eval('[%s]' % ('[],'*len(data))) pos1Keys = eval('[%s]' % ('[],'*len(data))) pos2Data = eval('[%s]' % ('[],'*len(data))) pos2Keys = eval('[%s]' % ('[],'*len(data))) for i in range(len(ks)): for j in range(len(ks[i])): if odd_or_even(j) == 'even': # remember that we start with 0 which is even. pos1Data[i].append(data[i][ks[i][j]]) pos1Keys[i].append(ks[i][j]) else: pos2Data[i].append(data[i][ks[i][j]]) pos2Keys[i].append(ks[i][j]) figW = 16 figH = 8 plt.figure(num=None, figsize=None, dpi=None, facecolor='w', edgecolor='k') subplotpars=mpl.figure.SubplotParams(left= (48 / 72.0) / figW, # 48-point left margin bottom= (36 / 72.0) / figH, # etc. right= 1 - (18 / 72.0) / figW, top= 1 - (12 / 72.0) / figH) plt.suptitle(supTitle) for i in range(len(data)): matches1 = [x[0] for x in pos1Data[i]] ctrls1 = [-x[1] for x in pos1Data[i]] matches2 = [x[0] for x in pos2Data[i]] ctrls2 = [-x[1] for x in pos2Data[i]] assert len(matches1) == len(matches2), 'Error: matches1 and matches 2 do not have the same number of elements!' N = len(matches1) ind = np.arange(N) # the x locations for the groups width = 0.35 # the width of the bars: can also be len(x) sequence plt.subplot(len(data),1,i,) p1 = plt.bar(ind, ctrls1, width, color='w',) p2 = plt.bar(ind, matches1, width, color='b',) p3 = plt.bar(ind+width, ctrls2, width, color='w',) p4 = plt.bar(ind+width, matches2, width, color='b', ) plt.ylabel(subTitles[i]) if i == len(data)-1: plt.xlabel('miRNA seed') axMax = max(matches1+matches2)*1.1 axMin = min(ctrls1+ctrls2)*1.1 #plt.axis([0,len(matches1),axMin,axMax]) if i == 0: plt.legend( (p2[0], p1[0]), ('Real', 'Ctrls'), loc=(1.01,0.65) ) </code>
On Mon, Jul 20, 2009 at 4:48 PM, John [H2O]<was...@gm...> wrote: > > > > Jae-Joon Lee wrote: >> >> get_xmajorticklabels() returns a list of matplotlib's "Text" objects, >> not python strings. >> > > This is what I've now come to understand, but it seems very odd. Why > wouldn't it return the list of strings, or alternatively, how can you get > the list of strings? I guess you have to use the pyplot tools, but I was > trying to use so called 'fine grain' control and do everything at the axes > level. > Why it does not return a list of strings? Because the documentation says it does not. Well, I acknowledge the asymetry in the API, but this is how things are. How to get the list of strings? Use the "get_text" method of the "Text" object. http://matplotlib.sourceforge.net/api/artist_api.html?#matplotlib.text.Text.get_text I used pyplot function because you were calling plt.gca(). If you don't like it, you can explicitly go over the for loop with appropriate methods. for t in ax1.get_xmajorticklabels(): t.set(size=6,rotation=30) or use set_size and set_rotation if you prefer. See the documentation for more details. Regards, -JJ > > >> >> plt.setp(plt.gca().get_xmajorticklabels(), >> size=6,rotation=30) >> > > In fact, what you show is how I was testing in ipython and it does worked, > it just seemed in a script it would be better to use the axis method, but > apparently it is different from the gca() method. This is what I don't > understand. > > Thanks! > > > On Mon, Jul 20, 2009 at 11:48 AM, John [H2O]<was...@gm...> wrote: >> >> I am trying simply to shrink the font size and rotate xaxis labels: >> >> fig1 = plt.figure() >> ax1 = fig1.add_subplot(211) >> ax2 = fig1.add_subplot(212) >> ax1.plot_date(x,y,'r') >> ax1.set_xticklabels(plt.gca().get_xmajorticklabels(), >> size=6,rotation=30) >> ax2.plot_date(o_X['time'],o_X['CO'],'y') >> ax2.set_xticklabels(plt.gca().get_xmajorticklabels(), >> size=6,rotation=30) >> >> I end up with labels as: ("Text(0,0"Text(0,0,"")") >> >> ???? >> -- >> View this message in context: >> http://www.nabble.com/rotating-labels%2C-what-is-wrong-%21-tp24572302p24572302.html >> Sent from the matplotlib - users mailing list archive at Nabble.com. >> >> >> ------------------------------------------------------------------------------ >> Enter the BlackBerry Developer Challenge >> This is your chance to win up to 100,000ドル in prizes! For a limited time, >> vendors submitting new applications to BlackBerry App World(TM) will have >> the opportunity to enter the BlackBerry Developer Challenge. See full >> prize >> details at: http://p.sf.net/sfu/Challenge >> _______________________________________________ >> Matplotlib-users mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> > > ------------------------------------------------------------------------------ > Enter the BlackBerry Developer Challenge > This is your chance to win up to 100,000ドル in prizes! For a limited time, > vendors submitting new applications to BlackBerry App World(TM) will have > the opportunity to enter the BlackBerry Developer Challenge. See full prize > details at: http://p.sf.net/sfu/Challenge > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > > > -- > View this message in context: http://www.nabble.com/rotating-labels%2C-what-is-wrong-%21-tp24572302p24577287.html > Sent from the matplotlib - users mailing list archive at Nabble.com. > > > ------------------------------------------------------------------------------ > Enter the BlackBerry Developer Challenge > This is your chance to win up to 100,000ドル in prizes! For a limited time, > vendors submitting new applications to BlackBerry App World(TM) will have > the opportunity to enter the BlackBerry Developer Challenge. See full prize > details at: http://p.sf.net/sfu/Challenge > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users >
Jae-Joon Lee wrote: > > get_xmajorticklabels() returns a list of matplotlib's "Text" objects, > not python strings. > This is what I've now come to understand, but it seems very odd. Why wouldn't it return the list of strings, or alternatively, how can you get the list of strings? I guess you have to use the pyplot tools, but I was trying to use so called 'fine grain' control and do everything at the axes level. > > plt.setp(plt.gca().get_xmajorticklabels(), > size=6,rotation=30) > In fact, what you show is how I was testing in ipython and it does worked, it just seemed in a script it would be better to use the axis method, but apparently it is different from the gca() method. This is what I don't understand. Thanks! On Mon, Jul 20, 2009 at 11:48 AM, John [H2O]<was...@gm...> wrote: > > I am trying simply to shrink the font size and rotate xaxis labels: > > fig1 = plt.figure() > ax1 = fig1.add_subplot(211) > ax2 = fig1.add_subplot(212) > ax1.plot_date(x,y,'r') > ax1.set_xticklabels(plt.gca().get_xmajorticklabels(), > size=6,rotation=30) > ax2.plot_date(o_X['time'],o_X['CO'],'y') > ax2.set_xticklabels(plt.gca().get_xmajorticklabels(), > size=6,rotation=30) > > I end up with labels as: ("Text(0,0"Text(0,0,"")") > > ???? > -- > View this message in context: > http://www.nabble.com/rotating-labels%2C-what-is-wrong-%21-tp24572302p24572302.html > Sent from the matplotlib - users mailing list archive at Nabble.com. > > > ------------------------------------------------------------------------------ > Enter the BlackBerry Developer Challenge > This is your chance to win up to 100,000ドル in prizes! For a limited time, > vendors submitting new applications to BlackBerry App World(TM) will have > the opportunity to enter the BlackBerry Developer Challenge. See full > prize > details at: http://p.sf.net/sfu/Challenge > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > ------------------------------------------------------------------------------ Enter the BlackBerry Developer Challenge This is your chance to win up to 100,000ドル in prizes! For a limited time, vendors submitting new applications to BlackBerry App World(TM) will have the opportunity to enter the BlackBerry Developer Challenge. See full prize details at: http://p.sf.net/sfu/Challenge _______________________________________________ Matplotlib-users mailing list Mat...@li... https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- View this message in context: http://www.nabble.com/rotating-labels%2C-what-is-wrong-%21-tp24572302p24577287.html Sent from the matplotlib - users mailing list archive at Nabble.com.
Hm.. I added a resize() after the show(): class Plot_tab(QTabWidget, tab): def __init__(self): super(Plot_tab, self).__init__() self.setupUi(self) self.show() self.resize(self.size().width()+1, self.size().height()+1) self.resize(self.size().width()-1, self.size().height()-1) if __name__ == "__main__": import sys app = QApplication(sys.argv) plot_t = Plot_tab() sys.exit(app.exec_()) Now it works, but I really want to know why..? Is there a way to avoid this ugly workaround? Thanks, Lukas Am Sonntag 19 Juli 2009 12:58:53 schrieb Lukas Hetzenecker: > Hello, > > I've tried to resize the QTabWidget, I've searched for examples on the > internet, added a QTabWidget and used this as the Mainwindows central > widget - but exactly the same happened. > > It works if I replace the FigureCanvas with a Qt Widget - for example a > text edit or a QWebView. > > Am Sonntag 19 Juli 2009 11:54:12 schrieb projetmbc: > > Lukas Hetzenecker a écrit : > > > I tried to embed a Matplotlib FigureCanvas into a QTabWidget. > > > But at the first start of my script - the main.py in the attatched > > > example - the widget in the Tab is incorrectly sized. > > > If I embed the FigureCanvas in a QTabWidget the widget is to big, but > > > if I put it in a QWidget it is shown correctly. > > > > I'm not sure that is a pure MatPlotLib issue. Have you try with a big > > standard widget instead of the FigureCanvas ? > > > > Christophe > > --------------------------------------------------------------------------- >--- Enter the BlackBerry Developer Challenge > This is your chance to win up to 100,000ドル in prizes! For a limited time, > vendors submitting new applications to BlackBerry App World(TM) will have > the opportunity to enter the BlackBerry Developer Challenge. See full prize > details at: http://p.sf.net/sfu/Challenge > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
get_xmajorticklabels() returns a list of matplotlib's "Text" objects, not python strings. http://matplotlib.sourceforge.net/api/axes_api.html?highlight=get_xmajorticklabels#matplotlib.axes.Axes.get_xmajorticklabels On the other hand, set_xticklabels() takes a list of python strings. http://matplotlib.sourceforge.net/api/axes_api.html?highlight=set_xticklabels#matplotlib.axes.Axes.set_xticklabels Something like below will work. plt.setp(plt.gca().get_xmajorticklabels(), size=6,rotation=30) -JJ On Mon, Jul 20, 2009 at 11:48 AM, John [H2O]<was...@gm...> wrote: > > I am trying simply to shrink the font size and rotate xaxis labels: > > fig1 = plt.figure() > ax1 = fig1.add_subplot(211) > ax2 = fig1.add_subplot(212) > ax1.plot_date(x,y,'r') > ax1.set_xticklabels(plt.gca().get_xmajorticklabels(), > size=6,rotation=30) > ax2.plot_date(o_X['time'],o_X['CO'],'y') > ax2.set_xticklabels(plt.gca().get_xmajorticklabels(), > size=6,rotation=30) > > I end up with labels as: ("Text(0,0"Text(0,0,"")") > > ???? > -- > View this message in context: http://www.nabble.com/rotating-labels%2C-what-is-wrong-%21-tp24572302p24572302.html > Sent from the matplotlib - users mailing list archive at Nabble.com. > > > ------------------------------------------------------------------------------ > Enter the BlackBerry Developer Challenge > This is your chance to win up to 100,000ドル in prizes! For a limited time, > vendors submitting new applications to BlackBerry App World(TM) will have > the opportunity to enter the BlackBerry Developer Challenge. See full prize > details at: http://p.sf.net/sfu/Challenge > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users >
and if you look at the cookbook .. you can see all the available colormaps.. http://www.scipy.org/Cookbook/Matplotlib/Show_colormaps have fun On Mon, Jul 20, 2009 at 8:25 PM, Eric Firing <ef...@ha...> wrote: > Ritayan Mitra wrote: > > Hello > > I am trying to use imshow as below > > > > im = imshow(Z, interpolation='spline16', origin='lower', cmap=cm.hot, > > extent=(-1.,1.,-1.,1.)) > > > > Trouble is I want to reverse the color gradient or use some colorscheme > > which has lighter color at the bottom and darker higher up. What is the > > easiest solution to this problem? Thanks a bunch. > > All the standard colormaps like cm.hot have reversed counterparts with > "_r" appended to the name, so use cmap=cm.hot_r. > > Eric > > > > Rit > > > > > ------------------------------------------------------------------------------ > Enter the BlackBerry Developer Challenge > This is your chance to win up to 100,000ドル in prizes! For a limited time, > vendors submitting new applications to BlackBerry App World(TM) will have > the opportunity to enter the BlackBerry Developer Challenge. See full prize > details at: http://p.sf.net/sfu/Challenge > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users >
Ritayan Mitra wrote: > Hello > I am trying to use imshow as below > > im = imshow(Z, interpolation='spline16', origin='lower', cmap=cm.hot, > extent=(-1.,1.,-1.,1.)) > > Trouble is I want to reverse the color gradient or use some colorscheme > which has lighter color at the bottom and darker higher up. What is the > easiest solution to this problem? Thanks a bunch. All the standard colormaps like cm.hot have reversed counterparts with "_r" appended to the name, so use cmap=cm.hot_r. Eric > > Rit >
(almost?) all the colormaps exist in reversed forms, eg, cm.hot_r On Jul 20, 2009, at 10:47 AM, Ritayan Mitra wrote: > Hello > I am trying to use imshow as below > > im = imshow(Z, interpolation='spline16', origin='lower', cmap=cm.hot, > extent=(-1.,1.,-1.,1.)) > > Trouble is I want to reverse the color gradient or use some > colorscheme > which has lighter color at the bottom and darker higher up. What is > the > easiest solution to this problem? Thanks a bunch. > > Rit > > > ------------------------------------------------------------------------------ > Enter the BlackBerry Developer Challenge > This is your chance to win up to 100,000ドル in prizes! For a limited > time, > vendors submitting new applications to BlackBerry App World(TM) will > have > the opportunity to enter the BlackBerry Developer Challenge. See > full prize > details at: http://p.sf.net/sfu/Challenge > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users Chloe Lewis Graduate student, Amundson Lab Division of Ecosystem Sciences, ESPM University of California, Berkeley 137 Mulford Hall - #3114 Berkeley, CA 94720-3114 ch...@na...
Hello I am trying to use imshow as below im = imshow(Z, interpolation='spline16', origin='lower', cmap=cm.hot, extent=(-1.,1.,-1.,1.)) Trouble is I want to reverse the color gradient or use some colorscheme which has lighter color at the bottom and darker higher up. What is the easiest solution to this problem? Thanks a bunch. Rit
Hi Ala, On Mon, Jul 20, 2009 at 11:44 AM, Ala Al-Shaibani<sha...@ym...> wrote: > Hello everyone. > A users on the networkx mailing list posted this example which is a > modification of the matplotlib-pyqt4 implementation which plots a networkx > graph. > The problem I am facing with it is that two plot windows open instead of > one, one is empty and the other contains the graph. > I can't really put my finger as to why two windows open rather than just one > pyqt window with the plot. Any suggestions would be appreciated. > Screenshot of the two plot windows: > http://img259.imageshack.us/img259/8722/picture1ahr.jpg > Code: > > #!/usr/bin/env python > > # embedding_in_qt4.py --- Simple Qt4 application embedding matplotlib > canvases > > # > > # Copyright (C) 2005 Florent Rougon > > # 2006 Darren Dale > > # > > # This file is an example program for matplotlib. It may be used and > > # modified with no restriction; raw copies as well as modified versions > > # may be distributed without limitation. > > import sys, os, random > > from PyQt4 import QtGui, QtCore > > from numpy import arange, sin, pi > > from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as > FigureCanvas > > from matplotlib.figure import Figure > > import networkx as nx > > progname = os.path.basename(sys.argv[0]) > > progversion = "0.1" > > class MyMplCanvas(FigureCanvas): > > """Ultimately, this is a QWidget (as well as a FigureCanvasAgg, > etc.).""" > > def __init__(self, parent=None, width=5, height=4, dpi=100): > > fig = Figure(figsize=(width, height), dpi=dpi) > > self.axes = fig.add_subplot(111) > > # We want the axes cleared every time plot() is called > > self.axes.hold(False) > > self.compute_initial_figure() > > # > > FigureCanvas.__init__(self, fig) > > self.setParent(parent) > > FigureCanvas.setSizePolicy(self, > > QtGui.QSizePolicy.Expanding, > > QtGui.QSizePolicy.Expanding) > > FigureCanvas.updateGeometry(self) > > def compute_initial_figure(self): > > pass > > class MyStaticMplCanvas(MyMplCanvas): > > """Simple canvas with a sine plot.""" > > def compute_initial_figure(self): > > G=nx.path_graph(10) > > pos=nx.spring_layout(G) > > nx.draw(G,pos,ax=self.axes) I think this must be the problem. It looks like networkx is providing or building upon the pylab interface, which takes care of creating windows for you. So you are mixing with the object oriented interface from MyMplCanvas, which should not be done. If you want to embed matplotlib in a GUI application, you need to stick with the object oriented interface. Something like: self.axes.some_plot_command(...) Darren
hey everyone, I have an interactive python application that I am using pylab with. I am having a problem where I can only create a graph ONE time. all other calls to plot() and show() cause nothing to happen. I have used ipython -pylab as well, but the problem I am having with ipython is that all the graphs will show up AFTER i close my interactive shell. Of course, ipython works interatively every time I 'plot' or 'show' at the ipython command line. Is this a backend issue? Does anyone else have this problem? issue can be summarized as such: >>>from pylab import * >>>def p(): plot([1,2], [1,2]) show() >>>p() // works fine. graph pops up. >>>p() //returns nothing, no graph shows up >>>p() //same as above I am on Debian Lenny, pylab .98.3-5 Blaine
Hello all, I've been trying to use the volume_overlay functions from matplotlib.finance without luck. Is anyone using it? Below is a simple test program. When I run it, all the volume bars have the same height. Thanks, Christophe #!/usr/bin/env python from pylab import * from matplotlib.dates import DateFormatter, WeekdayLocator, HourLocator, \ DayLocator, MONDAY, timezone from matplotlib.finance import volume_overlay3 mondays = WeekdayLocator(MONDAY) # major ticks on the mondays alldays = DayLocator() # minor ticks on the days weekFormatter = DateFormatter('%b %d') # Eg, Jan 12 dayFormatter = DateFormatter('%d') # Eg, 12 quotes = [(733456.33402777778, 129.5994, 130.0, 130.55000000000001, 129.5, 6178), (733456.33472222218, 129.75, 129.30000000000001, 129.75, 129.30000000000001, 9109), (733456.3354166667, 129.5, 130.0, 130.0, 129.5, 7548), (733456.3361111111, 130.0, 130.0, 130.0, 130.0, 8039), (733456.3368055555, 130.05000000000001, 130.15000000000001, 130.30000000000001, 130.05000000000001, 9633), (733456.33750000002, 130.40000000000001, 130.15000000000001, 130.59999999999999, 130.15000000000001, 2103), (733456.33819444443, 130.15000000000001, 130.44999999999999, 130.44999999999999, 130.15000000000001, 5428), (733456.33888888895, 130.44999999999999, 130.30000000000001, 130.44999999999999, 130.30000000000001, 2025), (733456.33958333335, 130.30000000000001, 130.15000000000001, 130.55000000000001, 130.15000000000001, 3429), (733456.34027777775, 128.90000000000001, 130.05000000000001, 130.09999999999999, 128.90000000000001, 1268), (733456.34097222227, 130.09999999999999, 130.19800000000001, 130.19800000000001, 130.05000000000001, 2891), (733456.34166666667, 130.19999999999999, 130.34999999999999, 130.34999999999999, 130.19999999999999, 1093), (733456.34236111108, 130.40000000000001, 130.44999999999999, 130.5, 130.40000000000001, 1102)] fig = figure() fig.subplots_adjust(bottom=0.2) ax = fig.add_subplot(111) ax.xaxis.set_major_locator(mondays) ax.xaxis.set_minor_locator(alldays) ax.xaxis.set_major_formatter(weekFormatter) ax.xaxis.set_minor_formatter(dayFormatter) volume_overlay3(ax, quotes) ax.xaxis_date() ax.autoscale_view() setp( gca().get_xticklabels(), rotation=45, horizontalalignment='right') show()