From mathoscope at netcourrier.com Sat Dec 2 05:38:07 2017 From: mathoscope at netcourrier.com (vincent_mathoscope) Date: Sat, 2 Dec 2017 03:38:07 -0700 (MST) Subject: [Matplotlib-users] size of the picture In-Reply-To: <1512022738170-0.post@n5.nabble.com> References: <1512022738170-0.post@n5.nabble.com> Message-ID: <1512211087413-0.post@n5.nabble.com> hi Jody, Adrian, Julian thanks for your detailed answers i have spent a long time because i did not understand this point : i had to cancel plt.plot(X, C, color="blue", linewidth=1.0, linestyle="-") and to replace it with ax.plot(X, C, color="blue", linewidth=1.0, linestyle="-") now, i have undesrtand this point and everything is ok thanks... ----- ?????????????????????????? Vincent Douce :=: Mathoscope :=: http://mathoscope.xyz 06?13?11?07?26 Bagn?res de Bigorre 65200 -- Sent from: http://matplotlib.1069221.n5.nabble.com/matplotlib-users-f3.html From jie.li_x at hotmail.com Sat Dec 2 12:10:34 2017 From: jie.li_x at hotmail.com (jlx) Date: Sat, 2 Dec 2017 10:10:34 -0700 (MST) Subject: [Matplotlib-users] autoscale y axis in different [x1,x2] range In-Reply-To: References: <1512035742729-0.post@n5.nabble.com> Message-ID: <1512234634093-0.post@n5.nabble.com> thank you, I have solved this problem, sth slimier to yours -- Sent from: http://matplotlib.1069221.n5.nabble.com/matplotlib-users-f3.html From jie.li_x at hotmail.com Sat Dec 2 12:11:44 2017 From: jie.li_x at hotmail.com (jlx) Date: Sat, 2 Dec 2017 10:11:44 -0700 (MST) Subject: [Matplotlib-users] autoscale y axis in different [x1,x2] range In-Reply-To: <4011346184f7f261807d78df50ce2b61@posteo.de> References: <1512035742729-0.post@n5.nabble.com> <4011346184f7f261807d78df50ce2b61@posteo.de> Message-ID: <1512234704527-0.post@n5.nabble.com> thank you, I indeed shared the x axis. Now I have addressed this problem, thanks all the same -- Sent from: http://matplotlib.1069221.n5.nabble.com/matplotlib-users-f3.html From mathoscope at netcourrier.com Sun Dec 3 02:26:14 2017 From: mathoscope at netcourrier.com (vincent_mathoscope) Date: Sun, 3 Dec 2017 00:26:14 -0700 (MST) Subject: [Matplotlib-users] learning Matplotlib, several little questions... Message-ID: <1512285974499-0.post@n5.nabble.com> i everyone i have this code : 1) if i write alos this part of code, the resulting picture does not show the graph any longer, would you have an idea why ? 2) i dont really understand why sometimes i have to write plt.something, and sometimes, thougt, only lafigure.something works ??? 3) i have read and read these pages : https://matplotlib.org/users/pyplot_tutorial.html http://python-simple.com/python-matplotlib/configuration-axes.php http://matplotlib.org/examples/pylab_examples/spine_placement_demo.html https://matplotlib.org/api/pyplot_api.html and i cant manage to find how to display/hide the axis (x axis and y axis) because the word "axis" seems to be assigned to parameter the window... thansk for your help, it is less urgent for me, i can start working without teses answers Vincent ----- ?????????????????????????? Vincent Douce :=: Mathoscope :=: http://mathoscope.xyz 06?13?11?07?26 Bagn?res de Bigorre 65200 -- Sent from: http://matplotlib.1069221.n5.nabble.com/matplotlib-users-f3.html From mathoscope at netcourrier.com Sun Dec 3 02:27:20 2017 From: mathoscope at netcourrier.com (Vincent Douce Mathoscope) Date: Sun, 3 Dec 2017 08:27:20 +0100 Subject: [Matplotlib-users] learning Matplotlib, several little questions.. Message-ID: i everyone i have this code : import numpy as np import matplotlib.pyplot as plt import matplotlib as mpl # choix du style pour l'affichage des ?quations plt.style.use('bmh') # dimensions de la fenetre (L,l)=(12,8) Linch,linch=(L/2.54,l/2.54) fig, lafigure = plt.subplots(figsize=(Linch,linch)) # choix de la police par d?faut mpl.rcParams['font.family'] = 'STIXGeneral' plt.rcParams["font.size"] = 10 # liste X des abscisses pour le trac? X = np.linspace(-np.pi, np.pi, 256,endpoint=True) # fonctions ? tracer f(X) C,S = np.cos(X), np.sin(X) # trac? des courbes lafigure.plot(X, C, color="blue", linewidth=1.0, linestyle="-") lafigure.plot(X, S, color="green", linewidth=1.0, linestyle="-") # l?gendes eq=(r"$\dfrac{1}{2+\frac{2}{xy}}fontof\mathit{equation}$font of text") plt.text(0, 0.2, eq, ha='left', va='center', alpha=1) # graduations sur les axes plt.xticks([-np.pi, -np.pi/2, 0, np.pi/2, np.pi], [r'$-\pi$', r'$-\pi/2$', r'$0$', r'$+\pi/2$', r'$+\pi$']) plt.yticks([-1, 0, +1], [r'$-1$', r'$0$', r'$+1$']) plt.axis('on') lafigure.spines['right'].set_visible(True) # segments lafigure.plot([-3,-2,-1,0,1,2,3],[0.1,-0.1,0.1,-0.1,0.1,-0.1,0.1], color ='blue', linewidth=1, linestyle="-") # petits ronds t=2*np.pi/3 lafigure.scatter([t],[np.cos(t)], 50, color ='blue') lafigure.scatter([t],[np.sin(t)], 50, color ='red') lafigure.grid('true') #lafigure.axis(True) plt.savefig("bordas/Matplotlib_essais/9par6.png", dpi=288) 1) if i write alos this part of code, the resulting picture does not show the graph any longer, would you have an idea why ? # labels sur les axes perturbe les ?chelles : ne pas utiliser #plt.xticks(np.linspace(-4,5,9,endpoint=False)) #plt.yticks(np.linspace(-1,2,7,endpoint=True)) 2) i dont really understand why sometimes i have to write plt.something, and sometimes, thougt, only lafigure.something works ??? 3) i have read and read these pages : https://matplotlib.org/users/pyplot_tutorial.html http://python-simple.com/python-matplotlib/configuration-axes.php http://matplotlib.org/examples/pylab_examples/spine_placement_demo.html https://matplotlib.org/api/pyplot_api.html and i cant manage to find how to display/hide the axis (x axis and y axis) because the word "axis" seems to be assigned to parameter the window... thansk for your help, it is less urgent for me, i can start working without teses answers Vincent ?????????????????????????? Vincent Douce :=: Mathoscope :=: http://mathoscope.xyz 06?13?11?07?26 Bagn?res de Bigorre 65200 -------------- next part -------------- An HTML attachment was scrubbed... URL: From projetmbc at gmail.com Sun Dec 3 05:17:37 2017 From: projetmbc at gmail.com (Christophe BAL (via GMAIL)) Date: Sun, 3 Dec 2017 11:17:37 +0100 Subject: [Matplotlib-users] learning Matplotlib, several little questions.. In-Reply-To: References: Message-ID: <1cb6d390-c0e0-5612-a397-ebdd7c4ada4a@gmail.com> Hello. For point 1, just put *plt.xticks(np.linspace(-4,5,9,endpoint=False))** **plt.yticks(np.linspace(-1,2,7,endpoint=True))* before saving the picture does the job on my computer. For point 2, you have to understand that in your code you work globally and locally on a subplot. In your case, the use of a subplot is not necessary. See the little simplified version of your code joined to this message which also hides the axis. PS 1: you should produce MWEs which are short codes showing one identified problem. PS 2: I hope that "les ?ditions Bordas" will cite the use of matplotlib. ;-) -- Christophe BAL Enseignant Agr?g? de Math?matiques Programmeur Python Amateur -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: example.py Type: text/x-python-script Size: 1338 bytes Desc: not available URL: From mathoscope at netcourrier.com Sun Dec 3 05:52:53 2017 From: mathoscope at netcourrier.com (Vincent Douce Mathoscope) Date: Sun, 3 Dec 2017 11:52:53 +0100 Subject: [Matplotlib-users] learning Matplotlib, several little questions.. In-Reply-To: <1cb6d390-c0e0-5612-a397-ebdd7c4ada4a@gmail.com> References: <1cb6d390-c0e0-5612-a397-ebdd7c4ada4a@gmail.com> Message-ID: Hi Christophe and thanks for your answers ! i work on it and come back here > PS 2: I hope that "les ?ditions Bordas" will cite the use of matplotlib. ;-) > of course you can see here : http://mathoscope.ouvaton.org/Mathoscope.pdf page 7 that i always thank people whose work helps me au plaisir Vincent > -- > Christophe BAL > Enseignant Agr?g? de Math?matiques > Programmeur Python Amateur -------------- next part -------------- An HTML attachment was scrubbed... URL: From jklymak at uvic.ca Sun Dec 3 11:25:40 2017 From: jklymak at uvic.ca (Jody Klymak) Date: Sun, 3 Dec 2017 08:25:40 -0800 Subject: [Matplotlib-users] learning Matplotlib, several little questions.. In-Reply-To: References: Message-ID: <1A022101-68E3-42E2-B948-4C6B30C88592@uvic.ca> Hi Vincent There are two different ?interfaces? to matplotlib. The object-oriented one (ax.plot()) and the Pyplot one (plt.plot()). The Pyplot interface is a convenience wrapper around the object oriented. So plt.plot basically just calls ax.plot using the last-used axes (plt.gca()). You can use the two syntaxes interchangeably but it gets confusing because the Pyplot doesn?t set the current axis or figure so you can easily end up putting things in the wrong axes. Contrary to your other correspondent I pretty strongly recommend not using the Pyplot interface. The object oriented interface is more verbose but more explicit. The problem is that many examples are written in the Pyplot interface, though most of the official docs have made the switch. I hope that helps explain the difference. I basically only use Pyplot to initialize the figure like you did: fig, ax = plt.subplots(). After that I just operate on fig and ax. Which is basically what you did. I think you didn?t find the ax.set_visible method. Cheers Jody. Sent from my iPhone > On Dec 2, 2017, at 11:27 PM, Vincent Douce Mathoscope wrote: > > i everyone i have this code : > import numpy as np > import matplotlib.pyplot as plt > import matplotlib as mpl > > # choix du style pour l'affichage des ?quations > plt.style.use('bmh') > > # dimensions de la fenetre > (L,l)=(12,8) > Linch,linch=(L/2.54,l/2.54) > fig, lafigure = plt.subplots(figsize=(Linch,linch)) > > # choix de la police par d?faut > mpl.rcParams['font.family'] = 'STIXGeneral' > plt.rcParams["font.size"] = 10 > > # liste X des abscisses pour le trac? > X = np.linspace(-np.pi, np.pi, 256,endpoint=True) > > # fonctions ? tracer f(X) > C,S = np.cos(X), np.sin(X) > > # trac? des courbes > lafigure.plot(X, C, color="blue", linewidth=1.0, linestyle="-") > lafigure.plot(X, S, color="green", linewidth=1.0, linestyle="-") > > # l?gendes > eq=(r"$\dfrac{1}{2+\frac{2}{xy}}fontof\mathit{equation}$font of text") > plt.text(0, 0.2, eq, ha='left', va='center', alpha=1) > > # graduations sur les axes > plt.xticks([-np.pi, -np.pi/2, 0, np.pi/2, np.pi], [r'$-\pi$', r'$-\pi/2$', r'$0$', r'$+\pi/2$', r'$+\pi$']) > plt.yticks([-1, 0, +1], [r'$-1$', r'$0$', r'$+1$']) > plt.axis('on') > lafigure.spines['right'].set_visible(True) > > # segments > lafigure.plot([-3,-2,-1,0,1,2,3],[0.1,-0.1,0.1,-0.1,0.1,-0.1,0.1], color ='blue', linewidth=1, linestyle="-") > > # petits ronds > t=2*np.pi/3 > lafigure.scatter([t],[np.cos(t)], 50, color ='blue') > lafigure.scatter([t],[np.sin(t)], 50, color ='red') > > lafigure.grid('true') > #lafigure.axis(True) > > plt.savefig("bordas/Matplotlib_essais/9par6.png", dpi=288) > > 1) if i write alos this part of code, the resulting picture does not show the graph any longer, would you have an idea why ? > # labels sur les axes perturbe les ?chelles : ne pas utiliser > #plt.xticks(np.linspace(-4,5,9,endpoint=False)) > #plt.yticks(np.linspace(-1,2,7,endpoint=True)) > > 2) i dont really understand why sometimes i have to write plt.something, and sometimes, thougt, only lafigure.something works ??? > > 3) i have read and read these pages : > https://matplotlib.org/users/pyplot_tutorial.html > http://python-simple.com/python-matplotlib/configuration-axes.php > http://matplotlib.org/examples/pylab_examples/spine_placement_demo.html > https://matplotlib.org/api/pyplot_api.html > > and i cant manage to find how to display/hide the axis (x axis and y axis) because the word "axis" seems to be assigned to parameter the window... > > thansk for your help, it is less urgent for me, i can start working without teses answers > > Vincent > ?????????????????????????? > Vincent Douce > :=: Mathoscope :=: > http://mathoscope.xyz > 06?13?11?07?26 > Bagn?res de Bigorre 65200 > > _______________________________________________ > 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 Sun Dec 3 15:57:01 2017 From: tcaswell at gmail.com (Thomas Caswell) Date: Sun, 03 Dec 2017 20:57:01 +0000 Subject: [Matplotlib-users] ERROR: _tkinter.TclError: can't invoke "wm" command: application has been destroyed In-Reply-To: <5A16C07E.2030505@sbcglobal.net> References: <5A15E5B0.1000200@sbcglobal.net> <03E370AB-5145-479D-B971-38A71B81AFEF@mac.com> <5A16C07E.2030505@sbcglobal.net> Message-ID: I think this is related to https://github.com/matplotlib/matplotlib/issues/9856 Tom On Thu, Nov 23, 2017 at 7:36 AM Stephen P. Molnar wrote: > > On 11/22/2017 04:40 PM, William Ray Wing wrote: > > > > Sent from my iPhone > > On Nov 22, 2017, at 4:01 PM, Stephen P. Molnar > wrote: > > I am running up to date Matplotlib in Python3.5 on my Debian Stretch > Platform. > > I have not made any changes of which I am aware, but I have started > getting errors when running a Python script that I have written to plot > data obtained from a FORTRAN program. > > > This like a first cousin to the problem you recently posted on the Tutor > list. Do you get the same result if you invoke the script directly from > the command line, i.e. > > $python MolT_5IMT_w_3_2_plot.py > > And not in iPython or Whatever? > > Bill > > Enter Molecule ID: A > Traceback (most recent call last): > File "MolT_5IMT_w_3_2_plot.py", line 83, in > fig.savefig(name_plt,bbox_inches='tight') > File "/usr/local/lib/python3.5/dist-packages/matplotlib/figure.py", line > 1814, in savefig > self.canvas.print_figure(fname, **kwargs) > File > "/usr/local/lib/python3.5/dist-packages/matplotlib/backend_bases.py", line > 2180, in print_figure > self.figure.dpi = dpi > File "/usr/local/lib/python3.5/dist-packages/matplotlib/figure.py", line > 436, in _set_dpi > self.set_size_inches(w, h, forward=forward) > File "/usr/local/lib/python3.5/dist-packages/matplotlib/figure.py", line > 745, in set_size_inches > manager.resize(int(canvasw), int(canvash)) > File > "/usr/local/lib/python3.5/dist-packages/matplotlib/backends/backend_tkagg.py", > line 540, in resize > self.canvas._tkcanvas.master.geometry("%dx%d" % (width, height)) > File "/usr/lib/python3.5/tkinter/__init__.py", line 1698, in wm_geometry > return self.tk.call('wm', 'geometry', self._w, newGeometry) > _tkinter.TclError: can't invoke "wm" command: application has been > destroyed > > > ------------------ > (program exited with code: 1) > Press return to continue > > I have attached the Python script and an input file to this message. > > I would appreciate some assistance in solving this problem > > Thanks in advance. > > -- > Stephen P. Molnar, Ph.D. Life is a fuzzy setwww.molecular-modeling.net Stochastic and multivariate(614)312-7528 <(614)%20312-7528> (c) > Skype: smolnar1 > > > > > > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users > > I get exactly the same messages as soon as I close the plot. > > -- > Stephen P. Molnar, Ph.D. Life is a fuzzy setwww.molecular-modeling.net Stochastic and multivariate(614)312-7528 <(614)%20312-7528> (c) > Skype: smolnar1 > > _______________________________________________ > 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 Sun Dec 3 19:42:50 2017 From: pmhobson at gmail.com (Paul Hobson) Date: Sun, 3 Dec 2017 16:42:50 -0800 Subject: [Matplotlib-users] learning Matplotlib, several little questions... In-Reply-To: <1512285974499-0.post@n5.nabble.com> References: <1512285974499-0.post@n5.nabble.com> Message-ID: Hey Vincent, Unfortunately your code didn't get through (at least the gmail filters). Could you post a link to gist on github (or similar). As for the pyplot API vs the object oriented API, it's a matter convenience (pyplot) versus explicitness (fig., ax.. If you're tinkering with some data in an interactive environment, use the pyplot API if you like it, Personally, I always use the O-O API, even in an exploratory context (e.g., Jupyter notebooks.). On Sat, Dec 2, 2017 at 11:26 PM, vincent_mathoscope < mathoscope at netcourrier.com> wrote: > i everyone i have this code : > > > 1) if i write alos this part of code, the resulting picture does not show > the graph any longer, would you have an idea why ? > > > 2) i dont really understand why sometimes i have to write plt.something, > and > sometimes, thougt, only lafigure.something works ??? > > 3) i have read and read these pages : > https://matplotlib.org/users/pyplot_tutorial.html > > http://python-simple.com/python-matplotlib/configuration-axes.php > > http://matplotlib.org/examples/pylab_examples/spine_placement_demo.html > > https://matplotlib.org/api/pyplot_api.html > > > and i cant manage to find how to display/hide the axis (x axis and y axis) > because the word "axis" seems to be assigned to parameter the window... > > thansk for your help, it is less urgent for me, i can start working without > teses answers > > Vincent > > > > ----- > ?????????????????????????? > Vincent Douce > :=: Mathoscope :=: > http://mathoscope.xyz > 06?13?11?07?26 > Bagn?res de Bigorre 65200 > -- > Sent from: http://matplotlib.1069221.n5.nabble.com/matplotlib-users- > f3.html > _______________________________________________ > 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 strozzi2 at llnl.gov Mon Dec 11 12:35:03 2017 From: strozzi2 at llnl.gov (Strozzi, David J.) Date: Mon, 11 Dec 2017 17:35:03 +0000 Subject: [Matplotlib-users] SOLVED: figures from ipython within emacs on Windows Message-ID: Hi, This is an issue I bugged several people / lists about previously, which has a solution. Thought I'd share it. I am running the GNU Win32 native build of emacs (ver. 25.3), on Windows 7 (not a cygwin or X11 version). I'm one of those "emacs is an operating system" people, and like running Python shells within emacs. The problem was getting matplotlib figures to work - the figure window would either say "not responding", not render, freeze, or somehow misbehave. Someone involved in the elpy package (for python on emacs) gave the following solution, which works for me using the TkAgg or Qt5Agg backends: use jupyter console instead of ipython. The whole thing is murky to me, but I thought that nowadays ipython is the Python-specific "piece" / interface to jupyter console. Either way, it seems like jupyter console just gives me ipython, but apparently in a way that the event loop or whatever with figure windows is "happy". So Add this to your .emacs: (setq python-shell-interpreter "jupyter" python-shell-interpreter-args "console --simple-prompt") (setq python-shell-completion-native-enable nil) Then M-x run-python, then pylab, then figure(1) etc. and it should work. Hope this helps more people use emacs as their Windows Python IDE. Dave -------------- next part -------------- An HTML attachment was scrubbed... URL: From tcaswell at gmail.com Mon Dec 11 22:49:06 2017 From: tcaswell at gmail.com (Thomas Caswell) Date: Tue, 12 Dec 2017 03:49:06 +0000 Subject: [Matplotlib-users] [REL] Matplotlib 2.1.1 Message-ID: Folks, Happy to announce Matplotlib 2.1.1 This is primarily a bug fix release, see https://github.com/matplotlib/matplotlib/releases/tag/v2.1.1 for details. The next planned release is a 2.2 feature release in January/February 2018. Thank you to everyone who worked on this release! Tom -------------- next part -------------- An HTML attachment was scrubbed... URL: From mathoscope at netcourrier.com Wed Dec 13 13:50:05 2017 From: mathoscope at netcourrier.com (Vincent Douce Mathoscope) Date: Wed, 13 Dec 2017 19:50:05 +0100 Subject: [Matplotlib-users] numbering of x axis Message-ID: on these pictures you can see that the x-axe-numbering is truncated i tryed ''' fig.tight_layout() # to nicely fit the subplot(s) in the figure ''' but the picture gets a too large white band around i would like just to increase the margin under the figure so that the x numbering be visible how to do it ? i spend time on http://matplotlib.org/api/pyplot_api.html but dont always find what i am looking for thanks ?????????????????????????? Vincent Douce :=: Mathoscope :=: http://mathoscope.xyz 06?13?11?07?26 Bagn?res de Bigorre 65200 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 11_exo_A.png Type: image/png Size: 5357 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 4_exo_C.png Type: image/png Size: 3958 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 11C_corr.png Type: image/png Size: 3073 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 4_exo_B.png Type: image/png Size: 3644 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 4_exo_A.png Type: image/png Size: 4493 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 11_exo_B.png Type: image/png Size: 5695 bytes Desc: not available URL: From mathoscope at netcourrier.com Wed Dec 13 13:52:08 2017 From: mathoscope at netcourrier.com (Vincent Douce Mathoscope) Date: Wed, 13 Dec 2017 19:52:08 +0100 Subject: [Matplotlib-users] automatic list of r'$2$'... Message-ID: <769F7595-A888-467A-A120-9543BB59DC3B@netcourrier.com> hi i try this : ''' Lx,x,Ly,y=[],xmin,[],ymin Lrx,Lry=[],[] while (x<=xmax): Lx.append(x) Lrx.append("$".join(["r'",str(x),"'"])) x+=1 while (y<=ymax): Ly.append(y) y+=1 ''' but it creates a Lrx list like this : ["r'$-2.5$'", "r'$-1.5$'", "r'$-0.5$'", "r'$0.5$'", "r'$1.5$'", "r'$2.5$'"] and i want to obtain [r'$-2.5$', r'$-1.5$', r'$-0.5$', r'$0.5$', r'$1.5$', r'$2.5$'] i guess that r is an operator to deal with the $..$ expressions but not understand how to fix my definition thanks for your help Vincent ?????????????????????????? Vincent Douce :=: Mathoscope :=: http://mathoscope.xyz 06?13?11?07?26 Bagn?res de Bigorre 65200 -------------- next part -------------- An HTML attachment was scrubbed... URL: From mathoscope at netcourrier.com Wed Dec 13 13:52:18 2017 From: mathoscope at netcourrier.com (Vincent Douce Mathoscope) Date: Wed, 13 Dec 2017 19:52:18 +0100 Subject: [Matplotlib-users] beginnings in matplotlib - grey background Message-ID: hi i got several answers from some of youn particularyl about differences between plt.... and fig.... i did not have time to understand more deeply all of that i spent my time creating the 75 figures of my book some examples : no i will start understandign better all of that i have found how to disable automatic resizing of the figure when for example a curve takes too high values in y lafigure.axis([xmin,xmax,ymin,ymax]) # permet que si qqch d?passe ?a ne perturbe rien ; ouf... now, i have too questions : - how can i avoid the grey color of the figure ? i would like it to be blank the second one in an other mail... ?????????????????????????? Vincent Douce :=: Mathoscope :=: http://mathoscope.xyz 06?13?11?07?26 Bagn?res de Bigorre 65200 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 11_exo_A.png Type: image/png Size: 5357 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 4_exo_C.png Type: image/png Size: 3958 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 11C_corr.png Type: image/png Size: 3073 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 4_exo_B.png Type: image/png Size: 3644 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 4_exo_A.png Type: image/png Size: 4493 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 11_exo_B.png Type: image/png Size: 5695 bytes Desc: not available URL: From vincent.adrien at gmail.com Wed Dec 13 14:05:40 2017 From: vincent.adrien at gmail.com (vincent.adrien at gmail.com) Date: Wed, 13 Dec 2017 11:05:40 -0800 Subject: [Matplotlib-users] numbering of x axis In-Reply-To: References: Message-ID: <8bdd5c9f-da61-ab52-39f3-9a3904a9b229@gmail.com> Hi Vincent, Would ``` fig.tight_layout(pad=0.0) ``` be of any help? See for example http://matplotlib.org/api/_as_gen/matplotlib.figure.Figure.html?#matplotlib.figure.Figure.tight_layout for the parameters that `tight_layout` accepts. Adrien On 12/13/2017 10:50 AM, Vincent Douce Mathoscope wrote: > on these pictures you can see that the x-axe-numbering ?is truncated > i tryed > ''' > fig.tight_layout() ?# to nicely fit the subplot(s) in the figure > ''' > but the picture gets a too large white band around > i would like just to increase the margin under the figure so that the x > numbering be visible > how to do it ? > i spend time on http://matplotlib.org/api/pyplot_api.html but dont > always find what i am looking for > thanks > ? ? ? ? ?????????????????????????? > ? ? ? ? ? ? ? ? ? Vincent Douce > ? ? ? ? ? ? ? ?:=: Mathoscope?:=: > http://mathoscope.xyz > ? ? ? ? ? ? ? ? ?06?13?11?07?26 > ? ? ? ? ? Bagn?res de Bigorre 65200 > > > > > > > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users > From vincent.adrien at gmail.com Wed Dec 13 14:19:57 2017 From: vincent.adrien at gmail.com (vincent.adrien at gmail.com) Date: Wed, 13 Dec 2017 11:19:57 -0800 Subject: [Matplotlib-users] beginnings in matplotlib - grey background In-Reply-To: References: Message-ID: <19043539-64ba-e175-81c0-dccc5a209d28@gmail.com> Vincent, Which version of Matplotlib are you using exactly? Besides, are you applying some peculiar style sheet (i.e. calling something like `plt.style.use(...)` somewhere)? Because I am pretty sure that the default background color for axes is white (or at least not gray...). Anyway, if I am correct you should be able to get a white background by calling ``` ax.set_facecolor("white") ``` on (each) of your Axes instances. You could also define it once for all in (each of) your script(s) by putting ``` plt.rcParams['axes.facecolor'] = "white" ``` before creating the figure(s) Best, Adrien PS: please note that I think that the Figure instance (i.e. `fig`, `lafigure`, etc.) have a similar function/attribute to set the background color at the figure level. On 12/13/2017 10:52 AM, Vincent Douce Mathoscope wrote: > hi > i got several answers from some of youn particularyl about differences > between plt.... and fig.... > i did not have time to understand more deeply all of that > i spent my time creating the 75 figures of my book > some examples : > no i will start understandign better all of that > i have found how to disable automatic resizing of the figure when for > example a curve takes too high values in y > lafigure.axis([xmin,xmax,ymin,ymax]) # permet que si qqch d?passe ?a ne > perturbe rien ; ouf... > now, i have too questions : > - how can i avoid the grey color of the figure ? i would like it to be blank > the second one in an other mail... > > ? ? ? ? ?????????????????????????? > ? ? ? ? ? ? ? ? ? Vincent Douce > ? ? ? ? ? ? ? ?:=: Mathoscope?:=: > http://mathoscope.xyz > ? ? ? ? ? ? ? ? ?06?13?11?07?26 > ? ? ? ? ? Bagn?res de Bigorre 65200 > > > > > > > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users > From vincent.adrien at gmail.com Wed Dec 13 14:41:56 2017 From: vincent.adrien at gmail.com (vincent.adrien at gmail.com) Date: Wed, 13 Dec 2017 11:41:56 -0800 Subject: [Matplotlib-users] automatic list of r'$2$'... In-Reply-To: <769F7595-A888-467A-A120-9543BB59DC3B@netcourrier.com> References: <769F7595-A888-467A-A120-9543BB59DC3B@netcourrier.com> Message-ID: <50ca89de-08de-0611-633c-e2946a223d97@gmail.com> Well, isn't ``` Lx = np.arange(xmin, xmax + 1) Lrx = [r"${}$".format(val) for val in Lx] # aka 'list comprehension' ``` producing what you are looking for? Adrien PS: in the long term, another (more global) approach might be to leverage Matplotlib's formatting capabilities like the ones introduced here: http://matplotlib.org/gallery/ticks_and_spines/tick-formatters.html or https://matplotlib.org/tutorials/text/usetex.html and then simply define the ticks (meaning their value) that you want. On 12/13/2017 10:52 AM, Vincent Douce Mathoscope wrote: > hi > i try this : > ''' > Lx,x,Ly,y=[],xmin,[],ymin > Lrx,Lry=[],[] > while (x<=xmax): > ? ? Lx.append(x) > ? ? Lrx.append("$".join(["r'",str(x),"'"])) > ? ? x+=1 > while (y<=ymax): > ? ? Ly.append(y) > ? ? y+=1 > ''' > but it creates a Lrx list like this : > ["r'$-2.5$'", "r'$-1.5$'", "r'$-0.5$'", "r'$0.5$'", "r'$1.5$'", "r'$2.5$'"] > and i want to obtain > [r'$-2.5$', r'$-1.5$', r'$-0.5$', r'$0.5$', r'$1.5$', r'$2.5$'] > > i guess that r is an operator to deal with the $..$ expressions but not > understand how to fix my definition > > thanks for your help > > Vincent > > ? ? ? ? ?????????????????????????? > ? ? ? ? ? ? ? ? ? Vincent Douce > ? ? ? ? ? ? ? ?:=: Mathoscope?:=: > http://mathoscope.xyz > ? ? ? ? ? ? ? ? ?06?13?11?07?26 > ? ? ? ? ? Bagn?res de Bigorre 65200 > > > > > > > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users > From silva at lma.cnrs-mrs.fr Wed Dec 13 14:42:05 2017 From: silva at lma.cnrs-mrs.fr (Fabrice Silva) Date: Wed, 13 Dec 2017 20:42:05 +0100 Subject: [Matplotlib-users] automatic list of r'$2$'... In-Reply-To: <769F7595-A888-467A-A120-9543BB59DC3B@netcourrier.com> References: <769F7595-A888-467A-A120-9543BB59DC3B@netcourrier.com> Message-ID: <1513194125.1501.5.camel@lma.cnrs-mrs.fr> Le mercredi 13 d?cembre 2017, Vincent Douce Mathoscope a ?crit : > hi > i try this : > ''' > Lx,x,Ly,y=[],xmin,[],ymin > Lrx,Lry=[],[] > while (x<=xmax): > Lx.append(x) > Lrx.append("$".join(["r'",str(x),"'"])) > x+=1 > while (y<=ymax): > Ly.append(y) > y+=1 > ''' > but it creates a Lrx list like this : > ["r'$-2.5$'", "r'$-1.5$'", "r'$-0.5$'", "r'$0.5$'", "r'$1.5$'", > "r'$2.5$'"] > and i want to obtain > [r'$-2.5$', r'$-1.5$', r'$-0.5$', r'$0.5$', r'$1.5$', r'$2.5$'] My suggestion import numpy as np tmpx = [(x, r'$%s' % x) for x in np.arange(xmin, xmax, 1)] Lx, Lrx = zip(*tmpx) Idem for the y stuff. If you prefer to keep the while loop, change the Lrx line to Lrx.append(r"$%s$" %x) or Lrx.append(r"${}$".format(x)) Note that you can add format specification in both solutions. From gina at numfocus.org Fri Dec 15 12:57:18 2017 From: gina at numfocus.org (Gina Helfrich) Date: Fri, 15 Dec 2017 11:57:18 -0600 Subject: [Matplotlib-users] NumFOCUS End-of-Year Fundraising Drive (Matplotlib fiscal sponsor) Message-ID: Hi folks, NumFOCUS, the nonprofit that provides fiscal sponsorship for Matplotlib, kicks off our end of year fundraising drive officially on Monday and would really appreciate your support! Andy Terrel, NumFOCUS Board President, has generously put up the first $5,000 donation as a matching challenge to the community. For every dollar the community donates, Andy will donate a dollar, up to $5k. Please spread the word and use this link to donate: https://www.flipcause.com/secure/cause_pdetails/Mjc2NTg= Thanks so much for your support of Matplotlib and NumFOCUS! Cheers, Gina -- Dr. Gina Helfrich Communications Director, NumFOCUS -------------- next part -------------- An HTML attachment was scrubbed... URL: From tcaswell at gmail.com Fri Dec 15 18:05:59 2017 From: tcaswell at gmail.com (Thomas Caswell) Date: Fri, 15 Dec 2017 23:05:59 +0000 Subject: [Matplotlib-users] SOLVED: figures from ipython within emacs on Windows In-Reply-To: References: Message-ID: Great to hear that you got this sorted out! Tom On Mon, Dec 11, 2017, 12:36 Strozzi, David J. wrote: > Hi, > > > > This is an issue I bugged several people / lists about previously, which > has a solution. Thought I?d share it. > > > > I am running the GNU Win32 native build of emacs (ver. 25.3), on Windows 7 > (not a cygwin or X11 version). I?m one of those ?emacs is an operating > system? people, and like running Python shells within emacs. The problem > was getting matplotlib figures to work ? the figure window would either say > ?not responding?, not render, freeze, or somehow misbehave. > > > > Someone involved in the elpy package (for python on emacs) gave the > following solution, which works for me using the TkAgg or Qt5Agg backends: > use jupyter console instead of ipython. The whole thing is murky to me, > but I thought that nowadays ipython is the Python-specific ?piece? / > interface to jupyter console. Either way, it seems like jupyter console > just gives me ipython, but apparently in a way that the event loop or > whatever with figure windows is ?happy?. > > > > So Add this to your .emacs: > > (setq python-shell-interpreter "jupyter" > > python-shell-interpreter-args "console --simple-prompt") > > (setq python-shell-completion-native-enable nil) > > > > Then M-x run-python, then pylab, then figure(1) etc. and it should work. > > > > Hope this helps more people use emacs as their Windows Python IDE. > > > > Dave > _______________________________________________ > 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 Sat Dec 16 03:52:10 2017 From: mathoscope at netcourrier.com (Vincent Douce Mathoscope) Date: Sat, 16 Dec 2017 09:52:10 +0100 Subject: [Matplotlib-users] numbering of x axis In-Reply-To: <8bdd5c9f-da61-ab52-39f3-9a3904a9b229@gmail.com> References: <8bdd5c9f-da61-ab52-39f3-9a3904a9b229@gmail.com> Message-ID: <3D3004AD-D537-426D-A940-EB886487C25F@netcourrier.com> thanks Adrien wonderful Vincent > Le 13 d?c. 2017 ? 20:05, vincent.adrien at gmail.com a ?crit : > > Hi Vincent, > > Would > ``` > fig.tight_layout(pad=0.0) > ``` > be of any help? See for example http://matplotlib.org/api/_as_gen/matplotlib.figure.Figure.html?#matplotlib.figure.Figure.tight_layout for the parameters that `tight_layout` accepts. > > Adrien > > On 12/13/2017 10:50 AM, Vincent Douce Mathoscope wrote: >> on these pictures you can see that the x-axe-numbering is truncated >> i tryed >> ''' >> fig.tight_layout() # to nicely fit the subplot(s) in the figure >> ''' >> but the picture gets a too large white band around >> i would like just to increase the margin under the figure so that the x numbering be visible >> how to do it ? >> i spend time on http://matplotlib.org/api/pyplot_api.html but dont always find what i am looking for >> thanks >> ?????????????????????????? >> Vincent Douce >> :=: Mathoscope :=: >> http://mathoscope.xyz >> 06?13?11?07?26 >> Bagn?res de Bigorre 65200 >> _______________________________________________ >> Matplotlib-users mailing list >> Matplotlib-users at python.org >> https://mail.python.org/mailman/listinfo/matplotlib-users > ?????????????????????????? Vincent Douce :=: Mathoscope :=: http://mathoscope.xyz 06?13?11?07?26 Bagn?res de Bigorre 65200 From heiland at iu.edu Sat Dec 16 16:54:37 2017 From: heiland at iu.edu (Heiland, Randy) Date: Sat, 16 Dec 2017 21:54:37 +0000 Subject: [Matplotlib-users] NxM subplots, tight, suptitle Message-ID: <7381CEE7-2B14-4C45-BB21-E8AE84B8EC07@iu.edu> Any advice for wanting to do a grid of subplots, with fig.tight_layout(), and with "extra? space at the top for a suptitle? As this simple script demonstrates, there isn?t really any space left at the top after doing tight_layout: import matplotlib.pyplot as plt fig, axes = plt.subplots(nrows=1, ncols=2, figsize=(12,4)) ax0, ax1 = axes.flatten() fig.tight_layout() plt.suptitle('This is a somewhat long figure title', y=0.99, fontsize=12) plt.show() thanks! Randy From jr at sun.ac.za Sun Dec 17 03:43:05 2017 From: jr at sun.ac.za (Johann Rohwer) Date: Sun, 17 Dec 2017 10:43:05 +0200 Subject: [Matplotlib-users] NxM subplots, tight, suptitle In-Reply-To: <7381CEE7-2B14-4C45-BB21-E8AE84B8EC07@iu.edu> References: <7381CEE7-2B14-4C45-BB21-E8AE84B8EC07@iu.edu> Message-ID: On 16/12/17 23:54, Heiland, Randy wrote: Any advice for wanting to do a grid of subplots, with fig.tight_layout(), and with "extra? space at the top for a suptitle? As this simple script demonstrates, there isn?t really any space left at the top after doing tight_layout: import matplotlib.pyplot as plt fig, axes = plt.subplots(nrows=1, ncols=2, figsize=(12,4)) ax0, ax1 = axes.flatten() fig.tight_layout() plt.suptitle('This is a somewhat long figure title', y=0.99, fontsize=12) plt.show() You can adjust the space individually for left, top, right, and bottom, as well as horizontally and vertically between the subplots, with fig.subplots_adjust(). call signature:: subplots_adjust(left=None, bottom=None, right=None, top=None, wspace=None, hspace=None) The parameter meanings (and suggested defaults) are:: left = 0.125 # the left side of the subplots of the figure right = 0.9 # the right side of the subplots of the figure bottom = 0.1 # the bottom of the subplots of the figure top = 0.9 # the top of the subplots of the figure wspace = 0.2 # the amount of width reserved for blank space between subplots hspace = 0.2 # the amount of height reserved for white space between subplots The actual defaults are controlled by the rc file File: /usr/lib/python2.7/dist-packages/matplotlib/pyplot.py Type: function The integrity and confidentiality of this email is governed by these terms / Die integriteit en vertroulikheid van hierdie e-pos word deur die volgende bepalings gere?l. http://www.sun.ac.za/emaildisclaimer -------------- next part -------------- An HTML attachment was scrubbed... URL: From heiland at iu.edu Sun Dec 17 09:07:19 2017 From: heiland at iu.edu (Heiland, Randy) Date: Sun, 17 Dec 2017 14:07:19 +0000 Subject: [Matplotlib-users] NxM subplots, tight, suptitle In-Reply-To: References: <7381CEE7-2B14-4C45-BB21-E8AE84B8EC07@iu.edu> Message-ID: <9D96F73D-EDDE-4ED4-8B77-72370B6DD76B@iu.edu> On Dec 17, 2017, at 3:43 AM, Johann Rohwer > wrote: On 16/12/17 23:54, Heiland, Randy wrote: Any advice for wanting to do a grid of subplots, with fig.tight_layout(), and with "extra? space at the top for a suptitle? As this simple script demonstrates, there isn?t really any space left at the top after doing tight_layout: import matplotlib.pyplot as plt fig, axes = plt.subplots(nrows=1, ncols=2, figsize=(12,4)) ax0, ax1 = axes.flatten() fig.tight_layout() plt.suptitle('This is a somewhat long figure title', y=0.99, fontsize=12) plt.show() You can adjust the space individually for left, top, right, and bottom, as well as horizontally and vertically between the subplots, with fig.subplots_adjust(). call signature:: subplots_adjust(left=None, bottom=None, right=None, top=None, wspace=None, hspace=None) The parameter meanings (and suggested defaults) are:: left = 0.125 # the left side of the subplots of the figure right = 0.9 # the right side of the subplots of the figure bottom = 0.1 # the bottom of the subplots of the figure top = 0.9 # the top of the subplots of the figure wspace = 0.2 # the amount of width reserved for blank space between subplots hspace = 0.2 # the amount of height reserved for white space between subplots The actual defaults are controlled by the rc file File: /usr/lib/python2.7/dist-packages/matplotlib/pyplot.py Type: function The integrity and confidentiality of this email is governed by these terms / Die integriteit en vertroulikheid van hierdie e-pos word deur die volgende bepalings gere?l. http://www.sun.ac.za/emaildisclaimer _______________________________________________ Thanks very much, Johann. I?d actually played around with subplots_adjust previously and gave up. However, your email nudged me back to it and I do indeed have pretty good results now. And for the record, one would use this *instead* of the tight_layout, not in addition to it. Randy -------------- next part -------------- An HTML attachment was scrubbed... URL: From pskeshu at gmail.com Wed Dec 20 02:12:04 2017 From: pskeshu at gmail.com (Kesavan Subburam) Date: Wed, 20 Dec 2017 12:42:04 +0530 Subject: [Matplotlib-users] Reds and Greens colormap starting with black Message-ID: Hi matplotlib users, I was wondering if anyone knows a way to modify the Reds and Greens colormap such that the lower end of the colormaps is not a mixture of white and red or green, but black and red or green respectively. I tried to do this by making the image RGB, with my data only in the red or green channel, but matplotlib only supports int8 but my images have higher dynamic range, and they lose resolution if I cast them from int16 to int8. Here's the code: def color(img): x, y = img.shape c = np.zeros((x, y, 3), dtype=np.uint8) c[:, :, 0] = img return c Thank you and best regards, Kesavan -------------- next part -------------- An HTML attachment was scrubbed... URL: From efiring at hawaii.edu Thu Dec 21 16:35:54 2017 From: efiring at hawaii.edu (Eric Firing) Date: Thu, 21 Dec 2017 11:35:54 -1000 Subject: [Matplotlib-users] Reds and Greens colormap starting with black In-Reply-To: References: Message-ID: Kesavan, Check out the BlueRed1 colormap near the bottom of https://matplotlib.org/gallery/images_contours_and_fields/custom_cmap.html?highlight=linearsegmentedcolormap. It is shown in the upper-left panel of the figure at the very bottom. It is not exactly what you are asking for, but it illustrates how to make simple colormaps that shade into black. Alternatively, for a good colormap tool, see https://github.com/matplotlib/viscm. You should be able to get a much better result with this than with simple linear ramps in RGB space. Eric On 2017/12/19 9:12 PM, Kesavan Subburam wrote: > Hi matplotlib users, > > I was wondering if anyone knows a way to modify the Reds and Greens > colormap such that the lower end of the colormaps is not a mixture of > white and red or green, but black and red or green respectively. > > I tried to do this by making the image RGB, with my data only in the red > or green channel, but matplotlib only supports int8 but my images have > higher dynamic range, and they lose resolution if I cast them from int16 > to int8. Here's the code: > > def color(img): > ??? x, y = img.shape > ??? c = np.zeros((x, y, 3), dtype=np.uint8) > ??? c[:, :, 0] = img > ??? return c > > Thank you and best regards, > Kesavan > > > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users > From admin at ndws.com Fri Dec 22 10:58:30 2017 From: admin at ndws.com (admin at ndws.com) Date: Fri, 22 Dec 2017 10:58:30 -0500 (EST) Subject: [Matplotlib-users] GOES projection corners In-Reply-To: <1513957856.732226751@apps.rackspace.com> References: <1513957275.03672374@apps.rackspace.com> <1513957856.732226751@apps.rackspace.com> Message-ID: <1513958310.402520868@apps.rackspace.com> Sorry if this is a dup.. Hi, trying to overlay maps on the new GOES16 satellite images from the raw data direct from the satellite. They send metadata indicating the corners of the image, but they send ULcrnr and LRcrnr instead of what maplotlib wants, LLcrne and URcrnr. Any suggestion on how to get the numbers maplotlib wants, or use the ones sent? Thanks! Ray From admin at ndws.com Fri Dec 22 10:50:56 2017 From: admin at ndws.com (admin at ndws.com) Date: Fri, 22 Dec 2017 10:50:56 -0500 (EST) Subject: [Matplotlib-users] GOES projection corners In-Reply-To: <1513957275.03672374@apps.rackspace.com> References: <1513957275.03672374@apps.rackspace.com> Message-ID: <1513957856.732226751@apps.rackspace.com> Hi, trying to overlay maps on the new GOES16 satellite images from the raw data direct from the satellite. They send metadata indicating the corners of the image, but they send ULcrnr and LRcrnr instead of what maplotlib wants, LLcrne and URcrnr. Any suggestion on how to get the numbers maplotlib wants, or use the ones sent? Thanks! Ray From jfoxrabinovitz at gmail.com Fri Dec 22 11:05:22 2017 From: jfoxrabinovitz at gmail.com (Joseph Fox-Rabinovitz) Date: Fri, 22 Dec 2017 11:05:22 -0500 Subject: [Matplotlib-users] GOES projection corners In-Reply-To: <1513958310.402520868@apps.rackspace.com> References: <1513957275.03672374@apps.rackspace.com> <1513957856.732226751@apps.rackspace.com> <1513958310.402520868@apps.rackspace.com> Message-ID: Congrats on getting the GOES-16 imagery. It's still (and probably always will be) GOES-R to me :) On Fri, Dec 22, 2017 at 10:58 AM, wrote: > Sorry if this is a dup.. > > Hi, trying to overlay maps on the new GOES16 satellite images from the raw > data > direct from the satellite. > > They send metadata indicating the corners of the image, but they send > ULcrnr and > LRcrnr instead of what maplotlib wants, LLcrne and URcrnr. > > Any suggestion on how to get the numbers maplotlib wants, or use the ones > sent? > > Thanks! > > Ray > > > > > > _______________________________________________ > 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 admin at ndws.com Fri Dec 22 11:19:36 2017 From: admin at ndws.com (weather01089) Date: Fri, 22 Dec 2017 09:19:36 -0700 (MST) Subject: [Matplotlib-users] GOES projection corners In-Reply-To: References: <1513957856.732226751@apps.rackspace.com> <1513958310.402520868@apps.rackspace.com> Message-ID: <1513959576834-0.post@n5.nabble.com> Thanks! Images are amazing. I cheated and put the corners in for the US image from the NWS display program, and the map plots fine. But they have "mesoscale" images with dynamic locations, so you need to input those with them. -- Sent from: http://matplotlib.1069221.n5.nabble.com/matplotlib-users-f3.html From admin at ndws.com Fri Dec 22 11:24:17 2017 From: admin at ndws.com (weather01089) Date: Fri, 22 Dec 2017 09:24:17 -0700 (MST) Subject: [Matplotlib-users] GOES projection corners In-Reply-To: <1513959576834-0.post@n5.nabble.com> References: <1513957856.732226751@apps.rackspace.com> <1513958310.402520868@apps.rackspace.com> <1513959576834-0.post@n5.nabble.com> Message-ID: <1513959857380-0.post@n5.nabble.com> Sample image, Northeast "Mesoscale", 50% resized. -- Sent from: http://matplotlib.1069221.n5.nabble.com/matplotlib-users-f3.html From admin at ndws.com Fri Dec 22 11:42:56 2017 From: admin at ndws.com (weather01089) Date: Fri, 22 Dec 2017 09:42:56 -0700 (MST) Subject: [Matplotlib-users] GOES projection corners In-Reply-To: <1513959857380-0.post@n5.nabble.com> References: <1513957856.732226751@apps.rackspace.com> <1513958310.402520868@apps.rackspace.com> <1513959576834-0.post@n5.nabble.com> <1513959857380-0.post@n5.nabble.com> Message-ID: <1513960976359-0.post@n5.nabble.com> Just so you can see, for example, this is the CONUS image of course GOES projection -152 is the UPPER LEFT corner of course, in the pacific. Ray -- Sent from: http://matplotlib.1069221.n5.nabble.com/matplotlib-users-f3.html From mathoscope at netcourrier.com Sat Dec 23 16:01:32 2017 From: mathoscope at netcourrier.com (Vincent Douce Mathoscope) Date: Sat, 23 Dec 2017 22:01:32 +0100 Subject: [Matplotlib-users] automatic list of r'$2$'... In-Reply-To: <1513194125.1501.5.camel@lma.cnrs-mrs.fr> References: <769F7595-A888-467A-A120-9543BB59DC3B@netcourrier.com> <1513194125.1501.5.camel@lma.cnrs-mrs.fr> Message-ID: <1EDAF8CF-4C04-4E78-B0E1-012A042FD096@netcourrier.com> thanks Fabrice the problems seems to be : i get for Lrx : '$0', '$1', '$2' instead of r'$0', r'$1', r'$2' the "r" disappears as the r is not in the chain is seems not to be considered by python as an element to keep ? Vincent > Le 13 d?c. 2017 ? 20:42, Fabrice Silva a ?crit : > > Le mercredi 13 d?cembre 2017, Vincent Douce Mathoscope a ?crit : >> hi >> i try this : >> ''' >> Lx,x,Ly,y=[],xmin,[],ymin >> Lrx,Lry=[],[] >> while (x<=xmax): >> Lx.append(x) >> Lrx.append("$".join(["r'",str(x),"'"])) >> x+=1 >> while (y<=ymax): >> Ly.append(y) >> y+=1 >> ''' >> but it creates a Lrx list like this : >> ["r'$-2.5$'", "r'$-1.5$'", "r'$-0.5$'", "r'$0.5$'", "r'$1.5$'", >> "r'$2.5$'"] >> and i want to obtain >> [r'$-2.5$', r'$-1.5$', r'$-0.5$', r'$0.5$', r'$1.5$', r'$2.5$'] > > My suggestion > > import numpy as np > tmpx = [(x, r'$%s' % x) for x in np.arange(xmin, xmax, 1)] > Lx, Lrx = zip(*tmpx) > > Idem for the y stuff. > If you prefer to keep the while loop, change the Lrx line to > Lrx.append(r"$%s$" %x) > or > Lrx.append(r"${}$".format(x)) > Note that you can add format specification in both solutions. > > > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users ?????????????????????????? Vincent Douce :=: Mathoscope :=: http://mathoscope.xyz 06?13?11?07?26 Bagn?res de Bigorre 65200 From projetmbc at gmail.com Sat Dec 23 16:34:59 2017 From: projetmbc at gmail.com (Christophe BAL (via GMAIL)) Date: Sat, 23 Dec 2017 22:34:59 +0100 Subject: [Matplotlib-users] automatic list of r'$2$'... In-Reply-To: <1EDAF8CF-4C04-4E78-B0E1-012A042FD096@netcourrier.com> References: <769F7595-A888-467A-A120-9543BB59DC3B@netcourrier.com> <1513194125.1501.5.camel@lma.cnrs-mrs.fr> <1EDAF8CF-4C04-4E78-B0E1-012A042FD096@netcourrier.com> Message-ID: <91b0196a-ad66-4f62-4cb6-d8106c0b659e@gmail.com> Hello. One question: why do you use raw strings ? One suggestion: with Python 3.6, you can use *fr"${x}$"*? or simply *f"${x}$"*? if you don't really need raw strings. Le 23/12/2017 ? 22:01, Vincent Douce Mathoscope a ?crit?: > thanks Fabrice > the problems seems to be : > i get for Lrx : > '$0', '$1', '$2' > instead of > r'$0', r'$1', r'$2' > the "r" disappears > as the r is not in the chain is seems not to be considered by python as an element to keep ? > Vincent > >> Le 13 d?c. 2017 ? 20:42, Fabrice Silva a ?crit : >> >> Le mercredi 13 d?cembre 2017, Vincent Douce Mathoscope a ?crit : >>> hi >>> i try this : >>> ''' >>> Lx,x,Ly,y=[],xmin,[],ymin >>> Lrx,Lry=[],[] >>> while (x<=xmax): >>> Lx.append(x) >>> Lrx.append("$".join(["r'",str(x),"'"])) >>> x+=1 >>> while (y<=ymax): >>> Ly.append(y) >>> y+=1 >>> ''' >>> but it creates a Lrx list like this : >>> ["r'$-2.5$'", "r'$-1.5$'", "r'$-0.5$'", "r'$0.5$'", "r'$1.5$'", >>> "r'$2.5$'"] >>> and i want to obtain >>> [r'$-2.5$', r'$-1.5$', r'$-0.5$', r'$0.5$', r'$1.5$', r'$2.5$'] >> My suggestion >> >> import numpy as np >> tmpx = [(x, r'$%s' % x) for x in np.arange(xmin, xmax, 1)] >> Lx, Lrx = zip(*tmpx) >> >> Idem for the y stuff. >> If you prefer to keep the while loop, change the Lrx line to >> Lrx.append(r"$%s$" %x) >> or >> Lrx.append(r"${}$".format(x)) >> Note that you can add format specification in both solutions. >> >> >> _______________________________________________ >> Matplotlib-users mailing list >> Matplotlib-users at python.org >> https://mail.python.org/mailman/listinfo/matplotlib-users > ?????????????????????????? > Vincent Douce > :=: Mathoscope :=: > http://mathoscope.xyz > 06?13?11?07?26 > Bagn?res de Bigorre 65200 > > > > > > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users -- Christophe BAL Enseignant Agr?g? de Math?matiques Programmeur Python Amateur -------------- next part -------------- An HTML attachment was scrubbed... URL: From mathoscope at netcourrier.com Mon Dec 25 05:04:21 2017 From: mathoscope at netcourrier.com (Vincent Douce Mathoscope) Date: Mon, 25 Dec 2017 11:04:21 +0100 Subject: [Matplotlib-users] 3D Message-ID: <52B3299A-BE7B-487B-9C9D-B9CD836270EF@netcourrier.com> hi happy christmas ! i have some projects with 3D impressions and i am wondering which would be the best solution in order to use my some of my equations still written in matplotlib what would you advise me to create some 3D drawings ? i need the functionality to export my pictures in STL format thanks ?????????????????????????? Vincent Douce :=: Mathoscope :=: http://mathoscope.xyz 06?13?11?07?26 Bagn?res de Bigorre 65200 -------------- next part -------------- An HTML attachment was scrubbed... URL: From mathoscope at netcourrier.com Mon Dec 25 15:48:09 2017 From: mathoscope at netcourrier.com (Vincent Douce Mathoscope) Date: Mon, 25 Dec 2017 21:48:09 +0100 Subject: [Matplotlib-users] empty scatter Message-ID: <6A2BBF59-EF84-4CCF-84FC-5C761BE94C69@netcourrier.com> hi i can not find on the documentation of matplotlib if a scatter can be empty i have made a program that calculates the position of the finger on a guitar : https://mathoscope.wordpress.com/2017/12/25/mathematiques-pour-la-guitare/ you can see the source code here by clicking on "programme.txt" http://mathoscope.ouvaton.org/mathoscope_xyz/Informatique/distributeur.php?mot=gammes i would like the grey scaters on the left (coresponding to the chords played withou pressing them or "cordes ? vide") to be black but empty like a "O" of course i can calculate a circle... do you think there is a means to have an empty scatter ? ?????????????????????????? Vincent Douce :=: Mathoscope :=: http://mathoscope.xyz 06?13?11?07?26 Bagn?res de Bigorre 65200 -------------- next part -------------- An HTML attachment was scrubbed... URL: From pmhobson at gmail.com Mon Dec 25 17:38:02 2017 From: pmhobson at gmail.com (Paul Hobson) Date: Mon, 25 Dec 2017 14:38:02 -0800 Subject: [Matplotlib-users] empty scatter In-Reply-To: <6A2BBF59-EF84-4CCF-84FC-5C761BE94C69@netcourrier.com> References: <6A2BBF59-EF84-4CCF-84FC-5C761BE94C69@netcourrier.com> Message-ID: Vincent, I think you want to use `plot` with no line, like so: from matplotlib import pyplot fig, ax = pyplot.subplots() ax.plot([1, 2, 3], [3, 6, 1], linestyle='none', marker='o', markeredgecolor='k', markerfacecoloir='none') On Mon, Dec 25, 2017 at 12:48 PM, Vincent Douce Mathoscope < mathoscope at netcourrier.com> wrote: > hi > i can not find on the documentation of matplotlib if a scatter can be empty > i have made a program that calculates the position of the finger on a > guitar : > https://mathoscope.wordpress.com/2017/12/25/mathematiques-pour-la-guitare/ > you can see the source code here by clicking on "programme.txt" > http://mathoscope.ouvaton.org/mathoscope_xyz/Informatique/ > distributeur.php?mot=gammes > i would like the grey scaters on the left (coresponding to the chords > played withou pressing them or "cordes ? vide") to be black but empty like > a "O" > of course i can calculate a circle... > do you think there is a means to have an empty scatter ? > ?????????????????????????? > Vincent Douce > :=: Mathoscope :=: > http://mathoscope.xyz > 06?13?11?07?26 > Bagn?res de Bigorre 65200 > > > > > > _______________________________________________ > 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 Tue Dec 26 03:03:07 2017 From: mathoscope at netcourrier.com (Vincent Douce Mathoscope) Date: Tue, 26 Dec 2017 09:03:07 +0100 Subject: [Matplotlib-users] empty scatter In-Reply-To: References: <6A2BBF59-EF84-4CCF-84FC-5C761BE94C69@netcourrier.com> Message-ID: thank you very much Paul it works fine following your help and the documentation about .plot, i have found this that i will use : ''' #full circles lafigure.scatter([1, 2, 3], [2, 5, 0], 25, color ='black') #empty circles lafigure.plot([1, 2, 3], [3, 6, 1], linestyle='none', marker='$\circ$', markeredgecolor='k')#, ''' i have also, for a purpose of homogeneity in the code, tried to use $\bullet$ as a marker but it has produced an error thanks Vincent > Le 25 d?c. 2017 ? 23:38, Paul Hobson a ?crit : > > Vincent, > > I think you want to use `plot` with no line, like so: > > > from matplotlib import pyplot > fig, ax = pyplot.subplots() > ax.plot([1, 2, 3], [3, 6, 1], > linestyle='none', marker='o', > markeredgecolor='k', > markerfacecoloir='none') > > On Mon, Dec 25, 2017 at 12:48 PM, Vincent Douce Mathoscope > wrote: > hi > i can not find on the documentation of matplotlib if a scatter can be empty > i have made a program that calculates the position of the finger on a guitar : > https://mathoscope.wordpress.com/2017/12/25/mathematiques-pour-la-guitare/ > you can see the source code here by clicking on "programme.txt" > http://mathoscope.ouvaton.org/mathoscope_xyz/Informatique/distributeur.php?mot=gammes > i would like the grey scaters on the left (coresponding to the chords played withou pressing them or "cordes ? vide") to be black but empty like a "O" > of course i can calculate a circle... > do you think there is a means to have an empty scatter ? > ?????????????????????????? > Vincent Douce > :=: Mathoscope :=: > http://mathoscope.xyz > 06?13?11?07?26 > Bagn?res de Bigorre 65200 > > > > > > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users > > ?????????????????????????? Vincent Douce :=: Mathoscope :=: http://mathoscope.xyz 06?13?11?07?26 Bagn?res de Bigorre 65200 -------------- next part -------------- An HTML attachment was scrubbed... URL: