From ekesawi at yahoo.com Sat May 2 19:08:02 2020 From: ekesawi at yahoo.com (EK Esawi) Date: Sat, 2 May 2020 23:08:02 +0000 (UTC) Subject: [Matplotlib-users] Add disconnected lines to a plot References: <1013216497.331568.1588460882822.ref@mail.yahoo.com> Message-ID: <1013216497.331568.1588460882822@mail.yahoo.com> Hi All? I am new to Matplotlib. I created a plot and I want to add a set of straight lines from a set of (x,y) coordinates (2D list). I want to have lines drown from 1st to 2nd then from 3rd to 4th and then from 5th to 6th, etc. I don?t want lines between 2nd and 3rd, 4th and 5th, etc. I think it can be done using Path and Patch, but could not get it done. I even tried to rearrange my data in a way to draw one line piece with zigzag shape but that too did not work well. Any help is greatly appreciated. EK From jerzy.karczmarczuk at unicaen.fr Sat May 2 19:34:03 2020 From: jerzy.karczmarczuk at unicaen.fr (Jerzy Karczmarczuk) Date: Sun, 3 May 2020 01:34:03 +0200 Subject: [Matplotlib-users] Add disconnected lines to a plot In-Reply-To: <1013216497.331568.1588460882822@mail.yahoo.com> References: <1013216497.331568.1588460882822.ref@mail.yahoo.com> <1013216497.331568.1588460882822@mail.yahoo.com> Message-ID: <99717efd-2b82-a4f5-39b6-a13abd36247f@unicaen.fr> Le 03/05/2020 ? 01:08, EK Esawi via Matplotlib-users a ?crit?: > I am new to Matplotlib. I created a plot and I want to add a set of straight lines from a set of (x,y) coordinates (2D list). I want to have lines drown from 1st to 2nd then from 3rd to 4th and then from 5th to 6th, etc. I don?t want lines between 2nd and 3rd, 4th and 5th, etc. I think it can be done using Path and Patch, but could not get it done. I even tried to rearrange my data in a way to draw one line piece with zigzag shape but that too did not work well. It suffices to remember that a NAN breaks a plot line. Insert NANs between the segments If you try this: *import numpy as np import matplotlib.pyplot as plt x=np.array(range(20)) x=x.reshape((10,2))? # two columns h=np.array([10*[np.nan]]).T xx=np.hstack((x,h)).reshape((30,)) # NANs form the third column; Flatten the result plt.plot(xx,xx,'r',lw=2)* you should get: Jerzy Karczmarczuk /Caen, France/ -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: pkfifgkcalndjhbp.png Type: image/png Size: 5970 bytes Desc: not available URL: From anntzer.lee at gmail.com Sun May 3 16:35:45 2020 From: anntzer.lee at gmail.com (Antony Lee) Date: Sun, 3 May 2020 22:35:45 +0200 Subject: [Matplotlib-users] ANN: mplcairo 0.3 release Message-ID: Dear all, I am pleased to announce the release of mplcairo 0.3. mplcairo is a Matplotlib backend based on the well-known cairo library, supporting output to both raster (including interactively) and vector formats. In other words, it provides the functionality of Matplotlib's {,qt5,gtk3,wx,tk,macos}{agg,cairo}, pdf, ps, and svg backends. Per Matplotlib's standard API, the backend can be selected by calling matplotlib.use("module://mplcairo.qt") or setting your MPLBACKEND environment variable to `module://mplcairo.qt` for Qt5, and similarly for other toolkits. mplcairo 0.3 adds support for OpenType font features (see `examples/opentype_features.py`), pdftex.map font effects, simplifications to the build, and as well as the usual bugfixes over 0.2. Enjoy, Antony Lee -------------- next part -------------- An HTML attachment was scrubbed... URL: From ekesawi at yahoo.com Mon May 4 02:30:16 2020 From: ekesawi at yahoo.com (EK Esawi) Date: Mon, 4 May 2020 06:30:16 +0000 (UTC) Subject: [Matplotlib-users] Add disconnected lines to a plot In-Reply-To: <1013216497.331568.1588460882822@mail.yahoo.com> References: <1013216497.331568.1588460882822.ref@mail.yahoo.com> <1013216497.331568.1588460882822@mail.yahoo.com> Message-ID: <761669376.751751.1588573816854@mail.yahoo.com> Thank you so much Jerzyfor a the input. your code works perfectly, but i have some problems inserting nan after each 2 coordinate points as you did with numpy except i am trying to use lists instead of numpy plus, it's been a while since i programmed in Python. Once i figure out how to do that then it should work. Thanks again and best of luck. EK On Saturday, May 2, 2020, 7:08:02 PM EDT, EK Esawi wrote: Hi All? I am new to Matplotlib. I created a plot and I want to add a set of straight lines from a set of (x,y) coordinates (2D list). I want to have lines drown from 1st to 2nd then from 3rd to 4th and then from 5th to 6th, etc. I don?t want lines between 2nd and 3rd, 4th and 5th, etc. I think it can be done using Path and Patch, but could not get it done. I even tried to rearrange my data in a way to draw one line piece with zigzag shape but that too did not work well. Any help is greatly appreciated. EK From jerzy.karczmarczuk at unicaen.fr Mon May 4 05:00:45 2020 From: jerzy.karczmarczuk at unicaen.fr (Jerzy Karczmarczuk) Date: Mon, 4 May 2020 11:00:45 +0200 Subject: [Matplotlib-users] Add disconnected lines to a plot In-Reply-To: <761669376.751751.1588573816854@mail.yahoo.com> References: <1013216497.331568.1588460882822.ref@mail.yahoo.com> <1013216497.331568.1588460882822@mail.yahoo.com> <761669376.751751.1588573816854@mail.yahoo.com> Message-ID: <1ce73443-145c-876b-e4bb-35f355465c5a@unicaen.fr> On 04/05/2020 8:30 am, EK Esawi via Matplotlib-users wrote: > i am trying to use lists instead of numpy plus, it's been a while since i programmed in Python. Some advice... 1. People who too often complain that they are beginners, are likely to remain beginners forever. Beware. 2. If you expect to use matplotlib (or plotly, or pyqtgraph, etc.) frequently, master Numpy, or sooner than you think, you will suffer very, very much. 3. My previous example was loop-less; this is one of many advantages of Numpy. But you can do it in the orthodox way as well. *from random import random as rn import matplotlib.pyplot as plt n=20 nan=float('nan') a=[rn() for k in range(n)] ? # just a silly random example for j in range(n-2,0,-2): a.insert(j,nan)# insert your Nans in such a way plt.plot(a) * Best regards Jerzy Karczmarczuk /Caen, France/ -- This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus -------------- next part -------------- An HTML attachment was scrubbed... URL: From jni at fastmail.com Mon May 4 08:25:47 2020 From: jni at fastmail.com (Juan Nunez-Iglesias) Date: Mon, 04 May 2020 07:25:47 -0500 Subject: [Matplotlib-users] Add disconnected lines to a plot In-Reply-To: <1ce73443-145c-876b-e4bb-35f355465c5a@unicaen.fr> References: <1013216497.331568.1588460882822.ref@mail.yahoo.com> <1013216497.331568.1588460882822@mail.yahoo.com> <761669376.751751.1588573816854@mail.yahoo.com> <1ce73443-145c-876b-e4bb-35f355465c5a@unicaen.fr> Message-ID: An alternative approach to inserting nans is to use a LineCollection. I have some sample code using it here: https://github.com/jni/skan/blob/master/skan/draw.py#L133-L146 But the documentation is quite clear: https://matplotlib.org/3.1.1/api/collections_api.html#matplotlib.collections.LineCollection See specifically the description of `segments`, which can be either an array of shape (n_segments, n_points, 2), ie (n, 2, 2) in your case, or a list of line segments. Juan. On Mon, 4 May 2020, at 4:00 AM, Jerzy Karczmarczuk wrote: > On 04/05/2020 8:30 am, EK Esawi via Matplotlib-users wrote: >> i am trying to use lists instead of numpy plus, it's been a while since i programmed in Python. > Some advice... > 1. People who too often complain that they are beginners, are likely to remain beginners forever. Beware. > 2. If you expect to use matplotlib (or plotly, or pyqtgraph, etc.) frequently, master Numpy, or sooner than you think, you will suffer very, very much. > 3. My previous example was loop-less; this is one of many advantages of Numpy. But you can do it in the orthodox way as well. > > *from random import random as rn > import matplotlib.pyplot as plt > n=20 > nan=float('nan') > a=[rn() for k in range(n)] # just a silly random example > > for j in range(n-2,0,-2): > a.insert(j,nan)# insert your Nans in such a way > plt.plot(a) * > > Best regards > Jerzy Karczmarczuk > /Caen, France/ > > > > > > Avast logo > This email has been checked for viruses by Avast antivirus software. > www.avast.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 ekesawi at yahoo.com Mon May 4 16:21:25 2020 From: ekesawi at yahoo.com (EK Esawi) Date: Mon, 4 May 2020 20:21:25 +0000 (UTC) Subject: [Matplotlib-users] Add disconnected lines to a plot References: <865727991.1153701.1588623685947.ref@mail.yahoo.com> Message-ID: <865727991.1153701.1588623685947@mail.yahoo.com> Thank you Jerzy and Juan for the help. I actually managed to get everything working using nan. Thank you for the advice as well. I am well away of the power of Numpy and other major modules. I have been suing R for a few years and now want to switch back to Python and the switch is nooooooooooo fun:) Anyway, than you all EK? From m.dilorenzo at nanotechanalysis.com Tue May 5 04:50:46 2020 From: m.dilorenzo at nanotechanalysis.com (m.dilorenzo at nanotechanalysis.com) Date: Tue, 5 May 2020 10:50:46 +0200 Subject: [Matplotlib-users] Problem with MatplotLib embedded in PyQt5 Message-ID: <000e01d622ba$470268d0$d5073a70$@nanotechanalysis.com> Hello, I'm using a matplotlib plot embedded into a PyQt5 GUI. After some modification the figure toolbar became grayed (visible but not active) and no action is feasible anymore on the plot during running. In the previous program versions it works, incidentally I guess since the modifications I've made are only on the computational parts of the code. Is there a way to control the activation of these interactive settings (I really need to zoom and rotate 3d graph while running.). I've already tried with setfocus command but no joy (I don't relay understand how the focus is managed .) Any help is welcome. Thank you in advance and best regards. Maurizio Some souce code: widget class promoted inside a QTDesigner UI # ------------------------------------------------------ # -------------------- mplwidget.py -------------------- # ------------------------------------------------------ from PyQt5.QtWidgets import * from matplotlib.backends.backend_qt5agg import FigureCanvas , NavigationToolbar2QT as NavigationToolbar from matplotlib.figure import Figure class MplWidget(QWidget): def __init__(self, parent = None): QWidget.__init__(self, parent) #self.figure = Figure() self.canvas = FigureCanvas(Figure(constrained_layout=True)) self.toolbar = NavigationToolbar(self.canvas, self) vertical_layout = QVBoxLayout() vertical_layout.addWidget(self.toolbar) vertical_layout.addWidget(self.canvas) self.canvas.axesMain = self.canvas.figure.add_subplot(111) self.setLayout(vertical_layout) -------------- next part -------------- An HTML attachment was scrubbed... URL: From m.dilorenzo at nanotechanalysis.com Thu May 7 04:55:52 2020 From: m.dilorenzo at nanotechanalysis.com (m.dilorenzo at nanotechanalysis.com) Date: Thu, 7 May 2020 10:55:52 +0200 Subject: [Matplotlib-users] R: Problem with MatplotLib embedded in PyQt5 In-Reply-To: <000e01d622ba$470268d0$d5073a70$@nanotechanalysis.com> References: <000e01d622ba$470268d0$d5073a70$@nanotechanalysis.com> Message-ID: <000001d6244d$50eed740$f2cc85c0$@nanotechanalysis.com> Hello All, Problem solved! I had inadvertently removed the flag to be enabled in the widget in Qtdesigner. My bug research was focused on my application files instead of ui files? ? Anyway I?d like to highlight a lack of info on the NavigationToolbar2QT API interface (at least I can0t find it). Best regards, Maurizio Da: Matplotlib-users Per conto di m.dilorenzo at nanotechanalysis.com Inviato: marted? 5 maggio 2020 10:51 A: matplotlib-users at python.org Oggetto: [Matplotlib-users] Problem with MatplotLib embedded in PyQt5 Hello, I?m using a matplotlib plot embedded into a PyQt5 GUI. After some modification the figure toolbar became grayed (visible but not active) and no action is feasible anymore on the plot during running. In the previous program versions it works, incidentally I guess since the modifications I?ve made are only on the computational parts of the code. Is there a way to control the activation of these interactive settings (I really need to zoom and rotate 3d graph while running?). I?ve already tried with setfocus command but no joy (I don?t relay understand how the focus is managed ?) Any help is welcome. Thank you in advance and best regards. Maurizio Some souce code: widget class promoted inside a QTDesigner UI # ------------------------------------------------------ # -------------------- mplwidget.py -------------------- # ------------------------------------------------------ from PyQt5.QtWidgets import * from matplotlib.backends.backend_qt5agg import FigureCanvas , NavigationToolbar2QT as NavigationToolbar from matplotlib.figure import Figure class MplWidget(QWidget): def __init__(self, parent = None): QWidget.__init__(self, parent) #self.figure = Figure() self.canvas = FigureCanvas(Figure(constrained_layout=True)) self.toolbar = NavigationToolbar(self.canvas, self) vertical_layout = QVBoxLayout() vertical_layout.addWidget(self.toolbar) vertical_layout.addWidget(self.canvas) self.canvas.axesMain = self.canvas.figure.add_subplot(111) self.setLayout(vertical_layout) -------------- next part -------------- An HTML attachment was scrubbed... URL: From martin.schimmels at web.de Sat May 16 09:56:41 2020 From: martin.schimmels at web.de (Martin Schimmels) Date: Sat, 16 May 2020 15:56:41 +0200 Subject: [Matplotlib-users] Error importing matplotlib Message-ID: Hi, I wonder what's happening: (OS: OpenSuSE Linux Leap 15.1; Python 3.6.10; matplotlib-2.0.2-py3.6) ================ ~> python Python 3.6.10 (default, Jan 16 2020, 09:12:04) [GCC] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import matplotlib.pyplot as plt Traceback (most recent call last): File "", line 1, in File "/usr/lib64/python3.6/site-packages/matplotlib/__init__.py", line 122, in from matplotlib.cbook import is_string_like, mplDeprecation, dedent, get_label ImportError: cannot import name 'is_string_like' ================ Worked 2 weeks ago. Changes on my system: installed a venv, removed it. Greetings Martin From nathan.goldbaum at gmail.com Sat May 16 10:02:23 2020 From: nathan.goldbaum at gmail.com (Nathan) Date: Sat, 16 May 2020 08:02:23 -0600 Subject: [Matplotlib-users] Error importing matplotlib In-Reply-To: References: Message-ID: It looks like you have two different matplotlib versions simultaneously installed somehow, is_string_like was removed in matplotlib 3.0. Probably the easiest way to fix this is just to blow away the virtualenv. On Sat, May 16, 2020 at 7:56 AM Martin Schimmels wrote: > Hi, > I wonder what's happening: > (OS: OpenSuSE Linux Leap 15.1; Python 3.6.10; matplotlib-2.0.2-py3.6) > > ================ > ~> python > Python 3.6.10 (default, Jan 16 2020, 09:12:04) [GCC] on linux > Type "help", "copyright", "credits" or "license" for more information. > >>> import matplotlib.pyplot as plt > Traceback (most recent call last): > File "", line 1, in > File "/usr/lib64/python3.6/site-packages/matplotlib/__init__.py", line > 122, in > from matplotlib.cbook import is_string_like, mplDeprecation, dedent, > get_label > ImportError: cannot import name 'is_string_like' > ================ > > Worked 2 weeks ago. Changes on my system: installed a venv, removed it. > > Greetings > Martin > _______________________________________________ > 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 mathoscope at netcourrier.com Sun May 17 01:01:53 2020 From: mathoscope at netcourrier.com (Vincent Douce Mathoscope) Date: Sun, 17 May 2020 07:01:53 +0200 Subject: [Matplotlib-users] which IDE ? In-Reply-To: References: Message-ID: <19A1EBBF-2BA0-4F77-A02E-1D12A7E6158C@netcourrier.com> hi when i am creating Matplotlib figures i edit the python code in some text editor then i run it in the temrinal then the picture appears in an external app whose icon is a rocket then to modify the code and see the result i have to close the rocket window etc.. it is not so fluid as protocol my question is : do you use any IDE more ergonomic than my protocol ? thanks Vincent From jerzy.karczmarczuk at unicaen.fr Sun May 17 04:17:26 2020 From: jerzy.karczmarczuk at unicaen.fr (Jerzy Karczmarczuk) Date: Sun, 17 May 2020 10:17:26 +0200 Subject: [Matplotlib-users] which IDE ? In-Reply-To: <19A1EBBF-2BA0-4F77-A02E-1D12A7E6158C@netcourrier.com> References: <19A1EBBF-2BA0-4F77-A02E-1D12A7E6158C@netcourrier.com> Message-ID: On 17/05/2020 7:01 am, Vincent Douce Mathoscope wrote: > when i am creating Matplotlib figures > i edit the python code in some text editor > then i run it in the temrinal > then the picture appears in an external app whose icon is a rocket > then to modify the code and see the result i have to close the rocket window etc.. > it is not so fluid as protocol > my question is : > *do you use any IDE more ergonomic than my protocol ?* Dozens, or so. But if you don't even tell your readers which platform, which system are you using, which Python distribution, etc., our friend Harry Potter, and we other dark magicians might have problems with proposing you an adequate magic. Jerzy Karczmarczuk /Caen, France/ -- This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus -------------- next part -------------- An HTML attachment was scrubbed... URL: From tcaswell at gmail.com Sun May 17 13:29:59 2020 From: tcaswell at gmail.com (Thomas Caswell) Date: Sun, 17 May 2020 13:29:59 -0400 Subject: [Matplotlib-users] which IDE ? In-Reply-To: References: <19A1EBBF-2BA0-4F77-A02E-1D12A7E6158C@netcourrier.com> Message-ID: As this is an international and text-based mailing list please I am not sure that (what I am assuming is good natured) humor will always translate, please keep the discussion here professional. There are a number of IDE / editors (emacs, vscode, pycharm, jupyterlab, ...) that allow you to have a running (I)Python session that you send your code to be evaluated in a continuously running session. If you put use pyplots "interactive" mode your windows will stay open and you can keep re-evaluating (parts of) your code until you are happy. Personally I use emacs + org-mode + IPython in this way. Best of luck! Tom On Sun, May 17, 2020 at 4:22 AM Jerzy Karczmarczuk < jerzy.karczmarczuk at unicaen.fr> wrote: > On 17/05/2020 7:01 am, Vincent Douce Mathoscope wrote: > > when i am creating Matplotlib figures > i edit the python code in some text editor > then i run it in the temrinal > then the picture appears in an external app whose icon is a rocket > then to modify the code and see the result i have to close the rocket window etc.. > it is not so fluid as protocol > my question is :*do you use any IDE more ergonomic than my protocol ?* > > Dozens, or so. > > But if you don't even tell your readers which platform, which system are > you using, which Python distribution, etc., > our friend Harry Potter, and we other dark magicians might have problems > with proposing you an adequate magic. > > Jerzy Karczmarczuk > /Caen, France/ > > > > > ------------------------------ > [image: Avast logo] > > This email has been checked for viruses by Avast antivirus software. > www.avast.com > > <#m_-7050790206416722023_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2> > > > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users > -- Thomas Caswell tcaswell at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From selasley at icloud.com Sun May 17 14:23:06 2020 From: selasley at icloud.com (Scott Lasley) Date: Sun, 17 May 2020 14:23:06 -0400 Subject: [Matplotlib-users] which IDE ? In-Reply-To: <19A1EBBF-2BA0-4F77-A02E-1D12A7E6158C@netcourrier.com> References: <19A1EBBF-2BA0-4F77-A02E-1D12A7E6158C@netcourrier.com> Message-ID: <7809536F-D0A7-420F-8809-7C553BDE9490@icloud.com> Hi Vincent, You may want to try Jupyter notebooks or Jupyterlab with the %matplotlib magics. You can modify the code in a cell, re-run it and see the updated plot in the notebook window. When you're happy with the results, copy-paste the code into a .py file for use outside of the notebook. Here are a few links in case you are not familiar with Jupiter https://jupyter.org https://realpython.com/jupyter-notebook-introduction/ https://jupyterlab.readthedocs.io/en/stable/ https://medium.com/@1522933668924/using-matplotlib-in-jupyter-notebooks-comparing-methods-and-some-tips-python-c38e85b40ba1 (April 2018) https://www.youtube.com/watch?v=7jiPeIFXb6U&list=PL055Epbe6d5b572IRmYAHkUgcq3y6K3Ae&index=32&t=0s (Joel Grus "I Don't Like Notebooks" talk at 2018 Jupytercon) The free Visual Studio Code IDE supports Jupyter notebooks and can display Matplotlib plots in the IDE - https://code.visualstudio.com/docs/python/data-science-tutorial If you are looking for a commercial IDE, the pro version of PyCharm has a scientific mode that displays plots in their own tab - https://www.jetbrains.com/help/pycharm/matplotlib-support.html and the Wing IDE can display plots in the IDE - https://wingware.com/blog/matplotlib Hope this helps, Scott > On May 17, 2020, at 1:01 AM, Vincent Douce Mathoscope wrote: > > hi > when i am creating Matplotlib figures > i edit the python code in some text editor > then i run it in the temrinal > then the picture appears in an external app whose icon is a rocket > then to modify the code and see the result i have to close the rocket window etc.. > it is not so fluid as protocol > my question is : > do you use any IDE more ergonomic than my protocol ? > thanks > Vincent > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users From rafael.raccuia at blindekinder.com Mon May 18 04:33:53 2020 From: rafael.raccuia at blindekinder.com (Raphael Raccuia) Date: Mon, 18 May 2020 10:33:53 +0200 Subject: [Matplotlib-users] matplotlib interactive in a shell terminal? Message-ID: <96d8a66c-88d5-6c6d-b8a8-e1a6c5dae5a2@blindekinder.com> Hi, Any chance? to use matplotlib in a linux shell terminal? if I make 'python3 my/script.py', it displays the plot but I have no prompt >>>. It works in Idle. That would be my test script: #!/usr/bin/env python3 #otherwise loads a 'ghost': cursor turn to cross, but no window. import matplotlib print(matplotlib.get_backend()) #print TkAgg in the terminal import matplotlib.pyplot as plt plt.ion() plt.plot([1, 2, 3, 4], [1, 4, 2, 3]) plt.show(block=True) #block=True: othewise it close immediately plot and terminal thank you! rph-r From jni at fastmail.com Mon May 18 05:08:36 2020 From: jni at fastmail.com (Juan Nunez-Iglesias) Date: Mon, 18 May 2020 04:08:36 -0500 Subject: [Matplotlib-users] matplotlib interactive in a shell terminal? In-Reply-To: <96d8a66c-88d5-6c6d-b8a8-e1a6c5dae5a2@blindekinder.com> References: <96d8a66c-88d5-6c6d-b8a8-e1a6c5dae5a2@blindekinder.com> Message-ID: <5cdf5f64-eeeb-4b17-9fc4-58eadf953011@www.fastmail.com> Hi Raphael, Have you seen IPython? It was created precisely for this use case. http://ipython.org/ Depending on your setup, you will want to `pip install ipython`, `conda install ipython`, or `sudo apt install ipython`. (I don't recommend `sudo pip install [anything]`.) Once you are in IPython, you can run your script with `%run -i my_script.py`, and get your prompt, from which you can control the plot or create other plots. I also recommend you use conda environments for development: https://docs.conda.io/projects/conda/en/latest/user-guide/getting-started.html I hope this helps! Juan. On Mon, 18 May 2020, at 3:33 AM, Raphael Raccuia wrote: > Hi, > Any chance? to use matplotlib in a linux shell terminal? > > if I make 'python3 my/script.py', it displays the plot but I have no > prompt >>>. > It works in Idle. > That would be my test script: > > #!/usr/bin/env python3 #otherwise loads a 'ghost': cursor turn to cross, > but no window. > > import matplotlib > print(matplotlib.get_backend()) #print TkAgg in the terminal > > import matplotlib.pyplot as plt > > plt.ion() > > > plt.plot([1, 2, 3, 4], [1, 4, 2, 3]) > > plt.show(block=True) #block=True: othewise it close immediately plot and > terminal > > thank you! > > rph-r > > > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users > From rafael.raccuia at blindekinder.com Mon May 18 05:51:54 2020 From: rafael.raccuia at blindekinder.com (Raphael Raccuia) Date: Mon, 18 May 2020 11:51:54 +0200 Subject: [Matplotlib-users] matplotlib interactive in a shell terminal? In-Reply-To: <5cdf5f64-eeeb-4b17-9fc4-58eadf953011@www.fastmail.com> References: <96d8a66c-88d5-6c6d-b8a8-e1a6c5dae5a2@blindekinder.com> <5cdf5f64-eeeb-4b17-9fc4-58eadf953011@www.fastmail.com> Message-ID: <49736aa0-ea8d-0b7b-c849-88966d829c95@blindekinder.com> Hi, thank you for your answers! I saw about ipython, I would have used that but I use the [shell] object in Puredata (music object programmation language) which just send commands to terminal, that's why... There is a Python object, but only works with 2.7. rph-r Le 18.05.20 ? 11:08, Juan Nunez-Iglesias a ?crit?: > Hi Raphael, > > Have you seen IPython? It was created precisely for this use case. > > http://ipython.org/ > > Depending on your setup, you will want to `pip install ipython`, `conda install ipython`, or `sudo apt install ipython`. (I don't recommend `sudo pip install [anything]`.) > > Once you are in IPython, you can run your script with `%run -i my_script.py`, and get your prompt, from which you can control the plot or create other plots. > > I also recommend you use conda environments for development: > > https://docs.conda.io/projects/conda/en/latest/user-guide/getting-started.html > > I hope this helps! > > Juan. > > On Mon, 18 May 2020, at 3:33 AM, Raphael Raccuia wrote: >> Hi, >> Any chance? to use matplotlib in a linux shell terminal? >> >> if I make 'python3 my/script.py', it displays the plot but I have no >> prompt >>>. >> It works in Idle. >> That would be my test script: >> >> #!/usr/bin/env python3 #otherwise loads a 'ghost': cursor turn to cross, >> but no window. >> >> import matplotlib >> print(matplotlib.get_backend()) #print TkAgg in the terminal >> >> import matplotlib.pyplot as plt >> >> plt.ion() >> >> >> plt.plot([1, 2, 3, 4], [1, 4, 2, 3]) >> >> plt.show(block=True) #block=True: othewise it close immediately plot and >> terminal >> >> thank you! >> >> rph-r >> >> >> _______________________________________________ >> 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 From newville at cars.uchicago.edu Mon May 18 09:59:14 2020 From: newville at cars.uchicago.edu (Matt Newville) Date: Mon, 18 May 2020 08:59:14 -0500 Subject: [Matplotlib-users] matplotlib interactive in a shell terminal? In-Reply-To: <96d8a66c-88d5-6c6d-b8a8-e1a6c5dae5a2@blindekinder.com> References: <96d8a66c-88d5-6c6d-b8a8-e1a6c5dae5a2@blindekinder.com> Message-ID: Raphael, Depending on your needs, you might find wxmplot useful. This supports non-blocking, interactive 2D plots and image display from a terminal Python or IPython session. As the name might imply, it requires wxPython but is installed with `pip install wxmplot` if your Linux Python has wxPython available (Anaconda Python does). With this installed, you can do >>> import numpy as np >>> import wxmplot.interactive as wi >>> x = np.linspace(0, 20, 101) >>> wi.plot(x, np.sin(x), xlabel='t (s)') >>> wi.plot(x, np.cos(x)*np.exp(-x/10)) The first plot() there will show an interactive display of the plot and return the prompt. The second plot() here add the trace on top of the first (you can add optional arguments to open a second plot window or draw to right-hand axes). The plot windows have drag-and-zoom and many configuration options for colors, themes, etc available after the plot has been displayed. There is also a `wxmpot.interactive.imshow()` to show an interactive false-color image of 2D data. See https://newville.github.io/wxmplot/interactive.html for more details. Of course, these do not do everything available in matplotlib, but if you are doing basic 2D line plots or image display they should go a long way. And you can grab that return value and its `PlotDisplay.panel.axes` (a matplotlib Axes) and `PlotDisplay.panel.fig` (a matplotib Figure) if you want to do more complicated things. --Matt On Mon, May 18, 2020 at 3:43 AM Raphael Raccuia < rafael.raccuia at blindekinder.com> wrote: > Hi, > Any chance to use matplotlib in a linux shell terminal? > > if I make 'python3 my/script.py', it displays the plot but I have no > prompt >>>. > It works in Idle. > That would be my test script: > > #!/usr/bin/env python3 #otherwise loads a 'ghost': cursor turn to cross, > but no window. > > import matplotlib > print(matplotlib.get_backend()) #print TkAgg in the terminal > > import matplotlib.pyplot as plt > > plt.ion() > > > plt.plot([1, 2, 3, 4], [1, 4, 2, 3]) > > plt.show(block=True) #block=True: othewise it close immediately plot and > terminal > > thank you! > > rph-r > > > _______________________________________________ > 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 rafael.raccuia at blindekinder.com Mon May 18 18:04:41 2020 From: rafael.raccuia at blindekinder.com (Raphael Raccuia) Date: Tue, 19 May 2020 00:04:41 +0200 Subject: [Matplotlib-users] matplotlib interactive in a shell terminal? In-Reply-To: References: <96d8a66c-88d5-6c6d-b8a8-e1a6c5dae5a2@blindekinder.com> Message-ID: <6c2fe153-50a9-9eaf-6a23-cd8825d17a10@blindekinder.com> Thank you Matt, since the visual of my plot is almost finished and nice, I'm not sure I'll learn another language at the moment. Anyway, I fixed my script to work with P2.7, and learned how to use Puredata [pyext] object, but now I have the following issue, related to the initial one: plt.ion() plt.plot([1, 2, 3, 4], [1, 4, 2, 3]) plt.show(block=True) The plot is interactive, PD sends instructions to Python to fill and modify. If */block/* = */True/*, it displays the plot in Tk window, but since it's blocked, PD doesn't respond until I close the window. If /*block*/ = */False/*, Tk window appear, empty, and impossible to close, but PD remains functional. any idea how to fix that? rph Le 18.05.20 ? 15:59, Matt Newville a ?crit?: > Raphael, > > Depending on your needs, you might find wxmplot useful.? This supports > non-blocking, interactive 2D plots and image display from a terminal > Python?or IPython session.? As the name might imply, it > requires?wxPython but is installed with `pip install wxmplot` if your > Linux Python has wxPython available (Anaconda Python does).? With this > installed, you can do > > >>> import numpy as np > >>> import wxmplot.interactive as wi > >>> x = np.linspace(0, 20, 101) > >>> wi.plot(x, np.sin(x), xlabel='t(s)') > > >>> wi.plot(x, np.cos(x)*np.exp(-x/10)) > > > The first plot() there will show an interactive display of the plot > and return the prompt.? The second plot() here add?the trace on top of > the first (you can add optional arguments to open a second plot window > or draw to right-hand axes). The plot windows have drag-and-zoom and > many configuration options for colors, themes, etc available after the > plot has been displayed.? There is also a > `wxmpot.interactive.imshow()` to show an interactive false-color image > of 2D data. See > https://newville.github.io/wxmplot/interactive.html?for more details. > > Of course, these do not do everything available in matplotlib, but if > you are doing basic 2D line plots or image display they should go a > long way.? And you can grab that return?value and its > `PlotDisplay.panel.axes` (a matplotlib Axes) and > `PlotDisplay.panel.fig` (a matplotib Figure) if you want to do more > complicated things. > > --Matt > > On Mon, May 18, 2020 at 3:43 AM Raphael Raccuia > > wrote: > > Hi, > Any chance? to use matplotlib in a linux shell terminal? > > if I make 'python3 my/script.py', it displays the plot but I have no > prompt >>>. > It works in Idle. > That would be my test script: > > #!/usr/bin/env python3 #otherwise loads a 'ghost': cursor turn to > cross, > but no window. > > import matplotlib > print(matplotlib.get_backend()) #print TkAgg in the terminal > > import matplotlib.pyplot as plt > > plt.ion() > > > plt.plot([1, 2, 3, 4], [1, 4, 2, 3]) > > plt.show(block=True) #block=True: othewise it close immediately > plot and > terminal > > thank you! > > rph-r > > > _______________________________________________ > 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 newville at cars.uchicago.edu Mon May 18 19:04:16 2020 From: newville at cars.uchicago.edu (Matt Newville) Date: Mon, 18 May 2020 18:04:16 -0500 Subject: [Matplotlib-users] matplotlib interactive in a shell terminal? In-Reply-To: <6c2fe153-50a9-9eaf-6a23-cd8825d17a10@blindekinder.com> References: <96d8a66c-88d5-6c6d-b8a8-e1a6c5dae5a2@blindekinder.com> <6c2fe153-50a9-9eaf-6a23-cd8825d17a10@blindekinder.com> Message-ID: Hi Raphael, Sorry, I have no idea what Puredata is. I thought your question was about "linux shell terminal". Wxmplot is not another language, it is a simple python module with functions called `plot()`, `imshow()`, and a few other functions for extra tools. It's not magic (and doesn't require any of the silly IPython "magic"). From a usage point of view, I think it could not be much simpler: it does not need `ion()` or `show()`. Just `plot()`. But, maybe you're looking for something else. Cheers, On Mon, May 18, 2020 at 5:04 PM Raphael Raccuia < rafael.raccuia at blindekinder.com> wrote: > Thank you Matt, > > since the visual of my plot is almost finished and nice, I'm not sure I'll > learn another language at the moment. > > Anyway, I fixed my script to work with P2.7, and learned how to use > Puredata [pyext] object, but now I have the following issue, related to the > initial one: > > plt.ion() > plt.plot([1, 2, 3, 4], [1, 4, 2, 3]) > plt.show(block=True) > > The plot is interactive, PD sends instructions to Python to fill and > modify. If *block* = *True*, it displays the plot in Tk window, but since > it's blocked, PD doesn't respond until I close the window. > If *block* = *False*, Tk window appear, empty, and impossible to close, > but PD remains functional. > > any idea how to fix that? > rph > > Le 18.05.20 ? 15:59, Matt Newville a ?crit : > > Raphael, > > Depending on your needs, you might find wxmplot useful. This supports > non-blocking, interactive 2D plots and image display from a terminal > Python or IPython session. As the name might imply, it requires wxPython > but is installed with `pip install wxmplot` if your Linux Python has > wxPython available (Anaconda Python does). With this installed, you can do > > >>> import numpy as np > >>> import wxmplot.interactive as wi > >>> x = np.linspace(0, 20, 101) > >>> wi.plot(x, np.sin(x), xlabel='t (s)') > > >>> wi.plot(x, np.cos(x)*np.exp(-x/10)) > > > The first plot() there will show an interactive display of the plot and > return the prompt. The second plot() here add the trace on top of the > first (you can add optional arguments to open a second plot window or draw > to right-hand axes). The plot windows have drag-and-zoom and many > configuration options for colors, themes, etc available after the plot has > been displayed. There is also a `wxmpot.interactive.imshow()` to show an > interactive false-color image of 2D data. See > https://newville.github.io/wxmplot/interactive.html for more details. > > Of course, these do not do everything available in matplotlib, but if you > are doing basic 2D line plots or image display they should go a long way. > And you can grab that return value and its `PlotDisplay.panel.axes` (a > matplotlib Axes) and `PlotDisplay.panel.fig` (a matplotib Figure) if you > want to do more complicated things. > > --Matt > > On Mon, May 18, 2020 at 3:43 AM Raphael Raccuia < > rafael.raccuia at blindekinder.com> wrote: > >> Hi, >> Any chance to use matplotlib in a linux shell terminal? >> >> if I make 'python3 my/script.py', it displays the plot but I have no >> prompt >>>. >> It works in Idle. >> That would be my test script: >> >> #!/usr/bin/env python3 #otherwise loads a 'ghost': cursor turn to cross, >> but no window. >> >> import matplotlib >> print(matplotlib.get_backend()) #print TkAgg in the terminal >> >> import matplotlib.pyplot as plt >> >> plt.ion() >> >> >> plt.plot([1, 2, 3, 4], [1, 4, 2, 3]) >> >> plt.show(block=True) #block=True: othewise it close immediately plot and >> terminal >> >> thank you! >> >> rph-r >> >> >> _______________________________________________ >> 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 > -- --Matt Newville 630-252-0431 -------------- next part -------------- An HTML attachment was scrubbed... URL: From rafael.raccuia at blindekinder.com Mon May 18 19:11:55 2020 From: rafael.raccuia at blindekinder.com (Raphael Raccuia) Date: Tue, 19 May 2020 01:11:55 +0200 Subject: [Matplotlib-users] matplotlib interactive in a shell terminal? In-Reply-To: References: <96d8a66c-88d5-6c6d-b8a8-e1a6c5dae5a2@blindekinder.com> <6c2fe153-50a9-9eaf-6a23-cd8825d17a10@blindekinder.com> Message-ID: <2a51cdaa-8ebf-9cd8-13d5-e3a7d0c25d10@blindekinder.com> Ah, ok I get it. I'll give a try. Puredata is a visual programming languate: http://puredata.info/, which has a lib to bind with Python 2.7. It's related to my first question cause in both cases it doesn't display. So simply why does it work in Idle, but not in PD and shell? rph Le 19.05.20 ? 01:04, Matt Newville a ?crit?: > Hi Raphael, > > Sorry, I have no idea what Puredata is.? I thought your question was > about "linux shell terminal". > > Wxmplot is not another language, it is a simple python module with > functions called `plot()`, `imshow()`, and a few other functions for > extra tools.? ?It's not magic (and doesn't require any of the silly > IPython "magic").? From a usage point of view, I think it could not be > much simpler: it does not need `ion()` or `show()`.? Just `plot()`. > > But, maybe you're looking for something else. > Cheers, > > > On Mon, May 18, 2020 at 5:04 PM Raphael Raccuia > > wrote: > > Thank you Matt, > > since the visual of my plot is almost finished and nice, I'm not > sure I'll learn another language at the moment. > > Anyway, I fixed my script to work with P2.7, and learned how to > use Puredata [pyext] object, but now I have the following issue, > related to the initial one: > > plt.ion() > plt.plot([1, 2, 3, 4], [1, 4, 2, 3]) > plt.show(block=True) > > The plot is interactive, PD sends instructions to Python to fill > and modify. If */block/* = */True/*, it displays the plot in Tk > window, but since it's blocked, PD doesn't respond until I close > the window. > If /*block*/ = */False/*, Tk window appear, empty, and impossible > to close, but PD remains functional. > > any idea how to fix that? > rph > > Le 18.05.20 ? 15:59, Matt Newville a ?crit?: >> Raphael, >> >> Depending on your needs, you might find wxmplot useful. This >> supports non-blocking, interactive 2D plots and image display >> from a terminal Python?or IPython session.? As the name might >> imply, it requires?wxPython but is installed with `pip install >> wxmplot` if your Linux Python has wxPython available (Anaconda >> Python does).? With this installed, you can do >> >> ? >>> import numpy as np >> >>> import wxmplot.interactive as wi >> >>> x = np.linspace(0, 20, 101) >> >>> wi.plot(x, np.sin(x), xlabel='t(s)') >> >> >>> wi.plot(x, np.cos(x)*np.exp(-x/10)) >> >> >> The first plot() there will show an interactive display of the >> plot and return the prompt.? The second plot() here add?the trace >> on top of the first (you can add optional arguments to open a >> second plot window or draw to right-hand axes). The plot windows >> have drag-and-zoom and many configuration options for colors, >> themes, etc available after the plot has been displayed. There is >> also a `wxmpot.interactive.imshow()` to show an interactive >> false-color image of 2D data. See >> https://newville.github.io/wxmplot/interactive.html?for more details. >> >> Of course, these do not do everything available in matplotlib, >> but if you are doing basic 2D line plots or image display they >> should go a long way.? And you can grab that return?value and its >> `PlotDisplay.panel.axes` (a matplotlib Axes) and >> `PlotDisplay.panel.fig` (a matplotib Figure) if you want to do >> more complicated things. >> >> --Matt >> >> On Mon, May 18, 2020 at 3:43 AM Raphael Raccuia >> > > wrote: >> >> Hi, >> Any chance? to use matplotlib in a linux shell terminal? >> >> if I make 'python3 my/script.py', it displays the plot but I >> have no >> prompt >>>. >> It works in Idle. >> That would be my test script: >> >> #!/usr/bin/env python3 #otherwise loads a 'ghost': cursor >> turn to cross, >> but no window. >> >> import matplotlib >> print(matplotlib.get_backend()) #print TkAgg in the terminal >> >> import matplotlib.pyplot as plt >> >> plt.ion() >> >> >> plt.plot([1, 2, 3, 4], [1, 4, 2, 3]) >> >> plt.show(block=True) #block=True: othewise it close >> immediately plot and >> terminal >> >> thank you! >> >> rph-r >> >> >> _______________________________________________ >> 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 > > > > -- > --Matt Newville > 630-252-0431 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tcaswell at gmail.com Wed May 20 10:31:19 2020 From: tcaswell at gmail.com (Thomas Caswell) Date: Wed, 20 May 2020 10:31:19 -0400 Subject: [Matplotlib-users] matplotlib interactive in a shell terminal? In-Reply-To: <2a51cdaa-8ebf-9cd8-13d5-e3a7d0c25d10@blindekinder.com> References: <96d8a66c-88d5-6c6d-b8a8-e1a6c5dae5a2@blindekinder.com> <6c2fe153-50a9-9eaf-6a23-cd8825d17a10@blindekinder.com> <2a51cdaa-8ebf-9cd8-13d5-e3a7d0c25d10@blindekinder.com> Message-ID: The issue you are having is that you need integrate the two event loop (the prompt and the GUI) in a way that they will time share. Please see https://github.com/matplotlib/matplotlib/pull/4779 (which hopefully we can get merged soon so I can start linking people to the docs rather than a PR) for details. The reason that it works in IDLE is that IDLE sets up the hooks to integrate Python prompt and Tk event loop. The IPython magics let you select which GUI event loop you would like to integrate with the terminal. Similarly, someplace inside wxmplot the input hook is being set up for Wx (either implicitly or explicitly). To get this working inside of puredata you should reach out to them and ask about how to talk to their GUI from Python and then make sure that you use the backend that matches that framework. From a very very cursory glance at their website it looks like they have a GUI application with a captive python interpreter so I suspect if you can create a window in the correct toolkit, it will work (because the thing _outside_ of the Python prompt is already running the GUI). Tom On Mon, May 18, 2020 at 7:12 PM Raphael Raccuia < rafael.raccuia at blindekinder.com> wrote: > Ah, ok I get it. I'll give a try. > Puredata is a visual programming languate: http://puredata.info/, which > has a lib to bind with Python 2.7. > It's related to my first question cause in both cases it doesn't display. > So simply why does it work in Idle, but not in PD and shell? > > rph > > Le 19.05.20 ? 01:04, Matt Newville a ?crit : > > Hi Raphael, > > Sorry, I have no idea what Puredata is. I thought your question was about "linux > shell terminal". > > Wxmplot is not another language, it is a simple python module with > functions called `plot()`, `imshow()`, and a few other functions for extra > tools. It's not magic (and doesn't require any of the silly IPython > "magic"). From a usage point of view, I think it could not be much > simpler: it does not need `ion()` or `show()`. Just `plot()`. > > But, maybe you're looking for something else. > Cheers, > > > On Mon, May 18, 2020 at 5:04 PM Raphael Raccuia < > rafael.raccuia at blindekinder.com> wrote: > >> Thank you Matt, >> >> since the visual of my plot is almost finished and nice, I'm not sure >> I'll learn another language at the moment. >> >> Anyway, I fixed my script to work with P2.7, and learned how to use >> Puredata [pyext] object, but now I have the following issue, related to the >> initial one: >> >> plt.ion() >> plt.plot([1, 2, 3, 4], [1, 4, 2, 3]) >> plt.show(block=True) >> >> The plot is interactive, PD sends instructions to Python to fill and >> modify. If *block* = *True*, it displays the plot in Tk window, but >> since it's blocked, PD doesn't respond until I close the window. >> If *block* = *False*, Tk window appear, empty, and impossible to close, >> but PD remains functional. >> >> any idea how to fix that? >> rph >> >> Le 18.05.20 ? 15:59, Matt Newville a ?crit : >> >> Raphael, >> >> Depending on your needs, you might find wxmplot useful. This supports >> non-blocking, interactive 2D plots and image display from a terminal >> Python or IPython session. As the name might imply, it requires wxPython >> but is installed with `pip install wxmplot` if your Linux Python has >> wxPython available (Anaconda Python does). With this installed, you can do >> >> >>> import numpy as np >> >>> import wxmplot.interactive as wi >> >>> x = np.linspace(0, 20, 101) >> >>> wi.plot(x, np.sin(x), xlabel='t (s)') >> >> >>> wi.plot(x, np.cos(x)*np.exp(-x/10)) >> >> >> The first plot() there will show an interactive display of the plot and >> return the prompt. The second plot() here add the trace on top of the >> first (you can add optional arguments to open a second plot window or draw >> to right-hand axes). The plot windows have drag-and-zoom and many >> configuration options for colors, themes, etc available after the plot has >> been displayed. There is also a `wxmpot.interactive.imshow()` to show an >> interactive false-color image of 2D data. See >> https://newville.github.io/wxmplot/interactive.html for more details. >> >> Of course, these do not do everything available in matplotlib, but if you >> are doing basic 2D line plots or image display they should go a long way. >> And you can grab that return value and its `PlotDisplay.panel.axes` (a >> matplotlib Axes) and `PlotDisplay.panel.fig` (a matplotib Figure) if you >> want to do more complicated things. >> >> --Matt >> >> On Mon, May 18, 2020 at 3:43 AM Raphael Raccuia < >> rafael.raccuia at blindekinder.com> wrote: >> >>> Hi, >>> Any chance to use matplotlib in a linux shell terminal? >>> >>> if I make 'python3 my/script.py', it displays the plot but I have no >>> prompt >>>. >>> It works in Idle. >>> That would be my test script: >>> >>> #!/usr/bin/env python3 #otherwise loads a 'ghost': cursor turn to cross, >>> but no window. >>> >>> import matplotlib >>> print(matplotlib.get_backend()) #print TkAgg in the terminal >>> >>> import matplotlib.pyplot as plt >>> >>> plt.ion() >>> >>> >>> plt.plot([1, 2, 3, 4], [1, 4, 2, 3]) >>> >>> plt.show(block=True) #block=True: othewise it close immediately plot and >>> terminal >>> >>> thank you! >>> >>> rph-r >>> >>> >>> _______________________________________________ >>> 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 >> > > > -- > --Matt Newville 630-252-0431 > > > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users > -- Thomas Caswell tcaswell at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From rafael.raccuia at blindekinder.com Sun May 24 16:43:15 2020 From: rafael.raccuia at blindekinder.com (Raphael Raccuia) Date: Sun, 24 May 2020 22:43:15 +0200 Subject: [Matplotlib-users] matplotlib interactive in a shell terminal? In-Reply-To: References: <96d8a66c-88d5-6c6d-b8a8-e1a6c5dae5a2@blindekinder.com> Message-ID: <512653f4-88b1-7c2f-f81c-b91c337c5b62@blindekinder.com> Hi Matt, I can't install *wxmplot*, not in Ubuntu repositories and pip gives: /Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-Ch6MUi/wxmplot/ ?? /rph-r/ / Le 18.05.20 ? 15:59, Matt Newville a ?crit?: > Raphael, > > Depending on your needs, you might find wxmplot useful.? This supports > non-blocking, interactive 2D plots and image display from a terminal > Python?or IPython session.? As the name might imply, it > requires?wxPython but is installed with `pip install wxmplot` if your > Linux Python has wxPython available (Anaconda Python does).? With this > installed, you can do > > >>> import numpy as np > >>> import wxmplot.interactive as wi > >>> x = np.linspace(0, 20, 101) > >>> wi.plot(x, np.sin(x), xlabel='t(s)') > > >>> wi.plot(x, np.cos(x)*np.exp(-x/10)) > > > The first plot() there will show an interactive display of the plot > and return the prompt.? The second plot() here add?the trace on top of > the first (you can add optional arguments to open a second plot window > or draw to right-hand axes). The plot windows have drag-and-zoom and > many configuration options for colors, themes, etc available after the > plot has been displayed.? There is also a > `wxmpot.interactive.imshow()` to show an interactive false-color image > of 2D data. See > https://newville.github.io/wxmplot/interactive.html?for more details. > > Of course, these do not do everything available in matplotlib, but if > you are doing basic 2D line plots or image display they should go a > long way.? And you can grab that return?value and its > `PlotDisplay.panel.axes` (a matplotlib Axes) and > `PlotDisplay.panel.fig` (a matplotib Figure) if you want to do more > complicated things. > > --Matt > > On Mon, May 18, 2020 at 3:43 AM Raphael Raccuia > > wrote: > > Hi, > Any chance? to use matplotlib in a linux shell terminal? > > if I make 'python3 my/script.py', it displays the plot but I have no > prompt >>>. > It works in Idle. > That would be my test script: > > #!/usr/bin/env python3 #otherwise loads a 'ghost': cursor turn to > cross, > but no window. > > import matplotlib > print(matplotlib.get_backend()) #print TkAgg in the terminal > > import matplotlib.pyplot as plt > > plt.ion() > > > plt.plot([1, 2, 3, 4], [1, 4, 2, 3]) > > plt.show(block=True) #block=True: othewise it close immediately > plot and > terminal > > thank you! > > rph-r > > > _______________________________________________ > 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 newville at cars.uchicago.edu Sun May 24 19:50:17 2020 From: newville at cars.uchicago.edu (Matt Newville) Date: Sun, 24 May 2020 18:50:17 -0500 Subject: [Matplotlib-users] matplotlib interactive in a shell terminal? In-Reply-To: <512653f4-88b1-7c2f-f81c-b91c337c5b62@blindekinder.com> References: <96d8a66c-88d5-6c6d-b8a8-e1a6c5dae5a2@blindekinder.com> <512653f4-88b1-7c2f-f81c-b91c337c5b62@blindekinder.com> Message-ID: Raphael, On Sun, May 24, 2020, 3:43 PM Raphael Raccuia < rafael.raccuia at blindekinder.com> wrote: > Hi Matt, > I can't install *wxmplot*, not in Ubuntu repositories and pip gives: > > > *Command "python setup.py egg_info" failed with error code 1 in > /tmp/pip-build-Ch6MUi/wxmplot/ ?? *rph-r > Sorry, I cannot tell what that means. Can you be very clear about what you did and what error message you get. For sure, the intention is that `pip install wxmplot` will work, as this is a pure python module, but there are many ways that things can go wrong. Please verify that you can install other python modules too. Like Tom said, if this is some embedded python environment, there may be conflicts between the event loops. Also, of this is some embedded environment, verify that you are installing to the right place. > Le 18.05.20 ? 15:59, Matt Newville a ?crit : > > Raphael, > > Depending on your needs, you might find wxmplot useful. This supports > non-blocking, interactive 2D plots and image display from a terminal > Python or IPython session. As the name might imply, it requires wxPython > but is installed with `pip install wxmplot` if your Linux Python has > wxPython available (Anaconda Python does). With this installed, you can do > > >>> import numpy as np > >>> import wxmplot.interactive as wi > >>> x = np.linspace(0, 20, 101) > >>> wi.plot(x, np.sin(x), xlabel='t (s)') > > >>> wi.plot(x, np.cos(x)*np.exp(-x/10)) > > > The first plot() there will show an interactive display of the plot and > return the prompt. The second plot() here add the trace on top of the > first (you can add optional arguments to open a second plot window or draw > to right-hand axes). The plot windows have drag-and-zoom and many > configuration options for colors, themes, etc available after the plot has > been displayed. There is also a `wxmpot.interactive.imshow()` to show an > interactive false-color image of 2D data. See > https://newville.github.io/wxmplot/interactive.html for more details. > > Of course, these do not do everything available in matplotlib, but if you > are doing basic 2D line plots or image display they should go a long way. > And you can grab that return value and its `PlotDisplay.panel.axes` (a > matplotlib Axes) and `PlotDisplay.panel.fig` (a matplotib Figure) if you > want to do more complicated things. > > --Matt > > On Mon, May 18, 2020 at 3:43 AM Raphael Raccuia < > rafael.raccuia at blindekinder.com> wrote: > >> Hi, >> Any chance to use matplotlib in a linux shell terminal? >> >> if I make 'python3 my/script.py', it displays the plot but I have no >> prompt >>>. >> It works in Idle. >> That would be my test script: >> >> #!/usr/bin/env python3 #otherwise loads a 'ghost': cursor turn to cross, >> but no window. >> >> import matplotlib >> print(matplotlib.get_backend()) #print TkAgg in the terminal >> >> import matplotlib.pyplot as plt >> >> plt.ion() >> >> >> plt.plot([1, 2, 3, 4], [1, 4, 2, 3]) >> >> plt.show(block=True) #block=True: othewise it close immediately plot and >> terminal >> >> thank you! >> >> rph-r >> >> >> _______________________________________________ >> 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 rafael.raccuia at blindekinder.com Mon May 25 09:23:18 2020 From: rafael.raccuia at blindekinder.com (Raphael Raccuia) Date: Mon, 25 May 2020 15:23:18 +0200 Subject: [Matplotlib-users] matplotlib interactive in a shell terminal? In-Reply-To: References: <96d8a66c-88d5-6c6d-b8a8-e1a6c5dae5a2@blindekinder.com> <512653f4-88b1-7c2f-f81c-b91c337c5b62@blindekinder.com> Message-ID: <00e6675f-46fe-01fb-c8bb-ea8e339530cf@blindekinder.com> Thank you Matt, Le 25.05.20 ? 01:50, Matt Newville a ?crit?: > Raphael, > > > > On Sun, May 24, 2020, 3:43 PM Raphael Raccuia > > wrote: > > Hi Matt, > I can't install *wxmplot*, not in Ubuntu repositories and pip gives: > /Command "python setup.py egg_info" failed with error code 1 in > /tmp/pip-build-Ch6MUi/wxmplot/ > ?? > /rph-r > > > > Sorry, I cannot tell what that means.? Can you be very clear about > what you did and what error message you get.? For sure, the intention > is that `pip install wxmplot` will work, as this is a pure python > module, but there are many ways that things can go wrong. Please > verify that you can install other python modules too. I did /sudo pip install wxmplot/ in a terminal. Also tried with /$ python -m pip install wxmplot/, but it's worse, compilation errors > > Like Tom said, if this is some embedded python environment, there may > be conflicts between the event loops. Also, of this is some embedded > environment, verify that you are installing to the right place. by embedded environment, you mean the pyext in Puredata? I did all the tests in a terminal first, and then in PD: The behaviour is the same. rph > > > > > Le 18.05.20 ? 15:59, Matt Newville a ?crit?: >> Raphael, >> >> Depending on your needs, you might find wxmplot useful. This >> supports non-blocking, interactive 2D plots and image display >> from a terminal Python?or IPython session.? As the name might >> imply, it requires?wxPython but is installed with `pip install >> wxmplot` if your Linux Python has wxPython available (Anaconda >> Python does).? With this installed, you can do >> >> ? >>> import numpy as np >> ? >>> import wxmplot.interactive as wi >> ? >>> x = np.linspace(0, 20, 101) >> ? >>> wi.plot(x, np.sin(x), xlabel='t(s)') >> >> >>> wi.plot(x, np.cos(x)*np.exp(-x/10)) >> >> >> The first plot() there will show an interactive display of the >> plot and return the prompt. The second plot() here add?the trace >> on top of the first (you can add optional arguments to open a >> second plot window or draw to right-hand axes).? The plot windows >> have drag-and-zoom and many configuration options for colors, >> themes, etc available after the plot has been displayed.? There >> is also a `wxmpot.interactive.imshow()` to show an interactive >> false-color image of 2D data. See >> https://newville.github.io/wxmplot/interactive.html?for more details. >> >> Of course, these do not do everything available in matplotlib, >> but if you are doing basic 2D line plots or image display they >> should go a long way.? And you can grab that return?value and its >> `PlotDisplay.panel.axes` (a matplotlib Axes) and >> `PlotDisplay.panel.fig` (a matplotib Figure) if you want to do >> more complicated things. >> >> --Matt >> >> On Mon, May 18, 2020 at 3:43 AM Raphael Raccuia >> > > wrote: >> >> Hi, >> Any chance? to use matplotlib in a linux shell terminal? >> >> if I make 'python3 my/script.py', it displays the plot but I >> have no >> prompt >>>. >> It works in Idle. >> That would be my test script: >> >> #!/usr/bin/env python3 #otherwise loads a 'ghost': cursor >> turn to cross, >> but no window. >> >> import matplotlib >> print(matplotlib.get_backend()) #print TkAgg in the terminal >> >> import matplotlib.pyplot as plt >> >> plt.ion() >> >> >> plt.plot([1, 2, 3, 4], [1, 4, 2, 3]) >> >> plt.show(block=True) #block=True: othewise it close >> immediately plot and >> terminal >> >> thank you! >> >> rph-r >> >> >> _______________________________________________ >> 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 sanap.tejas at gmail.com Mon May 25 15:17:11 2020 From: sanap.tejas at gmail.com (Tejas Sanap) Date: Tue, 26 May 2020 00:47:11 +0530 Subject: [Matplotlib-users] Blog post on animations using matplotlib Message-ID: Hey, folks! I'm writing a blog series on how to make animations using `matplotlib`. It will be a three part series. I have just published the first part in the series on my blog. Here is the link: http://whereistejas.me/ The first part covers the difference between the object-oriented and pyplot interface. It serves as a mild introduction to the figure and axes objects. All comments and criticisms are welcome! Thank you! -- Tejas Sanap (whereistejas on Freenode) http://whereistejas.me From aplin.steve at gmail.com Mon May 25 16:10:05 2020 From: aplin.steve at gmail.com (Steve Aplin) Date: Mon, 25 May 2020 16:10:05 -0400 Subject: [Matplotlib-users] Blog post on animations using matplotlib In-Reply-To: References: Message-ID: Only a comment from me -- glad you're doing this Texas, and I look forward to the results. On Mon, May 25, 2020, 3:17 PM Tejas Sanap, wrote: > Hey, folks! > > I'm writing a blog series on how to make animations using > `matplotlib`. It will be a three part series. I have just published > the first part in the series on my blog. > > Here is the link: http://whereistejas.me/ > > The first part covers the difference between the object-oriented and > pyplot interface. It serves as a mild introduction to the figure and > axes objects. > > All comments and criticisms are welcome! Thank you! > > -- > Tejas Sanap > (whereistejas on Freenode) > http://whereistejas.me > _______________________________________________ > 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 madicken.munk at gmail.com Thu May 28 01:23:18 2020 From: madicken.munk at gmail.com (Madicken Munk) Date: Thu, 28 May 2020 00:23:18 -0500 Subject: [Matplotlib-users] Reminder: June 01 Deadline for the 2020 John Hunter Excellence in Plotting contest! Message-ID: Dear all, My apologies for repeated in-list and cross-list posts! I'd like to remind everybody that the 2020 John Hunter Excellence in Plotting Contest submission deadline is on June 01 -- only a few days away. We welcome and look forward to your submissions! In memory of John Hunter, we are pleased to announce the John Hunter Excellence in Plotting Contest for 2020. This open competition aims to highlight the importance of data visualization to scientific progress and showcase the capabilities of open source software. Participants are invited to submit scientific plots to be judged by a panel. The winning entries will be announced and displayed at SciPy 2020 or announced in the John Hunter Excellence in Plotting Contest website and youtube channel. John Hunter?s family are graciously sponsoring cash prizes for the winners in the following amounts: - 1st prize: $1000 - 2nd prize: $750 - 3rd prize: $500 - Entries must be submitted by June 1st to the form at https://forms.gle/SrexmkDwiAmDc7ej7 - Winners will be announced at Scipy 2020 or publicly on the John Hunter Excellence in Plotting Contest website and youtube channel - Participants do not need to attend the Scipy conference. - Entries may take the definition of ?visualization? rather broadly. Entries may be, for example, a traditional printed plot, an interactive visualization for the web, a dashboard, or an animation. - Source code for the plot must be provided, in the form of Python code and/or a Jupyter notebook, along with a rendering of the plot in a widely used format. The rendering may be, for example, PDF for print, standalone HTML and Javascript for an interactive plot, or MPEG-4 for a video. If the original data can not be shared for reasons of size or licensing, "fake" data may be substituted, along with an image of the plot using real data. - Each entry must include a 300-500 word abstract describing the plot and its importance for a general scientific audience. - Entries will be judged on their clarity, innovation and aesthetics, but most importantly for their effectiveness in communicating a real-world problem. Entrants are encouraged to submit plots that were used during the course of research or work, rather than merely being hypothetical. - SciPy and the John Hunter Excellence in Plotting Contest organizers reserves the right to display any and all entries, whether prize-winning or not, at the conference, use in any materials or on its website, with attribution to the original author(s). - Past entries can be found at https://jhepc.github.io/ - Questions regarding the contest can be sent to jhepc.organizers at gmail.com John Hunter Excellence in Plotting Contest Co-Chairs Madicken Munk Nelle Varoquaux -------------- next part -------------- An HTML attachment was scrubbed... URL: From blancabelmonte52 at gmail.com Mon May 4 15:24:21 2020 From: blancabelmonte52 at gmail.com (Blanca Belmonte) Date: Mon, 04 May 2020 19:24:21 -0000 Subject: [Matplotlib-users] Equipotential lines. Message-ID: <5eb06be4.1c69fb81.aafe6.25ee@mx.google.com> An HTML attachment was scrubbed... URL: From s.saifipour at gmail.com Mon May 18 07:48:54 2020 From: s.saifipour at gmail.com (Soheil Saifipour) Date: Mon, 18 May 2020 11:48:54 -0000 Subject: [Matplotlib-users] Cycler License Message-ID: Dear Thomas I'm working for an organisation as a DevOp engineer. Our data-science team use Cycler library: https://pypi.org/project/Cycler/0.10.0/ I would like to know the exact license type for Cycler library: https://github.com/matplotlib/cycler/blob/master/LICENSE Is this a BSD-3 or BSD-2 library? I would appreciate it if you could help me with this. Kind regards, Soheil -------------- next part -------------- An HTML attachment was scrubbed... URL: From gosta.ljungdahl at foi.se Mon May 18 05:17:26 2020 From: gosta.ljungdahl at foi.se (=?Windows-1252?Q?G=F6sta_Ljungdahl?=) Date: Mon, 18 May 2020 09:17:26 -0000 Subject: [Matplotlib-users] matplotlib interactive in a shell terminal? In-Reply-To: <96d8a66c-88d5-6c6d-b8a8-e1a6c5dae5a2@blindekinder.com> References: <96d8a66c-88d5-6c6d-b8a8-e1a6c5dae5a2@blindekinder.com> Message-ID: <99a419f55899439ab329f391ef69b066@foi.se> Try ipython --pylab in a shell terminal. /gostal ________________________________ Fr?n: Matplotlib-users f?r Raphael Raccuia Skickat: den 18 maj 2020 10:33:53 Till: matplotlib-users at python.org ?mne: [Matplotlib-users] matplotlib interactive in a shell terminal? Hi, Any chance to use matplotlib in a linux shell terminal? if I make 'python3 my/script.py', it displays the plot but I have no prompt >>>. It works in Idle. That would be my test script: #!/usr/bin/env python3 #otherwise loads a 'ghost': cursor turn to cross, but no window. import matplotlib print(matplotlib.get_backend()) #print TkAgg in the terminal import matplotlib.pyplot as plt plt.ion() plt.plot([1, 2, 3, 4], [1, 4, 2, 3]) plt.show(block=True) #block=True: othewise it close immediately plot and terminal thank you! rph-r _______________________________________________ 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: