From pmhobson at gmail.com Mon Jan 4 00:11:44 2016 From: pmhobson at gmail.com (Paul Hobson) Date: Sun, 3 Jan 2016 21:11:44 -0800 Subject: [Matplotlib-users] [ANN] mpl-probscale v0.1 available through conda Message-ID: Hey everyone, Just a quick plug for a super small module I wrote to extend matplotlib a bit. mpl-probscale provides a probability scale for matplotlib axes. You can install it through my channel on conda: conda install --channel=phobson mpl-probscale. Python 2.7, 3.4, and 3.5 are supported. Documentation: http://phobson.github.io/mpl-probscale/ Github: https://github.com/phobson/mpl-probscale Anaconda: https://anaconda.org/phobson/mpl-probscale -paul -------------- next part -------------- An HTML attachment was scrubbed... URL: From pierre.haessig at crans.org Mon Jan 4 03:09:04 2016 From: pierre.haessig at crans.org (Pierre Haessig) Date: Mon, 4 Jan 2016 09:09:04 +0100 Subject: [Matplotlib-users] [ANN] mpl-probscale v0.1 available through conda In-Reply-To: References: Message-ID: <568A28A0.8040002@crans.org> Hi, This is very interesting. I've looked at your docs and "kind of" understand what the does but I miss a more formal definition of this scale and a clear usage example (without the "readymade plot functions" because they hide to much what's going on). Also, do you think some of your probplot function could interest http://statsmodels.sourceforge.net/stable/graphics.html ? best, Pierre Le 04/01/2016 06:11, Paul Hobson a ?crit : > Hey everyone, > > Just a quick plug for a super small module I wrote to extend > matplotlib a bit. > > mpl-probscale provides a probability scale for matplotlib axes. You > can install it through my channel on conda: > > conda install --channel=phobson mpl-probscale. > > Python 2.7, 3.4, and 3.5 are supported. > > Documentation: http://phobson.github.io/mpl-probscale/ > Github: https://github.com/phobson/mpl-probscale > Anaconda: https://anaconda.org/phobson/mpl-probscale > > -paul > > > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From pmhobson at gmail.com Mon Jan 4 14:41:02 2016 From: pmhobson at gmail.com (Paul Hobson) Date: Mon, 4 Jan 2016 11:41:02 -0800 Subject: [Matplotlib-users] [ANN] mpl-probscale v0.1 available through conda In-Reply-To: <568A28A0.8040002@crans.org> References: <568A28A0.8040002@crans.org> Message-ID: Hey Pierre, Thanks for the question and PR. Basically, all a probability scale is, is a Q-Q plot, but with probabilities displayed instead of Z-scores. See the especially the last figure here: https://en.wikipedia.org/wiki/Q%E2%80%93Q_plot As for statsmodels: I've helped them out with their probplot functionality in the past. I have a stale PR still open about aimed at cleaning things up a bit. -paul On Mon, Jan 4, 2016 at 12:09 AM, Pierre Haessig wrote: > Hi, > > This is very interesting. I've looked at your docs and "kind of" > understand what the does but I miss a more formal definition of this scale > and a clear usage example (without the "readymade plot functions" because > they hide to much what's going on). > > Also, do you think some of your probplot function could interest > http://statsmodels.sourceforge.net/stable/graphics.html ? > > > best, > Pierre > > > Le 04/01/2016 06:11, Paul Hobson a ?crit : > > Hey everyone, > > Just a quick plug for a super small module I wrote to extend matplotlib a > bit. > > mpl-probscale provides a probability scale for matplotlib axes. You can > install it through my channel on conda: > > conda install --channel=phobson mpl-probscale. > > Python 2.7, 3.4, and 3.5 are supported. > > Documentation: http://phobson.github.io/mpl-probscale/ > Github: https://github.com/phobson/mpl-probscale > Anaconda: https://anaconda.org/phobson/mpl-probscale > > -paul > > > _______________________________________________ > Matplotlib-users mailing listMatplotlib-users at python.orghttps://mail.python.org/mailman/listinfo/matplotlib-users > > > > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pierre.haessig at crans.org Tue Jan 5 03:59:18 2016 From: pierre.haessig at crans.org (Pierre Haessig) Date: Tue, 5 Jan 2016 09:59:18 +0100 Subject: [Matplotlib-users] [ANN] mpl-probscale v0.1 available through conda In-Reply-To: References: <568A28A0.8040002@crans.org> Message-ID: <568B85E6.9070401@crans.org> Le 04/01/2016 20:41, Paul Hobson a ?crit : > Basically, all a probability scale is, is a Q-Q plot, but with > probabilities displayed instead of Z-scores. > > See the especially the last figure here: > https://en.wikipedia.org/wiki/Q%E2%80%93Q_plot > Ok I see. Can be pretty useful indeed. At first I thought your probability scale was related to the new logit scale (because it's also about "probabilities"), but now I understand it's completely different. best, Pierre From antony.lee at berkeley.edu Tue Jan 5 08:31:00 2016 From: antony.lee at berkeley.edu (Antony Lee) Date: Tue, 5 Jan 2016 05:31:00 -0800 Subject: [Matplotlib-users] Straw poll on default offset text precision Message-ID: Currently, after e.g. `plot([10000000, 10000010])`, the y-axis is labeled "0, ..., 10 + 1e7". The physicist in me always thought that this was inelegant, as the offset is specified with much less precision than the increments. Yes, I know, there are physical cases where this makes sense, but here this is really just due to "sloppy" formatting: after `plot([12345671, 12345678])`, the y-axis is labeled "0, ..., 7 + 1.2345671e7", so both the offset and the increments have the same precision (ideally, perhaps the offset should be written with the same exponent as the increments, so just 1,234,567 here). Although the issue is "relatively" easy to fix, this will give rise to a lot of zeros in pathological cases such as `plot([.5, .50000001])` (currently 0, ..., 1 x 1e-8 + 5e-1, but 0, ..., 1 x 1e-8 + 0.50000000 after the change). But again, perhaps it makes more sense to actually display these zeros. Thoughts? Antony -------------- next part -------------- An HTML attachment was scrubbed... URL: From ben.v.root at gmail.com Tue Jan 5 10:30:08 2016 From: ben.v.root at gmail.com (Benjamin Root) Date: Tue, 5 Jan 2016 10:30:08 -0500 Subject: [Matplotlib-users] New colormaps : Inferno, Viridis, ... In-Reply-To: <1451223967197-46558.post@n5.nabble.com> References: <1449854948771-46530.post@n5.nabble.com> <566DB117.8070408@hawaii.edu> <1451223967197-46558.post@n5.nabble.com> Message-ID: It is very easy to create a new issue. Go to this page and click on the "New Issue" button. If you don't have a github account already, then you will need to create one, but the website will take you through that process when you click on that button, I think. Cheers! Ben Root On Sun, Dec 27, 2015 at 8:46 AM, Aston630 wrote: > Thank you very much for your answer, I really appreciate your help! > > I would not mind opening an issue on github, but I never did it and I am > not > sure how to go forward with the procedure...could somebody else do it for > me? I am sorry about that. > > Thanks again for everything! > > > > -- > View this message in context: > http://matplotlib.1069221.n5.nabble.com/New-colormaps-Inferno-Viridis-tp46530p46558.html > Sent from the matplotlib - users mailing list archive at Nabble.com. > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pmhobson at gmail.com Tue Jan 5 12:01:18 2016 From: pmhobson at gmail.com (Paul Hobson) Date: Tue, 5 Jan 2016 09:01:18 -0800 Subject: [Matplotlib-users] Question re: installing basemap in ipython In-Reply-To: References: Message-ID: Short story: you're not going to be able to build from source on windows without a lot of finicking and maybe a $10,000 grant. You also don't need to operate from within IPython. The normal command line will suffice. Install it from Christophe Golke's binaries or conda. http://www.lfd.uci.edu/~gohlke/pythonlibs/#basemap On Sat, Dec 26, 2015 at 3:51 PM, BK Linen wrote: > Hi, > I would like to install basemap to use with ipython to map lat,long points > on a map. I have downloaded the following basemap master folder ( > https://github.com/matplotlib/basemap) and issued the install command, > !python setup.py install, in ipython while the working directory was set to > the main basemap folder. > > However, I get an error which appears to be related to a missing file > associated with visual studio: "error: Unable to find vcvarsall.bat" > > To my knowledge, visual studio has not been installed on this machine. I'm > wondering if I need to install visual studio in order to install basemap > for python or if there is a work around. > > If you could point me in the right direction, I would greatly appreciate > it. Many thanks in advance. > > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jni.soma at gmail.com Tue Jan 5 20:23:00 2016 From: jni.soma at gmail.com (Juan Nunez-Iglesias) Date: Wed, 06 Jan 2016 01:23:00 +0000 Subject: [Matplotlib-users] New colormaps : Inferno, Viridis, ... In-Reply-To: References: <1449854948771-46530.post@n5.nabble.com> <566DB117.8070408@hawaii.edu> <1451223967197-46558.post@n5.nabble.com> Message-ID: * Where "this page" means https://github.com/matplotlib/matplotlib/issues =) On Wed, Jan 6, 2016 at 2:37 AM Benjamin Root wrote: > It is very easy to create a new issue. Go to this page and click on the > "New Issue" button. If you don't have a github account already, then you > will need to create one, but the website will take you through that process > when you click on that button, I think. > > Cheers! > Ben Root > > On Sun, Dec 27, 2015 at 8:46 AM, Aston630 > wrote: > >> Thank you very much for your answer, I really appreciate your help! >> >> I would not mind opening an issue on github, but I never did it and I am >> not >> sure how to go forward with the procedure...could somebody else do it for >> me? I am sorry about that. >> >> Thanks again for everything! >> >> >> >> -- >> View this message in context: >> http://matplotlib.1069221.n5.nabble.com/New-colormaps-Inferno-Viridis-tp46530p46558.html >> Sent from the matplotlib - users mailing list archive at Nabble.com. >> _______________________________________________ >> Matplotlib-users mailing list >> Matplotlib-users at python.org >> https://mail.python.org/mailman/listinfo/matplotlib-users >> > > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ben.v.root at gmail.com Tue Jan 5 21:08:05 2016 From: ben.v.root at gmail.com (Benjamin Root) Date: Tue, 5 Jan 2016 21:08:05 -0500 Subject: [Matplotlib-users] New colormaps : Inferno, Viridis, ... In-Reply-To: References: <1449854948771-46530.post@n5.nabble.com> <566DB117.8070408@hawaii.edu> <1451223967197-46558.post@n5.nabble.com> Message-ID: D'oh! I even still had that link in my clipboard! On Jan 5, 2016 8:23 PM, "Juan Nunez-Iglesias" wrote: > * Where "this page" means https://github.com/matplotlib/matplotlib/issues > =) > > On Wed, Jan 6, 2016 at 2:37 AM Benjamin Root wrote: > >> It is very easy to create a new issue. Go to this page and click on the >> "New Issue" button. If you don't have a github account already, then you >> will need to create one, but the website will take you through that process >> when you click on that button, I think. >> >> Cheers! >> Ben Root >> >> On Sun, Dec 27, 2015 at 8:46 AM, Aston630 >> wrote: >> >>> Thank you very much for your answer, I really appreciate your help! >>> >>> I would not mind opening an issue on github, but I never did it and I am >>> not >>> sure how to go forward with the procedure...could somebody else do it for >>> me? I am sorry about that. >>> >>> Thanks again for everything! >>> >>> >>> >>> -- >>> View this message in context: >>> http://matplotlib.1069221.n5.nabble.com/New-colormaps-Inferno-Viridis-tp46530p46558.html >>> Sent from the matplotlib - users mailing list archive at Nabble.com. >>> _______________________________________________ >>> Matplotlib-users mailing list >>> Matplotlib-users at python.org >>> https://mail.python.org/mailman/listinfo/matplotlib-users >>> >> >> _______________________________________________ >> Matplotlib-users mailing list >> Matplotlib-users at python.org >> https://mail.python.org/mailman/listinfo/matplotlib-users >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mdroettboom at continuum.io Wed Jan 6 08:56:20 2016 From: mdroettboom at continuum.io (Michael Droettboom) Date: Wed, 6 Jan 2016 08:56:20 -0500 Subject: [Matplotlib-users] em-dash not correctly displayed in saved pdf when using tex In-Reply-To: References: Message-ID: I can't reproduce with matplotlib master, suggesting this bug has already been fixed. Mike On Mon, Dec 28, 2015 at 4:26 AM, Chao-Chin Yang wrote: > Hi, I am having issues with producing an em-dash in pdf when using tex. A > sample script is as below: > > #!/usr/bin/env python3 > import matplotlib.pyplot as plt > import math > import numpy as np > > x = np.linspace(0, 2 * math.pi) > y = np.cos(x) > > plt.plot(x, y) > plt.suptitle(r"abc --- def") > plt.savefig("test.pdf") > plt.show() > > I have customized rc parameters: > > backend = ?TkAgg? > font.family = ?serif? > text.usetex = True > image.cmap = ?CMRmap" > > The plot rendered on screen looks fine. However, there are some weird > characters showing up right before the em-dash in the saved pdf, as > attached here. > > > > I am using Linux Mint 17.3, and uname -a gives > > Linux Eridanus 3.19.0-32-generic #37~14.04.1-Ubuntu SMP Thu Oct 22 > 09:41:40 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux > > I am using python 3.4.3 + matplotlib 1.3.1, the latter of which is kind of > old, but still remains the latest in the Ubuntu LTS repository. On the > other had, I have installed the texlive-full package, which should include > all the tex related packages. My dvipng is 1.14, and my ghostscript is > 9.10. I have also tried different backends like Agg or PDF, but it makes > no difference. > > I have tried googling around for similar issues, but had no luck. > > It would be very much appreciated If anyone had some idea how this comes > about. > > Sincerely, > Chao-Chin > > > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users > > -- Michael Droettboom Continuum Analytics -------------- next part -------------- An HTML attachment was scrubbed... URL: From tcaswell at gmail.com Wed Jan 6 09:06:45 2016 From: tcaswell at gmail.com (Thomas Caswell) Date: Wed, 06 Jan 2016 14:06:45 +0000 Subject: [Matplotlib-users] em-dash not correctly displayed in saved pdf when using tex In-Reply-To: References: Message-ID: What is the default encoding on your system? I wonder if in `draw_tex` or `dvi_read` we are transcoding the text? Tom On Wed, Jan 6, 2016 at 8:56 AM Michael Droettboom wrote: > I can't reproduce with matplotlib master, suggesting this bug has already > been fixed. > > Mike > > On Mon, Dec 28, 2015 at 4:26 AM, Chao-Chin Yang > wrote: > >> Hi, I am having issues with producing an em-dash in pdf when using tex. >> A sample script is as below: >> >> #!/usr/bin/env python3 >> import matplotlib.pyplot as plt >> import math >> import numpy as np >> >> x = np.linspace(0, 2 * math.pi) >> y = np.cos(x) >> >> plt.plot(x, y) >> plt.suptitle(r"abc --- def") >> plt.savefig("test.pdf") >> plt.show() >> >> I have customized rc parameters: >> >> backend = ?TkAgg? >> font.family = ?serif? >> text.usetex = True >> image.cmap = ?CMRmap" >> >> The plot rendered on screen looks fine. However, there are some weird >> characters showing up right before the em-dash in the saved pdf, as >> attached here. >> >> >> >> I am using Linux Mint 17.3, and uname -a gives >> >> Linux Eridanus 3.19.0-32-generic #37~14.04.1-Ubuntu SMP Thu Oct 22 >> 09:41:40 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux >> >> I am using python 3.4.3 + matplotlib 1.3.1, the latter of which is kind >> of old, but still remains the latest in the Ubuntu LTS repository. On the >> other had, I have installed the texlive-full package, which should include >> all the tex related packages. My dvipng is 1.14, and my ghostscript is >> 9.10. I have also tried different backends like Agg or PDF, but it makes >> no difference. >> >> I have tried googling around for similar issues, but had no luck. >> >> It would be very much appreciated If anyone had some idea how this comes >> about. >> >> Sincerely, >> Chao-Chin >> >> >> _______________________________________________ >> Matplotlib-users mailing list >> Matplotlib-users at python.org >> https://mail.python.org/mailman/listinfo/matplotlib-users >> >> > > > -- > Michael Droettboom > Continuum Analytics > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From cjcorben at hoarybat.com Wed Jan 6 14:24:34 2016 From: cjcorben at hoarybat.com (Chris Corben) Date: Wed, 6 Jan 2016 13:24:34 -0600 Subject: [Matplotlib-users] Problems with Matplotlib examples under Windows Message-ID: <568D69F2.7010103@hoarybat.com> Hi everyone - I am a complete newbie to Matplotlib but love the idea and want to get to know it. I am having problems with three of the matplotlib examples running Jupyter Notebook under Windows. The same problem occurs consistently on three different PCs, two running Win 7 Professional and one running Win 8.1. Matplotlib was obtained by installing 64 bit Anaconda3. I am also using PyCharm 5.0.3 and seeing the same issues. I have done nothing to modify any part of the Anaconda installation. Matplotlib is version 1.5.0 I have also used the same setup under Linux Mint 17.2, where both in Jupyter and PyCharm everything worked. The three examples I have tried which failed are: embedding_in_tk.py embedding_in_tk2.py and embedding_in_tk_canvas.py The results of all these failures are crashes of Python showing the Windows error "Python has stopped working". In PyCharm I stepped through the code to find where it crashed. In: embedding_in_tk.py and embedding_in_tk2.py the crash occurred in the line canvas.show() calling FigureCanvasTkAgg.draw() in backend_tkagg.py calling tkagg.blit() in tkagg.py and crashed in the second attempt at tk.call() In: embedding_in_tk_canvas.py (modified only to import tkinter.py for Python 3) the crash occurred in the line fig_photo = draw_figure(canvas, fig, loc=(fig_x, fig_y)) calling draw_figure() failing in the line tkagg.blit() which calls get_renderer() in backend_agg.py which crashes at the end of the function in the line return self.renderer I ensured at all times that Python 3.5 in Anaconda was used as the interpreter. I presume this is due to some difference in the OS's and would love to hear what I can do about it! Thanks, Chris. -- Chris Corben. From pmhobson at gmail.com Wed Jan 6 15:51:23 2016 From: pmhobson at gmail.com (Paul Hobson) Date: Wed, 6 Jan 2016 12:51:23 -0800 Subject: [Matplotlib-users] Problems with Matplotlib examples under Windows In-Reply-To: <568D69F2.7010103@hoarybat.com> References: <568D69F2.7010103@hoarybat.com> Message-ID: On Wed, Jan 6, 2016 at 11:24 AM, Chris Corben wrote: > Hi everyone - I am a complete newbie to Matplotlib but love the idea and > want to get to know it. > > I am having problems with three of the matplotlib examples running Jupyter > Notebook under Windows. The same problem occurs consistently on three > different PCs, two running Win 7 Professional and one running Win 8.1. > Matplotlib was obtained by installing 64 bit Anaconda3. I am also using > PyCharm 5.0.3 and seeing the same issues. I have done nothing to modify any > part of the Anaconda installation. > Matplotlib is version 1.5.0 > > I have also used the same setup under Linux Mint 17.2, where both in > Jupyter and PyCharm everything worked. > > The three examples I have tried which failed are: > embedding_in_tk.py > embedding_in_tk2.py > and > embedding_in_tk_canvas.py > > The results of all these failures are crashes of Python showing the > Windows error "Python has stopped working". In PyCharm I stepped through > the code to find where it crashed. > In: > embedding_in_tk.py > and > embedding_in_tk2.py > the crash occurred in the line > canvas.show() > calling > FigureCanvasTkAgg.draw() in backend_tkagg.py > calling > tkagg.blit() in tkagg.py > and crashed in the second attempt at > tk.call() > > In: > embedding_in_tk_canvas.py (modified only to import tkinter.py for Python > 3) > the crash occurred in the line > fig_photo = draw_figure(canvas, fig, loc=(fig_x, fig_y)) > calling > draw_figure() > failing in the line > tkagg.blit() > which calls > get_renderer() in backend_agg.py > which crashes at the end of the function in the line > return self.renderer > > I ensured at all times that Python 3.5 in Anaconda was used as the > interpreter. > > I presume this is due to some difference in the OS's and would love to > hear what I can do about it! At first glance, it seems like your windows machine doesn't have the TkAgg backend. If everything else ran, I wouldn't working about this. -paul -------------- next part -------------- An HTML attachment was scrubbed... URL: From cjcorben at hoarybat.com Thu Jan 7 17:43:52 2016 From: cjcorben at hoarybat.com (Chris Corben) Date: Thu, 7 Jan 2016 16:43:52 -0600 Subject: [Matplotlib-users] Problems with Matplotlib examples under Windows In-Reply-To: References: <568D69F2.7010103@hoarybat.com> Message-ID: <568EEA28.8000302@hoarybat.com> Thanks Paul. I guess I expected Tkagg to be installed with Anaconda, and certainly the tkagg.py file is present. Is there some thing else I need to do to get the backend in my OS? Chris. On 1/6/2016 2:51 PM, Paul Hobson wrote: > > > On Wed, Jan 6, 2016 at 11:24 AM, Chris Corben > wrote: > > Hi everyone - I am a complete newbie to Matplotlib but love the > idea and want to get to know it. > > I am having problems with three of the matplotlib examples running > Jupyter Notebook under Windows. The same problem occurs > consistently on three different PCs, two running Win 7 > Professional and one running Win 8.1. Matplotlib was obtained by > installing 64 bit Anaconda3. I am also using PyCharm 5.0.3 and > seeing the same issues. I have done nothing to modify any part of > the Anaconda installation. > Matplotlib is version 1.5.0 > > I have also used the same setup under Linux Mint 17.2, where both > in Jupyter and PyCharm everything worked. > > The three examples I have tried which failed are: > embedding_in_tk.py > embedding_in_tk2.py > and > embedding_in_tk_canvas.py > > The results of all these failures are crashes of Python showing > the Windows error "Python has stopped working". In PyCharm I > stepped through the code to find where it crashed. > In: > embedding_in_tk.py > and > embedding_in_tk2.py > the crash occurred in the line > canvas.show() > calling > FigureCanvasTkAgg.draw() in backend_tkagg.py > calling > tkagg.blit() in tkagg.py > and crashed in the second attempt at > tk.call() > > In: > embedding_in_tk_canvas.py (modified only to import tkinter.py for > Python 3) > the crash occurred in the line > fig_photo = draw_figure(canvas, fig, loc=(fig_x, fig_y)) > calling > draw_figure() > failing in the line > tkagg.blit() > which calls > get_renderer() in backend_agg.py > which crashes at the end of the function in the line > return self.renderer > > I ensured at all times that Python 3.5 in Anaconda was used as the > interpreter. > > I presume this is due to some difference in the OS's and would > love to hear what I can do about it! > > > At first glance, it seems like your windows machine doesn't have the > TkAgg backend. If everything else ran, I wouldn't working about this. > > -paul > -- Chris Corben. -------------- next part -------------- An HTML attachment was scrubbed... URL: From pmhobson at gmail.com Thu Jan 7 18:18:38 2016 From: pmhobson at gmail.com (Paul Hobson) Date: Thu, 7 Jan 2016 15:18:38 -0800 Subject: [Matplotlib-users] Problems with Matplotlib examples under Windows In-Reply-To: <568EEA28.8000302@hoarybat.com> References: <568D69F2.7010103@hoarybat.com> <568EEA28.8000302@hoarybat.com> Message-ID: Not sure. Maybe "conda install tk"? On Thu, Jan 7, 2016 at 2:43 PM, Chris Corben wrote: > Thanks Paul. > > I guess I expected Tkagg to be installed with Anaconda, and certainly the > tkagg.py file is present. Is there some thing else I need to do to get the > backend in my OS? > > Chris. > > > On 1/6/2016 2:51 PM, Paul Hobson wrote: > > > > On Wed, Jan 6, 2016 at 11:24 AM, Chris Corben > wrote: > >> Hi everyone - I am a complete newbie to Matplotlib but love the idea and >> want to get to know it. >> >> I am having problems with three of the matplotlib examples running >> Jupyter Notebook under Windows. The same problem occurs consistently on >> three different PCs, two running Win 7 Professional and one running Win >> 8.1. Matplotlib was obtained by installing 64 bit Anaconda3. I am also >> using PyCharm 5.0.3 and seeing the same issues. I have done nothing to >> modify any part of the Anaconda installation. >> Matplotlib is version 1.5.0 >> >> I have also used the same setup under Linux Mint 17.2, where both in >> Jupyter and PyCharm everything worked. >> >> The three examples I have tried which failed are: >> embedding_in_tk.py >> embedding_in_tk2.py >> and >> embedding_in_tk_canvas.py >> >> The results of all these failures are crashes of Python showing the >> Windows error "Python has stopped working". In PyCharm I stepped through >> the code to find where it crashed. >> In: >> embedding_in_tk.py >> and >> embedding_in_tk2.py >> the crash occurred in the line >> canvas.show() >> calling >> FigureCanvasTkAgg.draw() in backend_tkagg.py >> calling >> tkagg.blit() in tkagg.py >> and crashed in the second attempt at >> tk.call() >> >> In: >> embedding_in_tk_canvas.py (modified only to import tkinter.py for Python >> 3) >> the crash occurred in the line >> fig_photo = draw_figure(canvas, fig, loc=(fig_x, fig_y)) >> calling >> draw_figure() >> failing in the line >> tkagg.blit() >> which calls >> get_renderer() in backend_agg.py >> which crashes at the end of the function in the line >> return self.renderer >> >> I ensured at all times that Python 3.5 in Anaconda was used as the >> interpreter. >> >> I presume this is due to some difference in the OS's and would love to >> hear what I can do about it! > > > At first glance, it seems like your windows machine doesn't have the TkAgg > backend. If everything else ran, I wouldn't working about this. > > -paul > > > > -- > > Chris Corben. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From enkhee.data at gmail.com Thu Jan 7 21:52:41 2016 From: enkhee.data at gmail.com (Enkhbayar Erdenee) Date: Fri, 8 Jan 2016 11:52:41 +0900 Subject: [Matplotlib-users] Widget event issue #5812 Message-ID: Hello I have an issue on widget events. I have created a figure which contains several subplots. When click on one of the subplots, it shows another figure. This new figure contains button and rectangle selector widgets. Until this it works fine. Problem is nothing happens if I click on the buttons or draw rectangle on this new figure. It works well (i mean button onclick, line_select_callback events raise ), if I just create figure not after click the subplots. I do not know what I am doing wrong. Please help me. By the way, I am using: matplotlib.*version* : '1.4.3' matplotlib.get_backend() : Qt4Agg python: 2.7.10 | Anaconda 2.3.0 (64-bit) Here is the some part of code that I having problem: import sys import cv2 from matplotlib.widgets import RectangleSelector import matplotlib.pyplot as plt from matplotlib.widgets import Button def main_window(): def open_figure(event): ax = event.inaxes if ax is None: # Occurs when a region not in an axis is clicked... return for i in xrange(len(event.canvas.figure.axes)): if event.canvas.figure.axes[i] is ax: plt.ion() # Show clicked image on new figure show_new_figure(im) fig = plt.figure(1) # some code which locates subplots # show images on subplots show_image(im) fig.canvas.mpl_connect('button_press_event', open_figure) plt.show() def show_image(im): im = im[:, :, (2, 1, 0)] plt.cla() plt.imshow(im) plt.axis('off') plt.draw() # plt.show() def show_new_figure(im): class Btn: def save(self, event): plt.close() def close(self, event): plt.close() def exit(self, event): sys.exit() callback = Btn() im = im[:, :, (2, 1, 0)] fig2, ax = plt.subplots(figsize=(10, 10)) plt.cla() plt.imshow(im) axSave = plt.axes([0.5, 0.01, 0.1, 0.075]) axClose = plt.axes([0.39, 0.01, 0.1, 0.075]) axExit = plt.axes([0.6, 0.01, 0.1, 0.075]) btnSave = Button(axSave, 'Save') btnSave.on_clicked(callback.save) btnClose = Button(axClose, 'Close') btnClose.on_clicked(callback.close) btnExit = Button(axExit, 'Exit') btnExit.on_clicked(callback.exit) # draw rectangle def line_select_callback(eclick, erelease): 'eclick and erelease are the press and release events' x1, y1 = eclick.xdata, eclick.ydata x2, y2 = erelease.xdata, erelease.ydata print ("X, Y points: (%3.2f, %3.2f) --> (%3.2f, %3.2f)" % (x1, y1, x2, y2)) rs = RectangleSelector(ax, line_select_callback, drawtype='box', useblit=True, button=[1, 3], minspanx=5, minspany=5, rectprops=dict(facecolor='blue', edgecolor='blue', alpha=1, fill=False), spancoords='pixels') rs.set_active(True) plt.axis('off') plt.show() Thank you for consideration. -------------- next part -------------- An HTML attachment was scrubbed... URL: From tcaswell at gmail.com Thu Jan 7 22:29:17 2016 From: tcaswell at gmail.com (Thomas Caswell) Date: Fri, 08 Jan 2016 03:29:17 +0000 Subject: [Matplotlib-users] Widget event issue #5812 In-Reply-To: References: Message-ID: There is something a bit sutble going on here, see the following code: import matplotlib.pyplot as plt from six.moves import range import sys from matplotlib.widgets import RectangleSelector from matplotlib.widgets import Button def main_window(im): ref_holder = dict() def open_figure(event): ax = event.inaxes if ax is None: # Occurs when a region not in an axis is clicked... return for i in range(len(event.canvas.figure.axes)): if event.canvas.figure.axes[i] is ax: ret = show_new_figure(im) ref_holder['last interactive'] = ret fig, ax = plt.subplots() # some code which locates subplots # show images on subplots show_image(ax, im) fig.canvas.mpl_connect('button_press_event', open_figure) plt.show() return fig, ax def show_image(ax, im): ax.cla() ax.imshow(im, cmap='gray', interpolation='nearest') def show_new_figure(im): fig, ax = plt.subplots(figsize=(10, 10)) class Btn(object): def save(self, event): fig.canvas.manager.toolbar.save_figure() def close(self, event): plt.close(fig) def exit(self, event): sys.exit() callback = Btn() ax.imshow(im, cmap='Reds', interpolation='nearest') axSave = plt.axes([0.5, 0.01, 0.1, 0.075]) axClose = plt.axes([0.39, 0.01, 0.1, 0.075]) axExit = plt.axes([0.6, 0.01, 0.1, 0.075]) btnSave = Button(axSave, 'Save') btnSave.on_clicked(callback.save) btnClose = Button(axClose, 'Close') btnClose.on_clicked(callback.close) btnExit = Button(axExit, 'Exit') btnExit.on_clicked(callback.exit) # draw rectangle def line_select_callback(eclick, erelease): 'eclick and erelease are the press and release events' x1, y1 = eclick.xdata, eclick.ydata x2, y2 = erelease.xdata, erelease.ydata print("X, Y points: (%3.2f, %3.2f) --> (%3.2f, %3.2f)" % (x1, y1, x2, y2)) rs = RectangleSelector(ax, line_select_callback, drawtype='box', useblit=True, button=[1, 3], minspanx=5, minspany=5, rectprops=dict(facecolor='blue', edgecolor='blue', alpha=1, fill=False), spancoords='pixels') rs.set_active(True) return rs, btnSave, btnClose, btnExit The critical bit is that the `show_new_figure` function is returning the `widget` objects and `open_figure` is stashing them in a local dictionary. What is happening is that without holding on to a reference to the widget objects they get garbage collected. By design, the callback registries only hold on to a weak-ref (that is a reference that will not prevent garbage collection if it is the last reference left), so if you do not keep a reference to the widgets, the get garbage collections and hence do not exist to get the click events. This is documented in the widget class docstring (ex http://matplotlib.org/api/widgets_api.html#matplotlib.widgets.Button) Tom On Thu, Jan 7, 2016 at 9:52 PM Enkhbayar Erdenee wrote: > Hello > > I have an issue on widget events. I have created a figure which contains > several subplots. When click on one of the subplots, it shows another > figure. This new figure contains button and rectangle selector widgets. > Until this it works fine. Problem is nothing happens if I click on the > buttons or draw rectangle on this new figure. It works well (i mean button > onclick, line_select_callback events raise ), if I just create figure not > after click the subplots. I do not know what I am doing wrong. Please help > me. > > By the way, I am using: > matplotlib.*version* : '1.4.3' > matplotlib.get_backend() : Qt4Agg > python: 2.7.10 | Anaconda 2.3.0 (64-bit) > > > Here is the some part of code that I having problem: > > > import sys > > import cv2 > > from matplotlib.widgets import RectangleSelector > > import matplotlib.pyplot as plt > > from matplotlib.widgets import Button > > > def main_window(): > > > def open_figure(event): > > ax = event.inaxes > > if ax is None: > > # Occurs when a region not in an axis is clicked... > > return > > for i in xrange(len(event.canvas.figure.axes)): > > if event.canvas.figure.axes[i] is ax: > > plt.ion() > > # Show clicked image on new figure > > show_new_figure(im) > > > fig = plt.figure(1) > > > > # some code which locates subplots > > # show images on subplots > > show_image(im) > > > > fig.canvas.mpl_connect('button_press_event', open_figure) > > plt.show() > > > def show_image(im): > > im = im[:, :, (2, 1, 0)] > > plt.cla() > > plt.imshow(im) > > plt.axis('off') > > plt.draw() > > # plt.show() > > > def show_new_figure(im): > > > class Btn: > > def save(self, event): > > plt.close() > > def close(self, event): > > plt.close() > > def exit(self, event): > > sys.exit() > > > callback = Btn() > > > im = im[:, :, (2, 1, 0)] > > fig2, ax = plt.subplots(figsize=(10, 10)) > > plt.cla() > > plt.imshow(im) > > > axSave = plt.axes([0.5, 0.01, 0.1, 0.075]) > > axClose = plt.axes([0.39, 0.01, 0.1, 0.075]) > > axExit = plt.axes([0.6, 0.01, 0.1, 0.075]) > > > btnSave = Button(axSave, 'Save') > > btnSave.on_clicked(callback.save) > > btnClose = Button(axClose, 'Close') > > btnClose.on_clicked(callback.close) > > btnExit = Button(axExit, 'Exit') > > btnExit.on_clicked(callback.exit) > > > # draw rectangle > > def line_select_callback(eclick, erelease): > > 'eclick and erelease are the press and release events' > > x1, y1 = eclick.xdata, eclick.ydata > > x2, y2 = erelease.xdata, erelease.ydata > > print ("X, Y points: (%3.2f, %3.2f) --> (%3.2f, %3.2f)" % (x1, y1, > x2, y2)) > > > rs = RectangleSelector(ax, line_select_callback, > > drawtype='box', useblit=True, > > button=[1, 3], > > minspanx=5, minspany=5, > > rectprops=dict(facecolor='blue', > edgecolor='blue', > > alpha=1, fill=False), > > spancoords='pixels') > > rs.set_active(True) > > > plt.axis('off') > > plt.show() > > > Thank you for consideration. > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From enkhee.data at gmail.com Fri Jan 8 03:07:29 2016 From: enkhee.data at gmail.com (Enkhbayar Erdenee) Date: Fri, 8 Jan 2016 17:07:29 +0900 Subject: [Matplotlib-users] Widget event issue #5812 In-Reply-To: References: Message-ID: Thank you for taking time. I have changed the code according to your advice and it works well. Now I have a clear understanding how to use pyplot and widgets of matplotlib. Thank you again, your advice helped me a lot :) On Fri, Jan 8, 2016 at 12:29 PM, Thomas Caswell wrote: > There is something a bit sutble going on here, see the following code: > > import matplotlib.pyplot as plt > from six.moves import range > import sys > > from matplotlib.widgets import RectangleSelector > from matplotlib.widgets import Button > > > def main_window(im): > ref_holder = dict() > > def open_figure(event): > ax = event.inaxes > if ax is None: > # Occurs when a region not in an axis is clicked... > return > for i in range(len(event.canvas.figure.axes)): > if event.canvas.figure.axes[i] is ax: > ret = show_new_figure(im) > ref_holder['last interactive'] = ret > > fig, ax = plt.subplots() > > # some code which locates subplots > # show images on subplots > show_image(ax, im) > > fig.canvas.mpl_connect('button_press_event', open_figure) > plt.show() > > return fig, ax > > > def show_image(ax, im): > ax.cla() > ax.imshow(im, cmap='gray', interpolation='nearest') > > > def show_new_figure(im): > fig, ax = plt.subplots(figsize=(10, 10)) > > class Btn(object): > def save(self, event): > fig.canvas.manager.toolbar.save_figure() > > def close(self, event): > plt.close(fig) > > def exit(self, event): > sys.exit() > > callback = Btn() > > ax.imshow(im, cmap='Reds', interpolation='nearest') > > axSave = plt.axes([0.5, 0.01, 0.1, 0.075]) > axClose = plt.axes([0.39, 0.01, 0.1, 0.075]) > axExit = plt.axes([0.6, 0.01, 0.1, 0.075]) > > btnSave = Button(axSave, 'Save') > btnSave.on_clicked(callback.save) > btnClose = Button(axClose, 'Close') > btnClose.on_clicked(callback.close) > btnExit = Button(axExit, 'Exit') > btnExit.on_clicked(callback.exit) > > # draw rectangle > def line_select_callback(eclick, erelease): > 'eclick and erelease are the press and release events' > x1, y1 = eclick.xdata, eclick.ydata > x2, y2 = erelease.xdata, erelease.ydata > print("X, Y points: (%3.2f, %3.2f) --> (%3.2f, %3.2f)" % > (x1, y1, x2, y2)) > > rs = RectangleSelector(ax, line_select_callback, > drawtype='box', useblit=True, > button=[1, 3], > minspanx=5, minspany=5, > rectprops=dict(facecolor='blue', > edgecolor='blue', > alpha=1, fill=False), > spancoords='pixels') > rs.set_active(True) > > return rs, btnSave, btnClose, btnExit > > > The critical bit is that the `show_new_figure` function is returning the > `widget` objects and `open_figure` is stashing them in a local dictionary. > What is happening is that without holding on to a reference to the widget > objects they get garbage collected. By design, the callback registries > only hold on to a weak-ref (that is a reference that will not prevent > garbage collection if it is the last reference left), so if you do not keep > a reference to the widgets, the get garbage collections and hence do not > exist to get the click events. This is documented in the widget class > docstring (ex > http://matplotlib.org/api/widgets_api.html#matplotlib.widgets.Button) > > Tom > > On Thu, Jan 7, 2016 at 9:52 PM Enkhbayar Erdenee > wrote: > >> Hello >> >> I have an issue on widget events. I have created a figure which contains >> several subplots. When click on one of the subplots, it shows another >> figure. This new figure contains button and rectangle selector widgets. >> Until this it works fine. Problem is nothing happens if I click on the >> buttons or draw rectangle on this new figure. It works well (i mean button >> onclick, line_select_callback events raise ), if I just create figure not >> after click the subplots. I do not know what I am doing wrong. Please help >> me. >> >> By the way, I am using: >> matplotlib.*version* : '1.4.3' >> matplotlib.get_backend() : Qt4Agg >> python: 2.7.10 | Anaconda 2.3.0 (64-bit) >> >> >> Here is the some part of code that I having problem: >> >> >> import sys >> >> import cv2 >> >> from matplotlib.widgets import RectangleSelector >> >> import matplotlib.pyplot as plt >> >> from matplotlib.widgets import Button >> >> >> def main_window(): >> >> >> def open_figure(event): >> >> ax = event.inaxes >> >> if ax is None: >> >> # Occurs when a region not in an axis is clicked... >> >> return >> >> for i in xrange(len(event.canvas.figure.axes)): >> >> if event.canvas.figure.axes[i] is ax: >> >> plt.ion() >> >> # Show clicked image on new figure >> >> show_new_figure(im) >> >> >> fig = plt.figure(1) >> >> >> >> # some code which locates subplots >> >> # show images on subplots >> >> show_image(im) >> >> >> >> fig.canvas.mpl_connect('button_press_event', open_figure) >> >> plt.show() >> >> >> def show_image(im): >> >> im = im[:, :, (2, 1, 0)] >> >> plt.cla() >> >> plt.imshow(im) >> >> plt.axis('off') >> >> plt.draw() >> >> # plt.show() >> >> >> def show_new_figure(im): >> >> >> class Btn: >> >> def save(self, event): >> >> plt.close() >> >> def close(self, event): >> >> plt.close() >> >> def exit(self, event): >> >> sys.exit() >> >> >> callback = Btn() >> >> >> im = im[:, :, (2, 1, 0)] >> >> fig2, ax = plt.subplots(figsize=(10, 10)) >> >> plt.cla() >> >> plt.imshow(im) >> >> >> axSave = plt.axes([0.5, 0.01, 0.1, 0.075]) >> >> axClose = plt.axes([0.39, 0.01, 0.1, 0.075]) >> >> axExit = plt.axes([0.6, 0.01, 0.1, 0.075]) >> >> >> btnSave = Button(axSave, 'Save') >> >> btnSave.on_clicked(callback.save) >> >> btnClose = Button(axClose, 'Close') >> >> btnClose.on_clicked(callback.close) >> >> btnExit = Button(axExit, 'Exit') >> >> btnExit.on_clicked(callback.exit) >> >> >> # draw rectangle >> >> def line_select_callback(eclick, erelease): >> >> 'eclick and erelease are the press and release events' >> >> x1, y1 = eclick.xdata, eclick.ydata >> >> x2, y2 = erelease.xdata, erelease.ydata >> >> print ("X, Y points: (%3.2f, %3.2f) --> (%3.2f, %3.2f)" % (x1, >> y1, x2, y2)) >> >> >> rs = RectangleSelector(ax, line_select_callback, >> >> drawtype='box', useblit=True, >> >> button=[1, 3], >> >> minspanx=5, minspany=5, >> >> rectprops=dict(facecolor='blue', >> edgecolor='blue', >> >> alpha=1, fill=False), >> >> spancoords='pixels') >> >> rs.set_active(True) >> >> >> plt.axis('off') >> >> plt.show() >> >> >> Thank you for consideration. >> _______________________________________________ >> Matplotlib-users mailing list >> Matplotlib-users at python.org >> https://mail.python.org/mailman/listinfo/matplotlib-users >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ndbecker2 at gmail.com Fri Jan 8 07:03:33 2016 From: ndbecker2 at gmail.com (Neal Becker) Date: Fri, 08 Jan 2016 07:03:33 -0500 Subject: [Matplotlib-users] strange inconsistency Message-ID: In the following script, in the call to hexbin, I can use ax.hexbin or plt.hexbin but in the call to colorbar, I can only use plt.colorbar not ax.colorbar This seems strangely inconsistent ------------------------------ import numpy as np from dill import load a,r = load (open ('test2.log.pickle', 'rb')) remod_2dhist = r['remod_2dhist'] import matplotlib.pyplot as plt # from mpl_toolkits.mplot3d import Axes3D # from matplotlib import cm #import matplotlib as mpl mpl.rc('font', family='sans') fig = plt.figure() ax = fig.add_subplot(111) weights = [] xs = [] ys = [] X, Y = remod_2dhist.get_axes() for i,x in enumerate (X): for j,y in enumerate (Y): if remod_2dhist.buckets[i,j] != 0: weights.append (remod_2dhist.buckets[i,j]) xs.append (x) ys.append (y) plt.hexbin (xs, ys, weights, mincnt=1, bins='log') cb = plt.colorbar() cb.set_label('log10(N)') ax.set_xlabel (r'demod $S/(N+I)$(dB) relative') ax.set_ylabel (r'remod mse(dB) absolute') plt.show() From tcaswell at gmail.com Fri Jan 8 07:23:41 2016 From: tcaswell at gmail.com (Thomas Caswell) Date: Fri, 08 Jan 2016 12:23:41 +0000 Subject: [Matplotlib-users] strange inconsistency In-Reply-To: References: Message-ID: The `colorbar` method lives on the figure, not the axes. This is because making the colorbar may re-arrange the layout of the axes in the parent figure and does not anything to the draw tree of `ax`. sm = ax.hexbin(...) fig.colorbar(sm, ..) should work ( http://matplotlib.org/api/figure_api.html#matplotlib.figure.Figure.colorbar ). Tom On Fri, Jan 8, 2016 at 7:03 AM Neal Becker wrote: > In the following script, in the call to hexbin, I can use > ax.hexbin > or > plt.hexbin > > but in the call to colorbar, I can only use > plt.colorbar > not > ax.colorbar > > This seems strangely inconsistent > > ------------------------------ > import numpy as np > from dill import load > > a,r = load (open ('test2.log.pickle', 'rb')) > remod_2dhist = r['remod_2dhist'] > > import matplotlib.pyplot as plt > > # from mpl_toolkits.mplot3d import Axes3D > # from matplotlib import cm > #import matplotlib as mpl > mpl.rc('font', family='sans') > > fig = plt.figure() > ax = fig.add_subplot(111) > > weights = [] > xs = [] > ys = [] > X, Y = remod_2dhist.get_axes() > for i,x in enumerate (X): > for j,y in enumerate (Y): > if remod_2dhist.buckets[i,j] != 0: > weights.append (remod_2dhist.buckets[i,j]) > xs.append (x) > ys.append (y) > > plt.hexbin (xs, ys, weights, mincnt=1, bins='log') > cb = plt.colorbar() > cb.set_label('log10(N)') > ax.set_xlabel (r'demod $S/(N+I)$(dB) relative') > ax.set_ylabel (r'remod mse(dB) absolute') > plt.show() > > > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From silva at lma.cnrs-mrs.fr Fri Jan 8 07:15:50 2016 From: silva at lma.cnrs-mrs.fr (Fabrice Silva) Date: Fri, 08 Jan 2016 13:15:50 +0100 Subject: [Matplotlib-users] strange inconsistency In-Reply-To: References: Message-ID: <1452255350.4053.28.camel@lma.cnrs-mrs.fr> Le vendredi 08 janvier 2016, Neal Becker a ?crit : > In the following script, in the call to hexbin, I can use > ax.hexbin > or > plt.hexbin > > but in the call to colorbar, I can only use > plt.colorbar > not > ax.colorbar > > This seems strangely inconsistent Because the colorbar is not attached to the axes instance, but to the figure instance as it can illustrate any Image, ContourSet, etc... in the figure. From david at jaguarondi.com Wed Jan 13 06:03:06 2016 From: david at jaguarondi.com (David Bourgeois) Date: Wed, 13 Jan 2016 12:03:06 +0100 Subject: [Matplotlib-users] Different colors between imshow and patches Message-ID: In Matplotlib, images and patches are shown on screen with different color rendering, at least with my setup. The following script displays an image of a grayscale (np.array) overlaid at the center with the same grayscale generated from matplotlib.patches. There is a difference of gamma between the image and the patches on what's displayed on screen but if I save this figure, then the resulting file is correct. Checking with some graphic software, the patches are displaying the correct color, not the image. Snapshot: http://i.stack.imgur.com/mv8aU.jpg Saving the figure from the figure window 'save' button gives this: http://i.stack.imgur.com/fVNnh.png Is there anything I'm missing in this code? import numpy as np import matplotlib.pyplot as plt from matplotlib.patches import Rectangle color = np.zeros(3) f, ax = plt.subplots() im = np.zeros((1000, 1100,3)) for i in range(11): im[:,i*100:(i+1)*100,:] = np.tile(np.array([[color]]), (1000, 100, 1)) ax.add_patch(Rectangle((i*100,300), 100, 400, linewidth=0, facecolor=color)) color = color + 0.1 plt.imshow(im) plt.show() I'm on OSX, so I also checked the color management and by changing the color profile of my display, both image and patches are affected so I guess color management is not where the problem lies. Thank you, David -------------- next part -------------- An HTML attachment was scrubbed... URL: From jenshnielsen at gmail.com Wed Jan 13 06:29:38 2016 From: jenshnielsen at gmail.com (Jens Nielsen) Date: Wed, 13 Jan 2016 11:29:38 +0000 Subject: [Matplotlib-users] Different colors between imshow and patches In-Reply-To: References: Message-ID: It looks like a bug in the OSX backend. I can reproduce with the OSX backend but it looks correct with any other backend that also explains why the saved images looks correct. If you have other GUI toolkits installed you can switch by adding import matplotlib matplotlib.use('Qt4Agg') #Or any other backend before importing pyplot the first time best Jens On Wed, 13 Jan 2016 at 11:08 David Bourgeois wrote: > In Matplotlib, images and patches are shown on screen with different color > rendering, at least with my setup. The following script displays an image > of a grayscale (np.array) overlaid at the center with the same grayscale > generated from matplotlib.patches. > > There is a difference of gamma between the image and the patches on what's > displayed on screen but if I save this figure, then the resulting file is > correct. Checking with some graphic software, the patches are displaying > the correct color, not the image. > > Snapshot: > http://i.stack.imgur.com/mv8aU.jpg > > Saving the figure from the figure window 'save' button gives this: > http://i.stack.imgur.com/fVNnh.png > > Is there anything I'm missing in this code? > > import numpy as np > import matplotlib.pyplot as plt > from matplotlib.patches import Rectangle > > color = np.zeros(3) > > f, ax = plt.subplots() > im = np.zeros((1000, 1100,3)) > for i in range(11): > im[:,i*100:(i+1)*100,:] = np.tile(np.array([[color]]), (1000, 100, > 1)) > ax.add_patch(Rectangle((i*100,300), 100, 400, linewidth=0, > facecolor=color)) > color = color + 0.1 > plt.imshow(im) > plt.show() > > I'm on OSX, so I also checked the color management and by changing the > color profile of my display, both image and patches are affected so I guess > color management is not where the problem lies. > > Thank you, > David > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From david at jaguarondi.com Wed Jan 13 06:33:41 2016 From: david at jaguarondi.com (David Bourgeois) Date: Wed, 13 Jan 2016 12:33:41 +0100 Subject: [Matplotlib-users] (no subject) Message-ID: Indeed, it works with Qt. I'm going to report this as a bug then. Thank you, David On Wed, Jan 13, 2016 at 12:29 PM, Jens Nielsen wrote: > It looks like a bug in the OSX backend. I can reproduce with the OSX > backend but it looks correct with any other backend that also explains why > the saved images looks correct. > If you have other GUI toolkits installed you can switch by adding > > import matplotlib > matplotlib.use('Qt4Agg') #Or any other backend > > before importing pyplot the first time > > best > Jens > > On Wed, 13 Jan 2016 at 11:08 David Bourgeois wrote: > >> In Matplotlib, images and patches are shown on screen with different >> color rendering, at least with my setup. The following script displays an >> image of a grayscale (np.array) overlaid at the center with the same >> grayscale generated from matplotlib.patches. >> >> There is a difference of gamma between the image and the patches on >> what's displayed on screen but if I save this figure, then the resulting >> file is correct. Checking with some graphic software, the patches are >> displaying the correct color, not the image. >> >> Snapshot: >> http://i.stack.imgur.com/mv8aU.jpg >> >> Saving the figure from the figure window 'save' button gives this: >> http://i.stack.imgur.com/fVNnh.png >> >> Is there anything I'm missing in this code? >> >> import numpy as np >> import matplotlib.pyplot as plt >> from matplotlib.patches import Rectangle >> >> color = np.zeros(3) >> >> f, ax = plt.subplots() >> im = np.zeros((1000, 1100,3)) >> for i in range(11): >> im[:,i*100:(i+1)*100,:] = np.tile(np.array([[color]]), (1000, >> 100, 1)) >> ax.add_patch(Rectangle((i*100,300), 100, 400, linewidth=0, >> facecolor=color)) >> color = color + 0.1 >> plt.imshow(im) >> plt.show() >> >> I'm on OSX, so I also checked the color management and by changing the >> color profile of my display, both image and patches are affected so I guess >> color management is not where the problem lies. >> >> Thank you, >> David >> _______________________________________________ >> Matplotlib-users mailing list >> Matplotlib-users at python.org >> https://mail.python.org/mailman/listinfo/matplotlib-users >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ndbecker2 at gmail.com Thu Jan 14 08:15:46 2016 From: ndbecker2 at gmail.com (Neal Becker) Date: Thu, 14 Jan 2016 08:15:46 -0500 Subject: [Matplotlib-users] plot with 2 scales (not 2 plots) Message-ID: I'm trying to make a plot which has 2 scales (linearly related), but just 1 set of data. I've seen many examples with 2 plots and 2 scales, but that's not what I need here. I blindly followed some examples and was able to make a pretty good plot with one scale on bottom and one on top. I'd like to see how it looks with 2 scales on the bottom, with an offset between them, but I don't know how to do it. Attached is the current version. -------------- next part -------------- A non-text attachment was scrubbed... Name: linear_awgn_ascma_vs_scma_5.py Type: text/x-python Size: 2319 bytes Desc: not available URL: From ben.v.root at gmail.com Thu Jan 14 09:43:11 2016 From: ben.v.root at gmail.com (Benjamin Root) Date: Thu, 14 Jan 2016 09:43:11 -0500 Subject: [Matplotlib-users] plot with 2 scales (not 2 plots) In-Reply-To: References: Message-ID: Just do a parasite axis using axisartist. This example does have two plots, but you don't have to do the first one: http://matplotlib.org/examples/axes_grid/demo_parasite_axes2.html Cheers! Ben Root On Thu, Jan 14, 2016 at 8:15 AM, Neal Becker wrote: > I'm trying to make a plot which has 2 scales (linearly related), but just 1 > set of data. I've seen many examples with 2 plots and 2 scales, but that's > not what I need here. > > I blindly followed some examples and was able to make a pretty good plot > with one scale on bottom and one on top. I'd like to see how it looks with > 2 scales on the bottom, with an offset between them, but I don't know how > to > do it. > > Attached is the current version. > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ben.v.root at gmail.com Thu Jan 14 09:54:57 2016 From: ben.v.root at gmail.com (Benjamin Root) Date: Thu, 14 Jan 2016 09:54:57 -0500 Subject: [Matplotlib-users] plot with 2 scales (not 2 plots) In-Reply-To: References: Message-ID: What did you do for the new_fixed_axis portion of the code? That is the key part. If the location isn't set correctly there, the direction will be incorrect. Ben Root On Thu, Jan 14, 2016 at 9:50 AM, Neal Becker wrote: > Thanks, but I want 2 scales on the bottom. The scale produced by twiny > seems to go on the top. While I can fix the position with > ax_c = ax_f.twiny() > fig.subplots_adjust(bottom=0.2) > ax_c.spines["top"].set_position(("axes", -0.2)) > > that will leave me with x-axis label and tick marks going the wrong way > for the bottom > > On Thu, Jan 14, 2016 at 9:43 AM, Benjamin Root > wrote: > >> Just do a parasite axis using axisartist. This example does have two >> plots, but you don't have to do the first one: >> http://matplotlib.org/examples/axes_grid/demo_parasite_axes2.html >> >> Cheers! >> Ben Root >> >> >> On Thu, Jan 14, 2016 at 8:15 AM, Neal Becker wrote: >> >>> I'm trying to make a plot which has 2 scales (linearly related), but >>> just 1 >>> set of data. I've seen many examples with 2 plots and 2 scales, but >>> that's >>> not what I need here. >>> >>> I blindly followed some examples and was able to make a pretty good plot >>> with one scale on bottom and one on top. I'd like to see how it looks >>> with >>> 2 scales on the bottom, with an offset between them, but I don't know >>> how to >>> do it. >>> >>> Attached is the current version. >>> _______________________________________________ >>> Matplotlib-users mailing list >>> Matplotlib-users at python.org >>> https://mail.python.org/mailman/listinfo/matplotlib-users >>> >>> >> > > > -- > *Those who don't understand recursion are doomed to repeat it* > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ndbecker2 at gmail.com Thu Jan 14 11:00:10 2016 From: ndbecker2 at gmail.com (Neal Becker) Date: Thu, 14 Jan 2016 11:00:10 -0500 Subject: [Matplotlib-users] plot with 2 scales (not 2 plots) References: Message-ID: This one is pretty good. The one issue I have is the 2 magic numbers which I found by trial and error (not acutally understanding what they mean). Is there a more systematic way to come up with these values? plt.subplots_adjust(bottom=0.2) offset = -50 -------------- next part -------------- A non-text attachment was scrubbed... Name: test_plot3.py Type: text/x-python Size: 2904 bytes Desc: not available URL: From flyamer at gmail.com Thu Jan 14 14:34:12 2016 From: flyamer at gmail.com (Phlya) Date: Thu, 14 Jan 2016 12:34:12 -0700 (MST) Subject: [Matplotlib-users] Automatic adjustment of text labels - adjustText Message-ID: <1452800052884-46643.post@n5.nabble.com> Hi all, I would like to share my mini-library to automatically adjust text labels on matplotlib plots to minimize overlaps between them and with data points - adjustText: https://github.com/Phlya/adjustText It's very easy to use and quite configurable for adjusting to particular use cases. Would love to hear your feedback! Best wishes, Ilya -- View this message in context: http://matplotlib.1069221.n5.nabble.com/Automatic-adjustment-of-text-labels-adjustText-tp46643.html Sent from the matplotlib - users mailing list archive at Nabble.com. From chaochinyang at icloud.com Wed Jan 6 09:09:20 2016 From: chaochinyang at icloud.com (Chao-Chin Yang) Date: Wed, 06 Jan 2016 15:09:20 +0100 Subject: [Matplotlib-users] em-dash not correctly displayed in saved pdf when using tex In-Reply-To: References: Message-ID: <568D2010.1070508@icloud.com> Here is my locale: LANG=en_US.UTF-8 LANGUAGE= LC_CTYPE="en_US.UTF-8" LC_NUMERIC=sv_SE.UTF-8 LC_TIME=en_US.UTF-8 LC_COLLATE="en_US.UTF-8" LC_MONETARY=sv_SE.UTF-8 LC_MESSAGES="en_US.UTF-8" LC_PAPER=sv_SE.UTF-8 LC_NAME=sv_SE.UTF-8 LC_ADDRESS=sv_SE.UTF-8 LC_TELEPHONE=sv_SE.UTF-8 LC_MEASUREMENT=sv_SE.UTF-8 LC_IDENTIFICATION=sv_SE.UTF-8 LC_ALL= I hope this helps. Sincerely, Chao-Chin On 01/06/2016 03:06 PM, Thomas Caswell wrote: > What is the default encoding on your system? I wonder if in > `draw_tex` or `dvi_read` we are transcoding the text? > > Tom > > On Wed, Jan 6, 2016 at 8:56 AM Michael Droettboom > > wrote: > > I can't reproduce with matplotlib master, suggesting this bug has > already been fixed. > > Mike > > On Mon, Dec 28, 2015 at 4:26 AM, Chao-Chin Yang > > wrote: > > Hi, I am having issues with producing an em-dash in pdf when > using tex. A sample script is as below: > > #!/usr/bin/env python3 > import matplotlib.pyplot as plt > import math > import numpy as np > > x = np.linspace(0, 2 * math.pi) > y = np.cos(x) > > plt.plot(x, y) > plt.suptitle(r"abc --- def") > plt.savefig("test.pdf") > plt.show() > > I have customized rc parameters: > > backend = ?TkAgg? > font.family = ?serif? > text.usetex = True > image.cmap = ?CMRmap" > > The plot rendered on screen looks fine. However, there are > some weird characters showing up right before the em-dash in > the saved pdf, as attached here. > > > > I am using Linux Mint 17.3, and uname -a gives > > Linux Eridanus 3.19.0-32-generic #37~14.04.1-Ubuntu SMP Thu > Oct 22 09:41:40 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux > > I am using python 3.4.3 + matplotlib 1.3.1, the latter of > which is kind of old, but still remains the latest in the > Ubuntu LTS repository. On the other had, I have installed the > texlive-full package, which should include all the tex related > packages. My dvipng is 1.14, and my ghostscript is 9.10. I > have also tried different backends like Agg or PDF, but it > makes no difference. > > I have tried googling around for similar issues, but had no luck. > > It would be very much appreciated If anyone had some idea how > this comes about. > > Sincerely, > Chao-Chin > > > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users > > > > > -- > Michael Droettboom > Continuum Analytics > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jeads442 at gmail.com Sun Jan 10 08:52:23 2016 From: jeads442 at gmail.com (eadsjr) Date: Sun, 10 Jan 2016 06:52:23 -0700 (MST) Subject: [Matplotlib-users] Problem with "set_array" function In-Reply-To: References: Message-ID: <1452433943219-46628.post@n5.nabble.com> Try adding a matplotlib.pyplot.pause(0) immediately after your 'self.im.set_array(welldata)'. The pause forces it to display the changed data. For anyone who finds this. -- View this message in context: http://matplotlib.1069221.n5.nabble.com/Problem-with-set-array-function-tp39686p46628.html Sent from the matplotlib - users mailing list archive at Nabble.com. From jeads442 at gmail.com Mon Jan 11 02:40:32 2016 From: jeads442 at gmail.com (eadsjr) Date: Mon, 11 Jan 2016 00:40:32 -0700 (MST) Subject: [Matplotlib-users] Problem with "set_array" function In-Reply-To: <1452433943219-46628.post@n5.nabble.com> References: <1452433943219-46628.post@n5.nabble.com> Message-ID: <1452498032466-46632.post@n5.nabble.com> On further research, I have found a variety of issues with using matplotlib.pyplot.pause(0), and can't recommend it for this purpose. matplotlib.pyplot.show() appears to perform the desired function and does not have as many side effects. To elaborate, I found that I was leaking memory, probably in 'paused sessions', for every additional plot displayed that way. This also increased the stack depth until it hit the python limit and crashed the program. matplotlib.pyplot.draw() has neither of these issues. -- View this message in context: http://matplotlib.1069221.n5.nabble.com/Problem-with-set-array-function-tp39686p46632.html Sent from the matplotlib - users mailing list archive at Nabble.com. From sazearte at live.fr Tue Jan 12 02:52:32 2016 From: sazearte at live.fr (nice) Date: Tue, 12 Jan 2016 00:52:32 -0700 (MST) Subject: [Matplotlib-users] matploltib use gpu ? Message-ID: <1452585152145-46633.post@n5.nabble.com> Hello, i have a question. I'm in Python 3.5, and can i use matploltib with GPU ?, can i use OpenGL or PyOpenCL implemnetation for matploltib ? Thanks for advance. -- View this message in context: http://matplotlib.1069221.n5.nabble.com/matploltib-use-gpu-tp46633.html Sent from the matplotlib - users mailing list archive at Nabble.com. From flyamer at gmail.com Tue Jan 12 21:30:56 2016 From: flyamer at gmail.com (Phlya) Date: Tue, 12 Jan 2016 19:30:56 -0700 (MST) Subject: [Matplotlib-users] Automatic adjustment of labels - adjustText Message-ID: <1452652256565-46634.post@n5.nabble.com> Hi all, I would like to share my mini-library to automatically adjust text labels on matplotlib plots to minimize overlaps between them and with data points - adjustText: https://github.com/Phlya/adjustText It was inspired by ggrepel - a similar package for R/ggplot2, and performs almost as well as that one. Would love to hear your feedback! (Not yet on pypi, but hopefully should be installable by pip directly from github) -- View this message in context: http://matplotlib.1069221.n5.nabble.com/Automatic-adjustment-of-labels-adjustText-tp46634.html Sent from the matplotlib - users mailing list archive at Nabble.com. From ndbecker2 at gmail.com Thu Jan 14 09:50:54 2016 From: ndbecker2 at gmail.com (Neal Becker) Date: Thu, 14 Jan 2016 09:50:54 -0500 Subject: [Matplotlib-users] plot with 2 scales (not 2 plots) In-Reply-To: References: Message-ID: Thanks, but I want 2 scales on the bottom. The scale produced by twiny seems to go on the top. While I can fix the position with ax_c = ax_f.twiny() fig.subplots_adjust(bottom=0.2) ax_c.spines["top"].set_position(("axes", -0.2)) that will leave me with x-axis label and tick marks going the wrong way for the bottom On Thu, Jan 14, 2016 at 9:43 AM, Benjamin Root wrote: > Just do a parasite axis using axisartist. This example does have two > plots, but you don't have to do the first one: > http://matplotlib.org/examples/axes_grid/demo_parasite_axes2.html > > Cheers! > Ben Root > > > On Thu, Jan 14, 2016 at 8:15 AM, Neal Becker wrote: > >> I'm trying to make a plot which has 2 scales (linearly related), but just >> 1 >> set of data. I've seen many examples with 2 plots and 2 scales, but >> that's >> not what I need here. >> >> I blindly followed some examples and was able to make a pretty good plot >> with one scale on bottom and one on top. I'd like to see how it looks >> with >> 2 scales on the bottom, with an offset between them, but I don't know how >> to >> do it. >> >> Attached is the current version. >> _______________________________________________ >> Matplotlib-users mailing list >> Matplotlib-users at python.org >> https://mail.python.org/mailman/listinfo/matplotlib-users >> >> > -- *Those who don't understand recursion are doomed to repeat it* -------------- next part -------------- An HTML attachment was scrubbed... URL: From ndbecker2 at gmail.com Thu Jan 14 10:15:43 2016 From: ndbecker2 at gmail.com (Neal Becker) Date: Thu, 14 Jan 2016 10:15:43 -0500 Subject: [Matplotlib-users] plot with 2 scales (not 2 plots) In-Reply-To: References: Message-ID: Thanks for the hints. This one is getting close to what I need, except I have a scale at the top and the bottom: from mpl_toolkits.axes_grid1 import host_subplot import mpl_toolkits.axisartist as AA import matplotlib.pyplot as plt def fahrenheit2celsius(temp): """ Returns temperature in Celsius. """ return temp * 2 / 9 def convert_ax_c_to_celsius(ax_f): """ Update second axis according with first axis. """ y1, y2 = ax_f.get_xlim() par2.set_xlim(fahrenheit2celsius(y1), fahrenheit2celsius(y2)) par2.figure.canvas.draw() if 1: host = host_subplot(111, axes_class=AA.Axes) plt.subplots_adjust(bottom=0.25) # par1 = host.twinx() par2 = host.twiny() host.callbacks.connect("xlim_changed", convert_ax_c_to_celsius) offset = -45 new_fixed_axis = par2.get_grid_helper().new_fixed_axis par2.axis["bottom"] = new_fixed_axis(loc="bottom", axes=par2, offset=(0, offset)) par2.axis["bottom"].toggle(all=True) host.set_xlim(0, 2) host.set_ylim(0, 2) host.set_xlabel("Distance") host.set_ylabel("Density") # par1.set_ylabel("Temperature") par2.set_xlabel("Velocity") p1, = host.plot([0, 1, 2], [0, 1, 2], label="Density") # p2, = par1.plot([0, 1, 2], [0, 3, 2], label="Temperature") #p3, = par2.plot([0, 1, 2], [50, 30, 15], label="Velocity") # par1.set_ylim(0, 4) #par2.set_ylim(1, 65) host.legend() # host.axis["left"].label.set_color(p1.get_color()) # par1.axis["right"].label.set_color(p2.get_color()) # par2.axis["right"].label.set_color(p3.get_color()) plt.draw() plt.show() On Thu, Jan 14, 2016 at 9:54 AM, Benjamin Root wrote: > What did you do for the new_fixed_axis portion of the code? That is the > key part. If the location isn't set correctly there, the direction will be > incorrect. > > Ben Root > > On Thu, Jan 14, 2016 at 9:50 AM, Neal Becker wrote: > >> Thanks, but I want 2 scales on the bottom. The scale produced by twiny >> seems to go on the top. While I can fix the position with >> ax_c = ax_f.twiny() >> fig.subplots_adjust(bottom=0.2) >> ax_c.spines["top"].set_position(("axes", -0.2)) >> >> that will leave me with x-axis label and tick marks going the wrong way >> for the bottom >> >> On Thu, Jan 14, 2016 at 9:43 AM, Benjamin Root >> wrote: >> >>> Just do a parasite axis using axisartist. This example does have two >>> plots, but you don't have to do the first one: >>> http://matplotlib.org/examples/axes_grid/demo_parasite_axes2.html >>> >>> Cheers! >>> Ben Root >>> >>> >>> On Thu, Jan 14, 2016 at 8:15 AM, Neal Becker >>> wrote: >>> >>>> I'm trying to make a plot which has 2 scales (linearly related), but >>>> just 1 >>>> set of data. I've seen many examples with 2 plots and 2 scales, but >>>> that's >>>> not what I need here. >>>> >>>> I blindly followed some examples and was able to make a pretty good plot >>>> with one scale on bottom and one on top. I'd like to see how it looks >>>> with >>>> 2 scales on the bottom, with an offset between them, but I don't know >>>> how to >>>> do it. >>>> >>>> Attached is the current version. >>>> _______________________________________________ >>>> Matplotlib-users mailing list >>>> Matplotlib-users at python.org >>>> https://mail.python.org/mailman/listinfo/matplotlib-users >>>> >>>> >>> >> >> >> -- >> *Those who don't understand recursion are doomed to repeat it* >> > > -- *Those who don't understand recursion are doomed to repeat it* -------------- next part -------------- An HTML attachment was scrubbed... URL: From ben.v.root at gmail.com Fri Jan 15 09:50:52 2016 From: ben.v.root at gmail.com (Benjamin Root) Date: Fri, 15 Jan 2016 09:50:52 -0500 Subject: [Matplotlib-users] matploltib use gpu ? In-Reply-To: <1452585152145-46633.post@n5.nabble.com> References: <1452585152145-46633.post@n5.nabble.com> Message-ID: Not at this time. However, there is another python project that does: vispy.org VisPy does a fantastic job of offloading to GPU and it is quite straight-forward to use. There have been discussions between the devs of the two projects to figure out how we can plug one project into the other (most likely have vispy be an optional backend of sorts), but that is still awhile down the road. Check it out! Cheers! Ben Root On Tue, Jan 12, 2016 at 2:52 AM, nice wrote: > Hello, i have a question. > > I'm in Python 3.5, and can i use matploltib with GPU ?, can i use OpenGL or > PyOpenCL implemnetation for matploltib ? > > Thanks for advance. > > > > -- > View this message in context: > http://matplotlib.1069221.n5.nabble.com/matploltib-use-gpu-tp46633.html > Sent from the matplotlib - users mailing list archive at Nabble.com. > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From flyamer at gmail.com Fri Jan 15 09:57:34 2016 From: flyamer at gmail.com (Ilya Flyamer) Date: Fri, 15 Jan 2016 14:57:34 +0000 Subject: [Matplotlib-users] matploltib use gpu ? In-Reply-To: References: <1452585152145-46633.post@n5.nabble.com> Message-ID: I have not tried it, but another library for that is glumpy: https://glumpy.github.io/ 2016-01-15 14:50 GMT+00:00 Benjamin Root : > Not at this time. However, there is another python project that does: > vispy.org > > VisPy does a fantastic job of offloading to GPU and it is quite > straight-forward to use. There have been discussions between the devs of > the two projects to figure out how we can plug one project into the other > (most likely have vispy be an optional backend of sorts), but that is still > awhile down the road. Check it out! > > Cheers! > Ben Root > > > On Tue, Jan 12, 2016 at 2:52 AM, nice wrote: > >> Hello, i have a question. >> >> I'm in Python 3.5, and can i use matploltib with GPU ?, can i use OpenGL >> or >> PyOpenCL implemnetation for matploltib ? >> >> Thanks for advance. >> >> >> >> -- >> View this message in context: >> http://matplotlib.1069221.n5.nabble.com/matploltib-use-gpu-tp46633.html >> Sent from the matplotlib - users mailing list archive at Nabble.com. >> _______________________________________________ >> Matplotlib-users mailing list >> Matplotlib-users at python.org >> https://mail.python.org/mailman/listinfo/matplotlib-users >> > > > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ben.v.root at gmail.com Fri Jan 15 10:03:28 2016 From: ben.v.root at gmail.com (Benjamin Root) Date: Fri, 15 Jan 2016 10:03:28 -0500 Subject: [Matplotlib-users] matploltib use gpu ? In-Reply-To: References: <1452585152145-46633.post@n5.nabble.com> Message-ID: Yes, glumpy is a sister project of VisPy that has largely been assimilated into VisPy, if I understand it all correctly. On Fri, Jan 15, 2016 at 9:57 AM, Ilya Flyamer wrote: > I have not tried it, but another library for that is glumpy: > https://glumpy.github.io/ > > 2016-01-15 14:50 GMT+00:00 Benjamin Root : > >> Not at this time. However, there is another python project that does: >> vispy.org >> >> VisPy does a fantastic job of offloading to GPU and it is quite >> straight-forward to use. There have been discussions between the devs of >> the two projects to figure out how we can plug one project into the other >> (most likely have vispy be an optional backend of sorts), but that is still >> awhile down the road. Check it out! >> >> Cheers! >> Ben Root >> >> >> On Tue, Jan 12, 2016 at 2:52 AM, nice wrote: >> >>> Hello, i have a question. >>> >>> I'm in Python 3.5, and can i use matploltib with GPU ?, can i use OpenGL >>> or >>> PyOpenCL implemnetation for matploltib ? >>> >>> Thanks for advance. >>> >>> >>> >>> -- >>> View this message in context: >>> http://matplotlib.1069221.n5.nabble.com/matploltib-use-gpu-tp46633.html >>> Sent from the matplotlib - users mailing list archive at Nabble.com. >>> _______________________________________________ >>> Matplotlib-users mailing list >>> Matplotlib-users at python.org >>> https://mail.python.org/mailman/listinfo/matplotlib-users >>> >> >> >> _______________________________________________ >> Matplotlib-users mailing list >> Matplotlib-users at python.org >> https://mail.python.org/mailman/listinfo/matplotlib-users >> >> > > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From flyamer at gmail.com Fri Jan 15 10:05:34 2016 From: flyamer at gmail.com (Ilya Flyamer) Date: Fri, 15 Jan 2016 15:05:34 +0000 Subject: [Matplotlib-users] matploltib use gpu ? In-Reply-To: References: <1452585152145-46633.post@n5.nabble.com> Message-ID: The first two points in its FAQ address this question: http://glumpy.readthedocs.org/en/latest/faq.html 2016-01-15 15:03 GMT+00:00 Benjamin Root : > Yes, glumpy is a sister project of VisPy that has largely been assimilated > into VisPy, if I understand it all correctly. > > On Fri, Jan 15, 2016 at 9:57 AM, Ilya Flyamer wrote: > >> I have not tried it, but another library for that is glumpy: >> https://glumpy.github.io/ >> >> 2016-01-15 14:50 GMT+00:00 Benjamin Root : >> >>> Not at this time. However, there is another python project that does: >>> vispy.org >>> >>> VisPy does a fantastic job of offloading to GPU and it is quite >>> straight-forward to use. There have been discussions between the devs of >>> the two projects to figure out how we can plug one project into the other >>> (most likely have vispy be an optional backend of sorts), but that is still >>> awhile down the road. Check it out! >>> >>> Cheers! >>> Ben Root >>> >>> >>> On Tue, Jan 12, 2016 at 2:52 AM, nice wrote: >>> >>>> Hello, i have a question. >>>> >>>> I'm in Python 3.5, and can i use matploltib with GPU ?, can i use >>>> OpenGL or >>>> PyOpenCL implemnetation for matploltib ? >>>> >>>> Thanks for advance. >>>> >>>> >>>> >>>> -- >>>> View this message in context: >>>> http://matplotlib.1069221.n5.nabble.com/matploltib-use-gpu-tp46633.html >>>> Sent from the matplotlib - users mailing list archive at Nabble.com. >>>> _______________________________________________ >>>> Matplotlib-users mailing list >>>> Matplotlib-users at python.org >>>> https://mail.python.org/mailman/listinfo/matplotlib-users >>>> >>> >>> >>> _______________________________________________ >>> Matplotlib-users mailing list >>> Matplotlib-users at python.org >>> https://mail.python.org/mailman/listinfo/matplotlib-users >>> >>> >> >> _______________________________________________ >> Matplotlib-users mailing list >> Matplotlib-users at python.org >> https://mail.python.org/mailman/listinfo/matplotlib-users >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ben.v.root at gmail.com Fri Jan 15 10:11:10 2016 From: ben.v.root at gmail.com (Benjamin Root) Date: Fri, 15 Jan 2016 10:11:10 -0500 Subject: [Matplotlib-users] matploltib use gpu ? In-Reply-To: References: <1452585152145-46633.post@n5.nabble.com> Message-ID: Ah, good to know about that update. Thank you! On Fri, Jan 15, 2016 at 10:05 AM, Ilya Flyamer wrote: > The first two points in its FAQ address this question: > http://glumpy.readthedocs.org/en/latest/faq.html > > 2016-01-15 15:03 GMT+00:00 Benjamin Root : > >> Yes, glumpy is a sister project of VisPy that has largely been >> assimilated into VisPy, if I understand it all correctly. >> >> On Fri, Jan 15, 2016 at 9:57 AM, Ilya Flyamer wrote: >> >>> I have not tried it, but another library for that is glumpy: >>> https://glumpy.github.io/ >>> >>> 2016-01-15 14:50 GMT+00:00 Benjamin Root : >>> >>>> Not at this time. However, there is another python project that does: >>>> vispy.org >>>> >>>> VisPy does a fantastic job of offloading to GPU and it is quite >>>> straight-forward to use. There have been discussions between the devs of >>>> the two projects to figure out how we can plug one project into the other >>>> (most likely have vispy be an optional backend of sorts), but that is still >>>> awhile down the road. Check it out! >>>> >>>> Cheers! >>>> Ben Root >>>> >>>> >>>> On Tue, Jan 12, 2016 at 2:52 AM, nice wrote: >>>> >>>>> Hello, i have a question. >>>>> >>>>> I'm in Python 3.5, and can i use matploltib with GPU ?, can i use >>>>> OpenGL or >>>>> PyOpenCL implemnetation for matploltib ? >>>>> >>>>> Thanks for advance. >>>>> >>>>> >>>>> >>>>> -- >>>>> View this message in context: >>>>> http://matplotlib.1069221.n5.nabble.com/matploltib-use-gpu-tp46633.html >>>>> Sent from the matplotlib - users mailing list archive at Nabble.com. >>>>> _______________________________________________ >>>>> Matplotlib-users mailing list >>>>> Matplotlib-users at python.org >>>>> https://mail.python.org/mailman/listinfo/matplotlib-users >>>>> >>>> >>>> >>>> _______________________________________________ >>>> Matplotlib-users mailing list >>>> Matplotlib-users at python.org >>>> https://mail.python.org/mailman/listinfo/matplotlib-users >>>> >>>> >>> >>> _______________________________________________ >>> Matplotlib-users mailing list >>> Matplotlib-users at python.org >>> https://mail.python.org/mailman/listinfo/matplotlib-users >>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ben.v.root at gmail.com Fri Jan 15 10:32:34 2016 From: ben.v.root at gmail.com (Benjamin Root) Date: Fri, 15 Jan 2016 10:32:34 -0500 Subject: [Matplotlib-users] Problem with "set_array" function In-Reply-To: <1452498032466-46632.post@n5.nabble.com> References: <1452433943219-46628.post@n5.nabble.com> <1452498032466-46632.post@n5.nabble.com> Message-ID: As far as I can tell, the code you originally posted should work. I will note that calling "self.fig.colorbar()" at every tick of the timer is probably not a good idea. Instead, I would have the initial imshow() set with hard-coded mins and maxes so that you don't need to update the colorbar. When doing embedding like this, you absolutely should avoid utilizing pyplot, because you may accidentally clash mpl's event loop with the gui's event loop. Which versions of matplotlib and wxWidgets are you using? Ben Root On Mon, Jan 11, 2016 at 2:40 AM, eadsjr wrote: > On further research, I have found a variety of issues with using > matplotlib.pyplot.pause(0), and can't recommend it for this purpose. > matplotlib.pyplot.show() appears to perform the desired function and does > not have as many side effects. > > To elaborate, I found that I was leaking memory, probably in 'paused > sessions', for every additional plot displayed that way. This also > increased > the stack depth until it hit the python limit and crashed the program. > matplotlib.pyplot.draw() has neither of these issues. > > > > -- > View this message in context: > http://matplotlib.1069221.n5.nabble.com/Problem-with-set-array-function-tp39686p46632.html > Sent from the matplotlib - users mailing list archive at Nabble.com. > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tcaswell at gmail.com Fri Jan 15 10:59:07 2016 From: tcaswell at gmail.com (Thomas Caswell) Date: Fri, 15 Jan 2016 15:59:07 +0000 Subject: [Matplotlib-users] Automatic adjustment of labels - adjustText In-Reply-To: <1452652256565-46634.post@n5.nabble.com> References: <1452652256565-46634.post@n5.nabble.com> Message-ID: Cool! That is a feature that I have seen be asked for many times. Would you be interested in moving that into upstream or under the mpl organization? Tom On Fri, Jan 15, 2016 at 8:14 AM Phlya wrote: > Hi all, > > I would like to share my mini-library to automatically adjust text labels > on > matplotlib plots to minimize overlaps between them and with data points - > adjustText: https://github.com/Phlya/adjustText > It was inspired by ggrepel - a similar package for R/ggplot2, and performs > almost as well as that one. Would love to hear your feedback! > (Not yet on pypi, but hopefully should be installable by pip directly from > github) > > > > -- > View this message in context: > http://matplotlib.1069221.n5.nabble.com/Automatic-adjustment-of-labels-adjustText-tp46634.html > Sent from the matplotlib - users mailing list archive at Nabble.com. > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From flyamer at gmail.com Fri Jan 15 11:04:34 2016 From: flyamer at gmail.com (Ilya Flyamer) Date: Fri, 15 Jan 2016 16:04:34 +0000 Subject: [Matplotlib-users] Automatic adjustment of labels - adjustText In-Reply-To: References: <1452652256565-46634.post@n5.nabble.com> Message-ID: I'd be happy if this became more "official" in any way you think would be best! However probably a lot of work still needs to be done for the code to be of high enough quality. I am not experienced with this kind of things (developing proper packages), unfortunately. 2016-01-15 15:59 GMT+00:00 Thomas Caswell : > Cool! That is a feature that I have seen be asked for many times. > > Would you be interested in moving that into upstream or under the mpl > organization? > > Tom > > On Fri, Jan 15, 2016 at 8:14 AM Phlya wrote: > >> Hi all, >> >> I would like to share my mini-library to automatically adjust text labels >> on >> matplotlib plots to minimize overlaps between them and with data points - >> adjustText: https://github.com/Phlya/adjustText >> It was inspired by ggrepel - a similar package for R/ggplot2, and performs >> almost as well as that one. Would love to hear your feedback! >> (Not yet on pypi, but hopefully should be installable by pip directly from >> github) >> >> >> >> -- >> View this message in context: >> http://matplotlib.1069221.n5.nabble.com/Automatic-adjustment-of-labels-adjustText-tp46634.html >> Sent from the matplotlib - users mailing list archive at Nabble.com. >> _______________________________________________ >> Matplotlib-users mailing list >> Matplotlib-users at python.org >> https://mail.python.org/mailman/listinfo/matplotlib-users >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sazearte at live.fr Sat Jan 16 04:39:44 2016 From: sazearte at live.fr (nice) Date: Sat, 16 Jan 2016 02:39:44 -0700 (MST) Subject: [Matplotlib-users] matploltib use gpu ? In-Reply-To: <1452585152145-46633.post@n5.nabble.com> References: <1452585152145-46633.post@n5.nabble.com> Message-ID: <1452937184799-46663.post@n5.nabble.com> ok, i can't use gpu. But in this case it matplotlib can run multiple processor core? I have quiad core processor and matploltib use 25% max processor. Can i use more ? -- View this message in context: http://matplotlib.1069221.n5.nabble.com/matploltib-use-gpu-tp46633p46663.html Sent from the matplotlib - users mailing list archive at Nabble.com. From mdroettboom at continuum.io Mon Jan 25 09:06:41 2016 From: mdroettboom at continuum.io (Michael Droettboom) Date: Mon, 25 Jan 2016 09:06:41 -0500 Subject: [Matplotlib-users] matploltib use gpu ? In-Reply-To: <1452937184799-46663.post@n5.nabble.com> References: <1452585152145-46633.post@n5.nabble.com> <1452937184799-46663.post@n5.nabble.com> Message-ID: matplotlib is not intrinsically multi-threaded, so it only uses one core (and main obstacle there is the GIL, though parts of the Agg rendering could probably be multithreaded if someone wanted to invest the effort). However, if you are generating many plots in a row, the problem is "embarrassingly parallel", and it's quite straightforward to use the python multiprocessing library for this. Mike On Sat, Jan 16, 2016 at 4:39 AM, nice wrote: > ok, i can't use gpu. > > But in this case it matplotlib can run multiple processor core? > > I have quiad core processor and matploltib use 25% max processor. Can i use > more ? > > > > -- > View this message in context: > http://matplotlib.1069221.n5.nabble.com/matploltib-use-gpu-tp46633p46663.html > Sent from the matplotlib - users mailing list archive at Nabble.com. > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users > -- Michael Droettboom Continuum Analytics -------------- next part -------------- An HTML attachment was scrubbed... URL: From ben.v.root at gmail.com Mon Jan 25 09:44:27 2016 From: ben.v.root at gmail.com (Benjamin Root) Date: Mon, 25 Jan 2016 09:44:27 -0500 Subject: [Matplotlib-users] matploltib use gpu ? In-Reply-To: References: <1452585152145-46633.post@n5.nabble.com> <1452937184799-46663.post@n5.nabble.com> Message-ID: I should also point out that I rarely find times when matplotlib itself is a bottleneck. Often, it is some other portion of the processing pipeline that is the problem. I would utilize runsnakerun and do some profiling to find out exactly where the pain points are in your code. I will note that, in my experience, when it is the plotting that is slowing things down, Basemap is typically the problem. On Mon, Jan 25, 2016 at 9:06 AM, Michael Droettboom < mdroettboom at continuum.io> wrote: > matplotlib is not intrinsically multi-threaded, so it only uses one core > (and main obstacle there is the GIL, though parts of the Agg rendering > could probably be multithreaded if someone wanted to invest the effort). > > However, if you are generating many plots in a row, the problem is > "embarrassingly parallel", and it's quite straightforward to use the python > multiprocessing library for this. > > Mike > > On Sat, Jan 16, 2016 at 4:39 AM, nice wrote: > >> ok, i can't use gpu. >> >> But in this case it matplotlib can run multiple processor core? >> >> I have quiad core processor and matploltib use 25% max processor. Can i >> use >> more ? >> >> >> >> -- >> View this message in context: >> http://matplotlib.1069221.n5.nabble.com/matploltib-use-gpu-tp46633p46663.html >> Sent from the matplotlib - users mailing list archive at Nabble.com. >> _______________________________________________ >> Matplotlib-users mailing list >> Matplotlib-users at python.org >> https://mail.python.org/mailman/listinfo/matplotlib-users >> > > > > -- > Michael Droettboom > Continuum Analytics > > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lorenzo.deleo at gmail.com Tue Jan 26 06:24:29 2016 From: lorenzo.deleo at gmail.com (Lorenzo De Leo) Date: Tue, 26 Jan 2016 11:24:29 +0000 Subject: [Matplotlib-users] Editing legend labels Message-ID: Hello, I have a problem with the way the legend labels are handled, certainly due to my poor knowledge of matplotlib internals. Here an example (matplotlib-1.4.3, py-2.7): In [1]: import matplotlib.pyplot as plt In [2]: plt.plot([1,2,3], label='A') Out[2]: [] In [3]: plt.plot([2,3,4], label='B') Out[3]: [] In [4]: ax = plt.gca() In [5]: l = ax.get_legend_handles_labels() In [6]: l Out[6]: ([, ], [u'A', u'B']) In [7]: plt.legend(['C', 'D']) ### This correctly modifies the legend to show 'C' and 'D', but then ... Out[7]: In [10]: l = ax.get_legend_handles_labels() In [11]: l Out[11]: ([, ], [u'A', u'B']) At this point I have no idea how to retrieve the list of shown labels, i.e. ['C', 'D']. What am I missing? What other method should I use? Thanks in advance -------------- next part -------------- An HTML attachment was scrubbed... URL: From sazearte at live.fr Mon Jan 25 12:35:47 2016 From: sazearte at live.fr (nice) Date: Mon, 25 Jan 2016 10:35:47 -0700 (MST) Subject: [Matplotlib-users] matploltib use gpu ? In-Reply-To: <1452585152145-46633.post@n5.nabble.com> References: <1452585152145-46633.post@n5.nabble.com> Message-ID: <1453743347686-46677.post@n5.nabble.com> My problem: I have about 10 million point to plot. with this example, moving in the graph is very slow. Is there a way to have an intelligent zoom which removes invisible items on the eye? import matplotlib matplotlib.use('TkAgg') import numpy from numpy import arange, sin, pi from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2TkAgg from matplotlib.figure import Figure import tkinter as Tk root = Tk.Tk() root.wm_title("Embedding in TK") f = Figure(figsize=(5, 4), dpi=100) a = f.add_subplot(111) t = arange(0.0, 10000000, 1) s = arange(0.0, 10000000, 1) a.plot(t, s) canvas = FigureCanvasTkAgg(f, master=root) canvas.show() canvas.get_tk_widget().pack(side=Tk.TOP, fill=Tk.BOTH, expand=1) toolbar = NavigationToolbar2TkAgg(canvas, root) toolbar.update() canvas._tkcanvas.pack(side=Tk.TOP, fill=Tk.BOTH, expand=1) def _quit(): root.quit() root.destroy() button = Tk.Button(master=root, text='Exit', command=_quit) button.pack(side=Tk.BOTTOM) Tk.mainloop() -- View this message in context: http://matplotlib.1069221.n5.nabble.com/matploltib-use-gpu-tp46633p46677.html Sent from the matplotlib - users mailing list archive at Nabble.com. From mdroettboom at continuum.io Tue Jan 26 16:00:23 2016 From: mdroettboom at continuum.io (Michael Droettboom) Date: Tue, 26 Jan 2016 16:00:23 -0500 Subject: [Matplotlib-users] matploltib use gpu ? In-Reply-To: <1453743347686-46677.post@n5.nabble.com> References: <1452585152145-46633.post@n5.nabble.com> <1453743347686-46677.post@n5.nabble.com> Message-ID: > with this example, moving in the graph is very slow. Is there a way to have an intelligent zoom which removes invisible items on the eye? We already do this kind of optimization for line plots as in your example, so I'm surprised it's slow for you. We don't do anything like that for scatter plots though. Mike On Mon, Jan 25, 2016 at 12:35 PM, nice wrote: > My problem: I have about 10 million point to plot. > > with this example, moving in the graph is very slow. > Is there a way to have an intelligent zoom which removes invisible items on > the eye? > > > > import matplotlib > matplotlib.use('TkAgg') > import numpy > from numpy import arange, sin, pi > from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, > NavigationToolbar2TkAgg > from matplotlib.figure import Figure > import tkinter as Tk > > root = Tk.Tk() > root.wm_title("Embedding in TK") > > > f = Figure(figsize=(5, 4), dpi=100) > a = f.add_subplot(111) > > > t = arange(0.0, 10000000, 1) > s = arange(0.0, 10000000, 1) > a.plot(t, s) > > > canvas = FigureCanvasTkAgg(f, master=root) > canvas.show() > canvas.get_tk_widget().pack(side=Tk.TOP, fill=Tk.BOTH, expand=1) > > toolbar = NavigationToolbar2TkAgg(canvas, root) > toolbar.update() > canvas._tkcanvas.pack(side=Tk.TOP, fill=Tk.BOTH, expand=1) > > > def _quit(): > root.quit() > root.destroy() > > button = Tk.Button(master=root, text='Exit', command=_quit) > button.pack(side=Tk.BOTTOM) > > Tk.mainloop() > > > > > -- > View this message in context: > http://matplotlib.1069221.n5.nabble.com/matploltib-use-gpu-tp46633p46677.html > Sent from the matplotlib - users mailing list archive at Nabble.com. > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users > -- Michael Droettboom Continuum Analytics -------------- next part -------------- An HTML attachment was scrubbed... URL: From jon.roadleybattin at gmail.com Fri Jan 29 09:57:06 2016 From: jon.roadleybattin at gmail.com (Jon Roadley-Battin) Date: Fri, 29 Jan 2016 14:57:06 +0000 Subject: [Matplotlib-users] matploltib use gpu ? Message-ID: > > On Mon, Jan 25, 2016 at 12:35 PM, nice wrote: > > > My problem: I have about 10 million point to plot. > > > > with this example, moving in the graph is very slow. > > Is there a way to have an intelligent zoom which removes invisible items > on > > the eye? > > > > > > > > import matplotlib > > matplotlib.use('TkAgg') > > import numpy > > from numpy import arange, sin, pi > > from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, > > NavigationToolbar2TkAgg > > from matplotlib.figure import Figure > > import tkinter as Tk > > > > root = Tk.Tk() > > root.wm_title("Embedding in TK") > > > > > > f = Figure(figsize=(5, 4), dpi=100) > > a = f.add_subplot(111) > > > > > > t = arange(0.0, 10000000, 1) > > s = arange(0.0, 10000000, 1) > > a.plot(t, s) > > > > > > canvas = FigureCanvasTkAgg(f, master=root) > > canvas.show() > > canvas.get_tk_widget().pack(side=Tk.TOP, fill=Tk.BOTH, expand=1) > > > > toolbar = NavigationToolbar2TkAgg(canvas, root) > > toolbar.update() > > canvas._tkcanvas.pack(side=Tk.TOP, fill=Tk.BOTH, expand=1) > > > > > > def _quit(): > > root.quit() > > root.destroy() > > > > button = Tk.Button(master=root, text='Exit', command=_quit) > > button.pack(side=Tk.BOTTOM) > > > > Tk.mainloop() > Afternoon, Have you considered enabling Rasterization? a.plot(t, s, rasterized=True) -------------- next part -------------- An HTML attachment was scrubbed... URL: From stm6386 at gmail.com Tue Jan 26 19:07:36 2016 From: stm6386 at gmail.com (Stevo) Date: Tue, 26 Jan 2016 17:07:36 -0700 (MST) Subject: [Matplotlib-users] Totaly new to matplotlib Message-ID: <1453853256420-46682.post@n5.nabble.com> Hi guys, Im new to Python and matplotlib, I have a need to try and make a chart of some kind so was just searching around and looking at Plotly but it looks so complicated then I found the matplotlib site and was quite amazed how simple the code was to create some really incredible looking plots. Unfortunately none of the examples are quite what Im needing but Im guessing that is possible to create what i need as by the look of the gallery it would be a breeze for you experienced guys. The data I want to plot is durations during days (its a sort of working time/clock machine plot).... I imagine it to be a cross between the histogram_path_demo and one of those candle stick type ones, x being the day's time range centre of range being say lunchtime and each bar showing the shift start and end (centred on 12 lunchtime) but allowing for the bar to be broken when ever clocked in or out within that day.. if that makes sense ? Im very unsure even where to start so any pointers and advise would be greatly appreciated. Cheers Stevo -- View this message in context: http://matplotlib.1069221.n5.nabble.com/Totaly-new-to-matplotlib-tp46682.html Sent from the matplotlib - users mailing list archive at Nabble.com. From stm6386 at gmail.com Wed Jan 27 18:44:39 2016 From: stm6386 at gmail.com (Stevo) Date: Wed, 27 Jan 2016 16:44:39 -0700 (MST) Subject: [Matplotlib-users] Totaly new to matplotlib In-Reply-To: <1453853256420-46682.post@n5.nabble.com> References: <1453853256420-46682.post@n5.nabble.com> Message-ID: <1453938279802-46683.post@n5.nabble.com> If it helps the data I have is in the form of a list, each item in the list has [date&time, duration/timedelta] excerpt below. ['14/05/2015 10:06', datetime.timedelta(0, 4440), '14/05/2015 11:25', datetime.timedelta(0, 3480), '14/05/2015 12:27', datetime.timedelta(0, 6000), '14/05/2015 14:18', datetime.timedelta(0, 7200), '14/05/2015 16:22', datetime.timedelta(0, 4800), '15/05/2015 06:51', datetime.timedelta(0, 6960), '15/05/2015 08:51', datetime.timedelta(0, 1980), '15/05/2015 09:28', datetime.timedelta(0, 3000), '15/05/2015 11:43', datetime.timedelta(0, 3480), '15/05/2015 14:24', datetime.timedelta(0, 2760), '15/05/2015 15:12', datetime.timedelta(0, 3120)] Its just a matter of how best to display it visually. Cheers Steve -- View this message in context: http://matplotlib.1069221.n5.nabble.com/Totaly-new-to-matplotlib-tp46682p46683.html Sent from the matplotlib - users mailing list archive at Nabble.com. From pmhobson at gmail.com Fri Jan 29 11:40:42 2016 From: pmhobson at gmail.com (Paul Hobson) Date: Fri, 29 Jan 2016 08:40:42 -0800 Subject: [Matplotlib-users] Totaly new to matplotlib In-Reply-To: <1453938279802-46683.post@n5.nabble.com> References: <1453853256420-46682.post@n5.nabble.com> <1453938279802-46683.post@n5.nabble.com> Message-ID: Hey Stevo, You're gonna have to help us out a little more. Provide some links to what you're trying to achieve (whether in the MPL gallery or not), and include a minimal working example of the code that you've tried, -paul On Wed, Jan 27, 2016 at 3:44 PM, Stevo wrote: > If it helps the data I have is in the form of a list, each item in the list > has [date&time, duration/timedelta] excerpt below. > > ['14/05/2015 10:06', datetime.timedelta(0, 4440), '14/05/2015 11:25', > datetime.timedelta(0, 3480), '14/05/2015 12:27', datetime.timedelta(0, > 6000), '14/05/2015 14:18', datetime.timedelta(0, 7200), '14/05/2015 > 16:22', datetime.timedelta(0, 4800), '15/05/2015 06:51', > datetime.timedelta(0, 6960), '15/05/2015 08:51', datetime.timedelta(0, > 1980), '15/05/2015 09:28', datetime.timedelta(0, 3000), '15/05/2015 > 11:43', datetime.timedelta(0, 3480), '15/05/2015 14:24', > datetime.timedelta(0, 2760), '15/05/2015 15:12', datetime.timedelta(0, > 3120)] > > Its just a matter of how best to display it visually. > > Cheers > Steve > > > > -- > View this message in context: > http://matplotlib.1069221.n5.nabble.com/Totaly-new-to-matplotlib-tp46682p46683.html > Sent from the matplotlib - users mailing list archive at Nabble.com. > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sazearte at live.fr Fri Jan 29 13:04:10 2016 From: sazearte at live.fr (nice) Date: Fri, 29 Jan 2016 18:04:10 -0000 Subject: [Matplotlib-users] matploltib use gpu ? In-Reply-To: <1452585152145-46633.post@n5.nabble.com> References: <1452585152145-46633.post@n5.nabble.com> Message-ID: <1454090648779-46698.post@n5.nabble.com> Yes, python turn has a 30% cpu instead of 25% It there's an improvement in performance! Why is there a 30% block? what art the rasterized -- View this message in context: http://matplotlib.1069221.n5.nabble.com/matploltib-use-gpu-tp46633p46698.html Sent from the matplotlib - users mailing list archive at Nabble.com. From stm6386 at gmail.com Fri Jan 29 16:41:04 2016 From: stm6386 at gmail.com (Stevo) Date: Fri, 29 Jan 2016 21:41:04 -0000 Subject: [Matplotlib-users] Totaly new to matplotlib In-Reply-To: References: <1453853256420-46682.post@n5.nabble.com> <1453938279802-46683.post@n5.nabble.com> Message-ID: <1454103662682-46699.post@n5.nabble.com> Paul, Thanks for the reply, since my last post I've been working on this lots and have a working script. Pictures below, took me a while to get it working but it does. the main issue I have with it is that as you can see from the pictures when the time periods for a day are stacked for some reason the are all on a slant (presumably time related) Is there a way to straighten it all up ? as in the code below it now receives ['3/6/2013' '11:30:00' '14:30:00' '3:00:00'] for each event, the basics are there but its not very pretty yet. Im still trying to figure out how I got it working quite an achievement for me if i#m honest. def createGraph(self): #data appears like so: #date,init time,end time,elapsed time #3/6/2013,4:30:00,8:45:00,4:15:00 try: data = np.array(self.graphList1) #print data[1] #['3/6/2013' '11:30:00' '14:30:00' '3:00:00'] day = data[:,0] hour1 = data[:,1] hour2 = data[:,2] hour3 = data[:,3] inittime = [a+' '+b for a,b in zip(day, hour1)] elapsedtime = [a+' '+b for a,b in zip(day, hour3)] #print inittime # 3/6/2013 4:30:00 except Exception, e: print e #from [1], " I gave up after trying a few different ways, and resorted to a very easy workaround. # Plot the times as integer minutes : 0 being midnight, 60 = 1am ... which is 24hr * 60. " def dt2m(dt): return (dt.hour*60) + dt.minute print inittime[0] inittime = [datetime.datetime.strptime(foo,'%d/%m/%Y %H:%M') for foo in inittime] elapsedtime = [datetime.datetime.strptime(foo,'%d/%m/%Y %H:%M:%S') for foo in elapsedtime] #os.remove('chart.csv') # [1] "Then format the Y axis as Hour:Minute using a custom formatter:" def m2hm(x, i): h = int(x/60) m = int(x%60) return '%(h)02d:%(m)02d' % {'h':h,'m':m} inittime_mins = [dt2m(foo) for foo in inittime] elaptime_mins = [dt2m(foo) for foo in elapsedtime] #heights = [60,120,240] #print inittime_mins fig = plt.figure(figsize=(12,7)) #figsize in inches ax = fig.add_subplot(1, 1, 1) ax.bar(inittime,elaptime_mins,bottom=inittime_mins) plt.xticks(rotation='45') # matplotlib date format object hfmt = dates.DateFormatter('%b %d') ax.xaxis.set_major_formatter(hfmt) ax.xaxis.set_major_locator(plt.MultipleLocator(1.0)) #a tick mark a day ax.set_ylim([20*60, 5*60]) ax.yaxis.set_major_formatter(ff(m2hm)) ax.yaxis.set_major_locator(plt.MultipleLocator(60)) #a tick mark an hour plt.subplots_adjust (left = 0.06, bottom = 0.10, right = 0.97, top = 0.97, wspace = 0.20, hspace = 0.20) plt.show() -- View this message in context: http://matplotlib.1069221.n5.nabble.com/Totaly-new-to-matplotlib-tp46682p46699.html Sent from the matplotlib - users mailing list archive at Nabble.com.