From madicken.munk at gmail.com Mon Jun 1 01:56:57 2020 From: madicken.munk at gmail.com (Madicken Munk) Date: Mon, 1 Jun 2020 00:56:57 -0500 Subject: [Matplotlib-users] Extension: June 05 Deadline for the 2020 John Hunter Excellence in Plotting Contest! In-Reply-To: References: Message-ID: Hi all, We are extending the deadline of the John Hunter Excellence in Plotting Contest to Friday, June 05. We look forward to receiving your submissions to the contest. John Hunter Excellence in Plotting Contest Co-Chairs Madicken Munk Nelle Varoquaux On Thu, May 28, 2020 at 12:23 AM Madicken Munk wrote: > 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 ndbecker2 at gmail.com Wed Jun 10 14:15:36 2020 From: ndbecker2 at gmail.com (Neal Becker) Date: Wed, 10 Jun 2020 14:15:36 -0400 Subject: [Matplotlib-users] host_subplot figure argument Message-ID: I tried to use host_subplot with a figure argument. Why does this fail? ------------------------ import matplotlib.pyplot as plt fig,ax = plt.subplots() host = host_subplot(figure=fig) ------------------------ ValueError: Illegal argument(s) to subplot: () -------------- next part -------------- An HTML attachment was scrubbed... URL: From jerzy.karczmarczuk at unicaen.fr Wed Jun 10 16:36:09 2020 From: jerzy.karczmarczuk at unicaen.fr (Jerzy Karczmarczuk) Date: Wed, 10 Jun 2020 22:36:09 +0200 Subject: [Matplotlib-users] host_subplot figure argument In-Reply-To: References: Message-ID: <51920951-21cd-0369-d301-85e5ea788f1b@unicaen.fr> Le 10/06/2020 ? 20:15, Neal Becker a ?crit?: > I tried to use host_subplot with a figure argument. *Why does this fail?* > ------------------------ > import matplotlib.pyplot as plt > fig,ax = plt.subplots() > host = host_subplot(figure=fig)? ##/of course, import is missing... (JK)/ > ------------------------ > ValueError: Illegal argument(s) to subplot: () */Please, why don't you read the docs?... /*/Where have you found //the fig parameter?/*/ /* 1. You never mention the parasite axes etc., so perhaps simple *add_subplot* might be convenient. 2. Anyway, both, *subplot*, and *from mpl_toolkits.axes_grid1 import **host_subplot *share the geometry parameters, say 221 (columns, rows, which). 3. Look e.g., here: *https://matplotlib.org/gallery/axisartist/demo_parasite_axes2.html?highlight=host_subplot *?? or here:* https://stackoverflow.com/questions/33396190/what-are-the-parameters-of-host-subplot-in-matplotlibs-mpl-toolkits-axes-grid1 * And most probably a dozen more. Jerzy Karczmarczuk /Caen, France/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From pmhobson at gmail.com Wed Jun 10 19:03:20 2020 From: pmhobson at gmail.com (Paul Hobson) Date: Wed, 10 Jun 2020 16:03:20 -0700 Subject: [Matplotlib-users] host_subplot figure argument In-Reply-To: <51920951-21cd-0369-d301-85e5ea788f1b@unicaen.fr> References: <51920951-21cd-0369-d301-85e5ea788f1b@unicaen.fr> Message-ID: Hey Jerzy, The "figure" parameter to host_subplot is documented here: https://matplotlib.org/api/_as_gen/mpl_toolkits.axes_grid1.parasite_axes.host_subplot.html#mpl_toolkits.axes_grid1.parasite_axes.host_subplot Based on that page, I think it's safe to say that the OP did read the docs. It's just not at all clear that additional Axes creation args need to be passed. -Paul On Wed, Jun 10, 2020 at 1:52 PM Jerzy Karczmarczuk < jerzy.karczmarczuk at unicaen.fr> wrote: > Le 10/06/2020 ? 20:15, Neal Becker a ?crit : > > I tried to use host_subplot with a figure argument. *Why does this fail?* > ------------------------ > import matplotlib.pyplot as plt > fig,ax = plt.subplots() > host = host_subplot(figure=fig) ##* of course, import is missing... (JK)* > ------------------------ > ValueError: Illegal argument(s) to subplot: () > > > *Please, why don't you read the docs?... **Where have you found **the fig > parameter?* > > 1. You never mention the parasite axes etc., so perhaps simple > *add_subplot* might be convenient. > 2. Anyway, both, *subplot*, and > *from mpl_toolkits.axes_grid1 import * > *host_subplot *share the geometry parameters, say 221 (columns, rows, > which). > 3. Look e.g., here: > > > *https://matplotlib.org/gallery/axisartist/demo_parasite_axes2.html?highlight=host_subplot > > * or here: > > * > https://stackoverflow.com/questions/33396190/what-are-the-parameters-of-host-subplot-in-matplotlibs-mpl-toolkits-axes-grid1 > > * > > And most probably a dozen more. > > Jerzy Karczmarczuk > /Caen, France/ > > > > > _______________________________________________ > 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 jerzy.karczmarczuk at unicaen.fr Thu Jun 11 04:42:15 2020 From: jerzy.karczmarczuk at unicaen.fr (Jerzy Karczmarczuk) Date: Thu, 11 Jun 2020 10:42:15 +0200 Subject: [Matplotlib-users] host_subplot figure argument In-Reply-To: References: <51920951-21cd-0369-d301-85e5ea788f1b@unicaen.fr> Message-ID: <5c39d7be-61b3-59b3-720e-f9b585b35d0d@unicaen.fr> On 11/06/2020 1:03 am, Paul Hobson corrects my answer to Neal Baker: [[[ /Where have you found //the fig parameter? ]]]/*/ /* */ /* > The "figure" parameter to host_subplot is documented here: > https://matplotlib.org/api/_as_gen/mpl_toolkits.axes_grid1.parasite_axes.host_subplot.html#mpl_toolkits.axes_grid1.parasite_axes.host_subplot > > Based on that page, I think it's safe to say that the OP did read the > docs. It's just not at all clear that additional Axes creation args > need to be passed. Yes, sorry for being superficial ad a bit /ad hominem/.? Thank you very much for pointing this out, sincerely. But "reading the docs" rarely can be reduced to reading just one concerned page. In the page you refer to, *there are others arguments*, passed to an Axis, where - as mentioned - *subplot will be added*. Perhaps it is not clear if somebody has never seen subplots before, but this is a question of common sense... Subplots are very thorougly discussed in many places. If somebody knows anything about the subplots, he/she should know that it must be /*positioned*/ somehow, isn't it? (The Figure arg is redundant, though, as the default is there). Best regards. Jerzy Karczmarczuk -- 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 quantum.analyst at gmail.com Fri Jun 19 03:46:12 2020 From: quantum.analyst at gmail.com (Elliott Sales de Andrade) Date: Fri, 19 Jun 2020 03:46:12 -0400 Subject: [Matplotlib-users] [ANN] Matplotlib 3.2.2 release Message-ID: <679417de-d510-61d5-fd87-bc8a9729e230@gmail.com> Hi all, Matplotlib 3.2.2 was released yesterday. ??? This is the second bugfix release of the 3.2.x series. ??? This release contains several critical bug-fixes: ??? ???? - support fractional HiDPI scaling with Qt backends ???? - support new Python and fix syntax errors in legacy Python ???? - support new Qt 5 and fix support for Qt 4 ???? - fix animation writer fallback ???? - fix figure resizing ???? - fix handling of large arcs ???? - fix issues with tight layout ???? - fix saving figures after closing windows or under certain size conditions ???? - fix scatter when specifying a single color ???? - fix several memory leaks ???? - fix unexpected autoscaling behavior ???? - fix various issues with usetex ???? - various minor bug and documentation fixes As a reminder, this was signed by my GPG key. The fingerprint is: 23CA B59E 3332 F94D 26BE F037 8D86 E7FA E5EB 0C10 and it is also used to sign this message. -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 870 bytes Desc: OpenPGP digital signature URL: From jslavin at cfa.harvard.edu Fri Jun 19 09:31:08 2020 From: jslavin at cfa.harvard.edu (Slavin, Jonathan) Date: Fri, 19 Jun 2020 09:31:08 -0400 Subject: [Matplotlib-users] hanging after import of pyplot Message-ID: Hi all, I've had this strange behavior occur, now for the second time, that I'm hoping someone can help me diagnose. What happens is that if I import pyplot, e.g. like import matplotlib.pyplot as plt the prompt becomes completely unresponsive. I can't even get out of it by ctrl-C or ctrl-Z. I have to actually kill the process. This happens in all my environments (which includes python 2.7, 3.6 and 3.7 and anaconda 2 and anaconda 3). Last time this happened it resolved itself somehow by itself. Because it happens with different versions of python, ipython, and matplotlib, I'm thinking that it must have to do with the backend. Any help would be appreciated. Thanks, Jon -- Jonathan D. Slavin Astrophysicist - High Energy Astrophysics Division Center for Astrophysics | Harvard & Smithsonian Office: (617) 496-7981 | Cell: (781) 363-0035 60 Garden Street | MS 83 | Cambridge, MA 02138 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tcaswell at gmail.com Fri Jun 19 10:21:20 2020 From: tcaswell at gmail.com (Thomas Caswell) Date: Fri, 19 Jun 2020 10:21:20 -0400 Subject: [Matplotlib-users] hanging after import of pyplot In-Reply-To: References: Message-ID: If you do import matplotlib print(matplotlib.__version__) print(matplotlib.get_backend()) what do you get? Are you using IPython or the plain python prompt? Does doing `%matplotlib` before importing pyplot help? What OS? What terminal emulator? Does using `matplotlib.use('agg')` (no GUI, but should import) or `matplotlib.use('tkagg')` before you import pyplot change anything? Have you used `pip install --user` or `sudo pip install `? That this happens across all your environments on the same machine is a bit confusing as even if it were related to the backend the GUI toolkits should be sufficiently self-contained to the environment to not affect each other. Tom On Fri, Jun 19, 2020 at 9:31 AM Slavin, Jonathan wrote: > Hi all, > > I've had this strange behavior occur, now for the second time, that I'm > hoping someone can help me diagnose. What happens is that if I import > pyplot, e.g. like > import matplotlib.pyplot as plt > the prompt becomes completely unresponsive. I can't even get out of it by > ctrl-C or ctrl-Z. I have to actually kill the process. This happens in all > my environments (which includes python 2.7, 3.6 and 3.7 and anaconda 2 and > anaconda 3). Last time this happened it resolved itself somehow by itself. > Because it happens with different versions of python, ipython, and > matplotlib, I'm thinking that it must have to do with the backend. Any help > would be appreciated. > > Thanks, > Jon > > -- > Jonathan D. Slavin > Astrophysicist - High Energy Astrophysics Division > Center for Astrophysics | Harvard & Smithsonian > Office: (617) 496-7981 | Cell: (781) 363-0035 > 60 Garden Street | MS 83 | Cambridge, MA 02138 > > > _______________________________________________ > 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 quantum.analyst at gmail.com Fri Jun 19 19:58:39 2020 From: quantum.analyst at gmail.com (Elliott Sales de Andrade) Date: Fri, 19 Jun 2020 19:58:39 -0400 Subject: [Matplotlib-users] [ANN] Matplotlib 3.3.0 release candidate 1 Message-ID: Hi all, We are pleased to announce the issue of the first release candidate for 3.3.0. Please test widely so that we may correct any bugs before the final release. Pre-built wheels are available for most major platforms, and can be installed using `pip install matplotlib==3.3.0rc1`. Other packages may also be available already; please check with your preferred source. The 3.3.0 release represents the work of 150 authors over 992 pull requests, and we thank them for their contributions. Some highlights of this release include: * Adds provisional API for composing semantic axes layouts from text or nested lists. For a detailed tutorial, see https://matplotlib.org/3.3.0/tutorials/provisional/mosaic.html * Adds Turbo colormap, a spectral map (purple-blue-green-yellow-orange-red) with a bright center and darker endpoints, and is a smoother alternative to jet. See https://ai.googleblog.com/2019/08/turbo-improved-rainbow-colormap-for.html * Adds axline, a method for drawing infinite lines. * Axes3D supports minor ticks, view navigation buttons, and an improved aspect ratio. * Dates now use a modern epoch, enabling improved precision for recent dates. * Tick formatters now accept str or function inputs. * The pcolor and pcolormesh methods now accept shading='nearest' and 'auto'. * The alignment of titles and Axis labels can now be controlled more precisely. * The text color for legend labels can now be set, either as a whole, or individually based on the corresponding item. * Improved support for metadata when saving SVG or PDF. * Improved interactive tools and toolbar in various backends. For further details, please see the What's new in Matplotlib 3.3.0 page: https://matplotlib.org/3.3.0/users/whats_new.html and the milestone on GitHub: https://github.com/matplotlib/matplotlib/milestone/48?closed=1 For packagers, this release contains some changes to dependencies: * Pillow is now required. * jQuery and jQuery-UI are no longer used, nor downloaded as part of the build. * Compiled extensions are built with LTO if the compiler supports it. This release is signed by my GPG key. The fingerprint is: 23CA B59E 3332 F94D 26BE F037 8D86 E7FA E5EB 0C10 and it is also used to sign this message. -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 870 bytes Desc: OpenPGP digital signature URL: From meepsorp at gmail.com Tue Jun 2 05:24:48 2020 From: meepsorp at gmail.com (John Doucette) Date: Tue, 02 Jun 2020 09:24:48 -0000 Subject: [Matplotlib-users] Question about ylims Message-ID: I am trying to make a 2 x 2 figure with covid-19 graphs Upper left = cases Upper right = cumulative cases Lower left = deaths Lower right = cumulative deaths I have been having trouble with ylims. It appears that if I set a ylim it is applied to all four frames. I have been searching duckduckgo for hour including the matplotlib gallery and every set of multiple frame plots has the same ylim on every frame. I need different ylims for each individual frame. Is this even possible? -------------- next part -------------- An HTML attachment was scrubbed... URL: From tcaswell at gmail.com Fri Jun 26 19:02:36 2020 From: tcaswell at gmail.com (Thomas Caswell) Date: Fri, 26 Jun 2020 19:02:36 -0400 Subject: [Matplotlib-users] Question about ylims In-Reply-To: References: Message-ID: John, Please subscribe to the mailing list ( https://mail.python.org/mailman/listinfo/matplotlib-users) so you can post un-moderated. Can you include a minimal example of what you are doing which is not working? What you want is definitely possible: fig, ax_arr = plt.subplots(2, 2) ax_arr[0, 0].set_ylim(0, 5) ax_arr[1, 0].set_ylim(-5, 0) # and so-on Tom On Fri, Jun 26, 2020 at 6:59 PM John Doucette wrote: > I am trying to make a 2 x 2 figure with covid-19 graphs > > Upper left = cases Upper right = cumulative cases > Lower left = deaths Lower right = cumulative deaths > > I have been having trouble with ylims. It appears that if I set a ylim it > is applied to all four frames. > > I have been searching duckduckgo for hour including the matplotlib > gallery and every set of multiple frame plots has the same ylim on every > frame. > > I need different ylims for each individual frame. Is this even possible? > _______________________________________________ > 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 tcaswell at gmail.com Fri Jun 26 19:05:47 2020 From: tcaswell at gmail.com (Thomas Caswell) Date: Fri, 26 Jun 2020 19:05:47 -0400 Subject: [Matplotlib-users] Cycler License In-Reply-To: References: Message-ID: Sohiel, Please subscribe to the mailing list at https://mail.python.org/mailman/listinfo/matplotlib-users I do not understand the question, you link to the license file which is the authoritative version of the license independent of what we call it (but it is BSD-3). Tom On Fri, Jun 26, 2020 at 6:46 PM Soheil Saifipour wrote: > 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 > > > _______________________________________________ > 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 tcaswell at gmail.com Fri Jun 26 19:10:00 2020 From: tcaswell at gmail.com (Thomas Caswell) Date: Fri, 26 Jun 2020 19:10:00 -0400 Subject: [Matplotlib-users] Logarithmic scale in 3D surface In-Reply-To: References: Message-ID: Hedy, Please subscribe to the mailing list https://mail.python.org/mailman/listinfo/matplotlib-users This is unfortunately a very long standing limitation of the 3D axes (see https://github.com/matplotlib/matplotlib/issues/209 and https://github.com/matplotlib/matplotlib/issues/15248 ) Tom On Fri, Jun 26, 2020 at 6:45 PM Hedy BOUJELBEN < hedy.boujelben at etudiant-enit.utm.tn> wrote: > Hello, > I'm mechanical student and i'm using python for a project > I don't find the logarithmic scale in python for 3D graphs can you help me > please ? > _______________________________________________ > 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 tcaswell at gmail.com Fri Jun 26 19:20:43 2020 From: tcaswell at gmail.com (Thomas Caswell) Date: Fri, 26 Jun 2020 19:20:43 -0400 Subject: [Matplotlib-users] Third Y axis is like cryptonite to pyplot. In-Reply-To: <1586592909035-0.post@n5.nabble.com> References: <1586592909035-0.post@n5.nabble.com> Message-ID: Andre, Please subscribe to the mailing list https://mail.python.org/mailman/listinfo/matplotlib-users to post un-moderated and to make sure you get responses. Thank you for a copy-paste-runable example, it made it super easy to help you :) The units that the positions are in is "axes fraction" which is the coordinate system on the Axes object where (0,0) is the lower left and (1, 1) is the upper right. In this coordinate system 1.35 is a 0.35 * (axes width) to the right of the right edge of the Axes which happens to be out of the Figure. If do fig.subplots_adjust(right=0.5) it will shrink the Axes enough that it will all fit. If you have a mpl >=3.1 then you can do fig, host = plt.subplots(constrained_layout=True) # fig.subplots_adjust(right=0.5) # remove the call to subplots_adjust It will automatically resize everything to fit and completely fill the available space! Tom ------ import matplotlib.pyplot as plt def make_patch_spines_invisible(ax): ax.set_frame_on(True) ax.patch.set_visible(False) for sp in ax.spines.values(): sp.set_visible(False) fig, host = plt.subplots(constrained_layout=True) # fig.subplots_adjust(right=0.5) par1 = host.twinx() par2 = host.twinx() par3 = host.twinx() # Offset the right spine of par2. The ticks and label have already been # placed on the right by twinx above. par2.spines["right"].set_position(("axes", 1.2)) par3.spines["right"].set_position(("axes", 1.35)) # Having been created by twinx, par2 has its frame off, so the line of its # detached spine is invisible. First, activate the frame but make the patch # and spines invisible. #make_patch_spines_invisible(par2) make_patch_spines_invisible(par3) # Second, show the right spine. par2.spines["right"].set_visible(True) par3.spines["right"].set_visible(True) p1, = host.plot([0, 1, 2], [0, 1, 2], "b-", label="Density") p2, = par1.plot([0, 1, 2], [0, 3, 2], "r-", label="Temperature") p3, = par2.plot([0, 1, 2], [50, 30, 15], "g-", label="Velocity") p4, = par3.plot([0, 1, 2], [12, 18, 20], "y-", label="Voltage") host.set_xlim(0, 2) host.set_ylim(0, 2) par1.set_ylim(0, 4) par2.set_ylim(1, 65) host.set_xlabel("Distance") host.set_ylabel("Density") par1.set_ylabel("Temperature") par2.set_ylabel("Velocity") par3.set_ylabel("Voltage") host.yaxis.label.set_color(p1.get_color()) par1.yaxis.label.set_color(p2.get_color()) par2.yaxis.label.set_color(p3.get_color()) par3.yaxis.label.set_color(p4.get_color()) tkw = dict(size=4, width=1.5) host.tick_params(axis='y', colors=p1.get_color(), **tkw) par1.tick_params(axis='y', colors=p2.get_color(), **tkw) par2.tick_params(axis='y', colors=p3.get_color(), **tkw) par3.tick_params(axis='y', colors=p4.get_color(), **tkw) host.tick_params(axis='x', **tkw) lines = [p1, p2, p3 , p4] host.legend(lines, [l.get_label() for l in lines]) plt.show() On Fri, Jun 26, 2020 at 6:45 PM Andre wrote: > I modified > > https://matplotlib.org/3.2.1/gallery/ticks_and_spines/multiple_yaxis_with_spines.html > to have a fourth data-set: > https://gist.github.com/AndKe/c0c999a22a8daebafb62171b671bf131 > > With the offset of "1.35" > par3.spines["right"].set_position(("axes", 1.35)) > One can get a glimpse of that, any less, and it will overlap, and more it > will be invisible. > > changing "right" to "left" does nothing. > Also, the resulting spines placement does vary with the width of the > window. > - wasting more space the wider the window gets. > > > > -- > 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 > -- Thomas Caswell tcaswell at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: fig1.png Type: image/png Size: 62755 bytes Desc: not available URL: From tcaswell at gmail.com Fri Jun 26 19:50:20 2020 From: tcaswell at gmail.com (Thomas Caswell) Date: Fri, 26 Jun 2020 19:50:20 -0400 Subject: [Matplotlib-users] subplots and xticklabels In-Reply-To: References: Message-ID: Sorry for the late reply. It is a bit hard to be sure because your code has a lot on undefined variables, but I suspect that you are positioning the Axes so that the ticklabels are place outside of the figure space (and hence are not rendered). I suggest trying fig.tight_layout() before showing or passing `tight_layout=True` when creating your figure. Tom On Wed, Apr 29, 2020 at 9:53 AM Kees Serier wrote: > Hi, > > I have been making some graphs with multiple curves with Python 3.7.5 and > Matplotlib 3.0.2. > Now I want to plot 4 curves in 3 graphs with subplot. > This works and the 3 graphs are plotted correctly, including the legends. > Only I can't get my X values printed, like I did in my previous graphs > with: > > labels = ax.get_xticklabels() > plt.setp(labels, fontsize=6, rotation = 90.) > > My script is like: > > ax = plt.axes() > name_list = tuple(X) > pos_list = np.arange(len(name_list)) > ax.xaxis.set_major_locator(ticker.FixedLocator((pos_list))) > ax.xaxis.set_major_formatter(ticker.FixedFormatter((name_list))) > grid_size = (3,1) > fig = plt.figure() > > plt.subplot2grid(grid_size, (0, 0), rowspan = 1, colspan = 1) > plt.plot(pos_list, value_list[0], label = "r/s") > plt.plot(pos_list, value_list[1], label = "w/s") > plt.title(plt_title) > plt.legend(loc = 'lower left', fontsize=6) > plt.grid(True) > #plt.setp(labels, visible=False) # does not work > > plt.subplot2grid(grid_size, (1, 0), rowspan = 1, colspan = 1) > plt.plot(pos_list, value_list[2], label = "blks/s (kB)") > plt.legend(loc = 'lower left', fontsize=6) > plt.grid(True) > #plt.setp(labels, visible=False) # does not work > > plt.subplot2grid(grid_size, (2, 0), rowspan = 1, colspan = 1) > plt.plot(pos_list, value_list[3], label = "avser (ms)") > plt.legend(loc = 'lower left', fontsize=6) > > labels = ax.get_xticklabels() > plt.setp(labels, fontsize=6, rotation = 90.) > fig.subplots_adjust(hspace=0) > > plt.grid(True) > plt.show() > > I have tried a lot of things, but can't get it working. > > Thank you in advance, > > Kees > _______________________________________________ > 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 gallard at digimicro.ca Tue Jun 30 14:30:16 2020 From: gallard at digimicro.ca (Gilles Allard) Date: Tue, 30 Jun 2020 14:30:16 -0400 Subject: [Matplotlib-users] How to close plot window in interactive mode? Message-ID: <4338156.Y9W0877I0C@gial.local> Hi! I'm searching for a way to close (programmatically) a plot window in interactive mode. What is the best way? From jerzy.karczmarczuk at unicaen.fr Tue Jun 30 15:58:35 2020 From: jerzy.karczmarczuk at unicaen.fr (Jerzy Karczmarczuk) Date: Tue, 30 Jun 2020 21:58:35 +0200 Subject: [Matplotlib-users] How to close plot window in interactive mode? In-Reply-To: <4338156.Y9W0877I0C@gial.local> References: <4338156.Y9W0877I0C@gial.local> Message-ID: Le 30/06/2020 ? 20:30, Gilles Allard a ?crit?: > I'm searching for a way to close (programmatically) a plot window in > interactive mode. > What is the best way? Oh, you are searching, you say... Why not (with plt meaning matplotlib.pyplot): plt.close(myFigure) To see if it is the best or not... read the manual perhaps?... For example https://matplotlib.org/api/_as_gen/matplotlib.pyplot.close.html Google gives you? 1?050?000?results if you type "matplotlib close window"! Jerzy Karczmarczuk /Caen, France/ From ben.v.root at gmail.com Tue Jun 30 16:36:49 2020 From: ben.v.root at gmail.com (Benjamin Root) Date: Tue, 30 Jun 2020 16:36:49 -0400 Subject: [Matplotlib-users] How to close plot window in interactive mode? In-Reply-To: <4338156.Y9W0877I0C@gial.local> References: <4338156.Y9W0877I0C@gial.local> Message-ID: If the figure was created through the pyplot interface (e.g., plt.figure(), plt.subplots()), then plt.close(fig)) is the best way to close it programmatically both in the interactive and non-interactive modes. If the figure was constructed directly without pyplot, then that is a fair bit trickier to do, depending on the context of the code. Ben Root On Tue, Jun 30, 2020 at 2:55 PM Gilles Allard wrote: > Hi! > I'm searching for a way to close (programmatically) a plot window in > interactive mode. > What is the best way? > > > > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jni at fastmail.com Tue Jun 30 21:54:31 2020 From: jni at fastmail.com (Juan Nunez-Iglesias) Date: Tue, 30 Jun 2020 20:54:31 -0500 Subject: [Matplotlib-users] How to close plot window in interactive mode? In-Reply-To: References: <4338156.Y9W0877I0C@gial.local> Message-ID: <8cd41497-23d3-47af-9448-1ced77608599@www.fastmail.com> Hi Jerzy, On Tue, 30 Jun 2020, at 2:58 PM, Jerzy Karczmarczuk wrote: > > Le 30/06/2020 ? 20:30, Gilles Allard a ?crit?: > > I'm searching for a way to close (programmatically) a plot window in > > interactive mode. > > What is the best way? > > Oh, you are searching, you say... Why not (with plt meaning > matplotlib.pyplot): > > plt.close(myFigure) > > To see if it is the best or not... read the manual perhaps?... For example > > https://matplotlib.org/api/_as_gen/matplotlib.pyplot.close.html > > Google gives you? 1?050?000?results if you type "matplotlib close window"! 1M results is a lot of noise to wade through. Additionally, it is a well-documented problem that a lot of Matplotlib answers on the web are out of date and use APIs that are no longer recommended by the core team. It is not reasonable to expect new users to be as effective at cutting through that noise as more experienced ones. Nor is it reasonable to expect everyone to have read through *all* the very extensive matplotlib documentation before daring to post to the list. For example, if I click on your link to `plt.close`, I might reasonably follow through to the `Intro to pyplot` tutorial, which uses the Matplotlib state machine interface rather than the currently-recommended OO interface. I know that the OO interface is recommended only because I have years of experience with Matplotlib, but there is a good chance that newcomers would not have heard this recommendation. This is exactly where the Matplotlib users list can help, but only *if* we are welcoming and encouraging to newcomers, rather than drive them to never post to the list again, or worse, away from this community altogether. In short, if you want to "teach users to fish", that's fine, I get that. But this can be done with encouragement and direction rather than sarcasm and scorn. Juan.