From quantum.analyst at gmail.com Fri Aug 13 19:15:28 2021 From: quantum.analyst at gmail.com (Elliott Sales de Andrade) Date: Fri, 13 Aug 2021 19:15:28 -0400 Subject: [Matplotlib-users] [ANN] Matplotlib 3.4.3 Message-ID: <33fba870-3b97-f301-9f75-38e82cf9f755@gmail.com> Hi all, We are pleased to announce the release of Matplotlib 3.4.3. This is the third bug fix release of the 3.4.x series. Pre-built wheels are available for most major platforms, and can be installed using `pip install matplotlib==3.4.3`. Other packages may also be available already; please check with your preferred source. Note, we are currently aware of some issues with package distribution on PyPI. Please track these issues for updates, if you are having trouble installing: https://github.com/matplotlib/matplotlib/issues/20834 https://github.com/pypa/pypi-support/issues/1261 We would like to thank the 18 authors over 69 pull requests for their contributions to this release. This release contains several critical bug fixes: * Clarify deprecation of |Axes.figbox| * Disable |MultiCursor| widget on |Axes| subplots which it is not tracking * Don't simplify path in |LineCollection.get_segments| * Fix DPI in subfigures, affecting tick spacing, and scatter marker size * Fix broken EPS output when using Type 42 STIX fonts * Fix change in tick behaviour when calling |Axes.clear| * Fix class docstrings for |Norm|s created from |Scale|s * Fix compatibility with NumPy 1.21.0 * Fix crash on broken TrueType fonts * Fix incorrect hits from |Path.intersects_path| * Fix leak if affine_transform is passed invalid vertices * Fix legends of |stackplot| with |edgecolors='face'| * Fix plot directive when building in parallel * Fix |supxlabel| and |supylabel| behaviour in constrained layout * Fix tests with latest Inkscape and Ghostscript * Improve |DateFormatter| styling for month names when |usetex=True| * Re-disable autoscaling after interactive zoom * Work around bug in Pillow 8.3.0 For further details on new features, please see the What's new in Matplotlib 3.4.0 page: https://matplotlib.org/3.4.0/users/whats_new.html and for details of bugs fixed in 3.4.3, see the milestone on GitHub: https://github.com/matplotlib/matplotlib/milestone/64?closed=1 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: OpenPGP_signature Type: application/pgp-signature Size: 840 bytes Desc: OpenPGP digital signature URL: From bioprogrammer at gmail.com Sat Aug 14 01:03:56 2021 From: bioprogrammer at gmail.com (Caitlin) Date: Fri, 13 Aug 2021 22:03:56 -0700 Subject: [Matplotlib-users] Possible bug in matplotlib version 3.4.3? Message-ID: Hi all. I'm using Windows 10 and Python 3.9.6. I attempted to upgrade to matplotlib 3.4.3 from 3.4.2 and the following error was displayed whether or not I used the administrator account: WARNING: Ignoring invalid distribution -atplotlib (c:\users\biopr\appdata\local\programs\python\python39\lib\site-packages) Installing collected packages: matplotlib ERROR: Could not install packages due to an OSError: [WinError 5] Access is denied: 'c:\\users\\biopr\\appdata\\local\\programs\\python\\python39\\Lib\\site-packages\\matplotlib\\_c_internal_utils.cp39-win_amd64.pyd' Consider using the `--user` option or check the permissions. WARNING: Ignoring invalid distribution -atplotlib (c:\users\biopr\appdata\local\programs\python\python39\lib\site-packages) WARNING: Ignoring invalid distribution -atplotlib (c:\users\biopr\appdata\local\programs\python\python39\lib\site-packages) Thank you. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ABillings at axustech.com Fri Aug 20 13:33:01 2021 From: ABillings at axustech.com (Anthony Billings) Date: Fri, 20 Aug 2021 17:33:01 +0000 Subject: [Matplotlib-users] Please advise...How to detect if a user has closed the matplotlib figure window? Message-ID: Good day, With a previous version of matplotlib, I was able to plot 4 axes on a figure and update it, in a while loop, with plt.pause(). If the figure window was closed by the user, the plt.pause() would signal an error and I was able to escape the while loop using try/except. try: # plt.pause(0.05) # if gv.saveImage_UserCancel: H1_FinishingOptions.saveImage(temp_name=f"{Names.processName}", option=2) # except: # This allows the closing of graph display window and going back to OED main menu. Variables and lists are reset for next scan. # if gv.multWafers_lastWaferDetected: # H1_FinishingOptions.UserCancelled(time_lst=H1_waferScan_time_lst, select='single') # process.cprint('END') # break # elif not gv.multWafers_lastWaferDetected: # H1_FinishingOptions.UserCancelled(time_lst=H1_waferScan_time_lst, select='multiple') # break # With the new release of matplotlib, I'm no longer triggering an error when the figure window is manually closed, and the program then stalls in a loop because of the plt.pause(). File "c:/Users/ABillings/AppData/Local/Programs/Python/Python37/MyPythonDocs/Endpoint-08.19.21(Samtec).py", line 12576, in epMain plt.pause(0.05) File "C:\Users\ABillings\AppData\Local\Programs\Python\Python37\lib\site-packages\matplotlib\pyplot.py", line 558, in pause canvas.start_event_loop(interval) File "C:\Users\ABillings\AppData\Local\Programs\Python\Python37\lib\site-packages\matplotlib\backends\_backend_tk.py", line 385, in start_event_loop self._master.mainloop() File "C:\Users\ABillings\AppData\Local\Programs\Python\Python37\lib\tkinter\__init__.py", line 1283, in mainloop self.tk.mainloop(n) KeyboardInterrupt I'm now trying things like below, but to no avail. I need to somehow get the program to break the while loop when it detects a user has closed the figure window. Is there a method I can call to check whether the figure is still opened and make a decision based on that? That's what I'm trying to do here, but the code stalls in the plt.pause() every time. if not plt.fignum_exists(1): print(f"plt.get_axes() is False") break else: print(plt.fignum_exists(1)) # print(fig.get_axes()) print(f"plt.get_axes() is True") # print(plt.get_fignums()) # plt.show(block=False) print("Before Pause") plt.pause(0.05) print("After Pause") Please and thank you. -------------- next part -------------- An HTML attachment was scrubbed... URL: From tcaswell at gmail.com Fri Aug 20 15:32:04 2021 From: tcaswell at gmail.com (Thomas Caswell) Date: Fri, 20 Aug 2021 15:32:04 -0400 Subject: [Matplotlib-users] Please advise...How to detect if a user has closed the matplotlib figure window? In-Reply-To: References: Message-ID: What error did we use to raise? I would not have expected that. You can use the `close_event` to be notified what the window is closed (see https://matplotlib.org/stable/gallery/event_handling/close_event.html). You can probably also keep a reference to the Figure you create and query its state. >From this code snippet I can not tell if you are embedding Matplotlib in a bigger GUI application or not. If you are, you can rely on it's main loop to be spinning so you do not actually need `plt.pause()`. Tom On Fri, Aug 20, 2021 at 3:07 PM Anthony Billings wrote: > Good day, > > > > With a previous version of matplotlib, I was able to plot 4 axes on a > figure and update it, in a while loop, with plt.pause(). > If the figure window was closed by the user, the plt.pause() would signal > an error and I was able to escape the while loop using try/except. > > try > : > # > > plt.pause(0.05 > ) > # > > if gv.saveImage_UserCancel: > > H1_FinishingOptions.saveImage(temp_name=f"{ > Names.processName}", option=2 > ) > # > > except: > # This allows the closing of graph display window and going back to OED main menu. Variables and lists are reset for next scan. # > > if > gv.multWafers_lastWaferDetected: > # > > H1_FinishingOptions.UserCancelled(time_lst > =H1_waferScan_time_lst, select='single' > ) > # > > process.cprint('END' > ) > # > > break > > # > > elif not > gv.multWafers_lastWaferDetected: > # > > H1_FinishingOptions.UserCancelled(time_lst > =H1_waferScan_time_lst, select='multiple' > ) > # > > break > > # > > > > With the new release of matplotlib, I?m no longer triggering an error when > the figure window is manually closed, and the program then stalls in a loop > because of the plt.pause(). > > File > "c:/Users/ABillings/AppData/Local/Programs/Python/Python37/MyPythonDocs/Endpoint-08.19.21(Samtec).py", > line 12576, in epMain > > plt.pause(0.05) > > File > "C:\Users\ABillings\AppData\Local\Programs\Python\Python37\lib\site-packages\matplotlib\pyplot.py", > line 558, in pause > > canvas.start_event_loop(interval) > > File > "C:\Users\ABillings\AppData\Local\Programs\Python\Python37\lib\site-packages\matplotlib\backends\_backend_tk.py", > line 385, in start_event_loop > > self._master.mainloop() > > File > "C:\Users\ABillings\AppData\Local\Programs\Python\Python37\lib\tkinter\__init__.py", > line 1283, in mainloop > > self.tk.mainloop(n) > > KeyboardInterrupt > > > > > > I?m now trying things like below, but to no avail. I need to somehow get > the program to break the while loop when it detects a user has closed the > figure window. > > Is there a method I can call to check whether the figure is still opened > and make a decision based on that? > > That?s what I?m trying to do here, but the code stalls in the plt.pause() > every time. > > if not plt.fignum_exists(1): > > print(f"plt.get_axes() is False") > > break > > else: > > print(plt.fignum_exists(1)) > > # print(fig.get_axes()) > > print(f"plt.get_axes() is True") > > # print(plt.get_fignums()) > > # plt.show(block=False) > > print("Before Pause") > > plt.pause(0.05) > > print("After Pause") > > > > Please and thank you. > _______________________________________________ > 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: