From ndbecker2 at gmail.com Mon Mar 1 07:19:13 2021 From: ndbecker2 at gmail.com (Neal Becker) Date: Mon, 1 Mar 2021 07:19:13 -0500 Subject: [Matplotlib-users] rainbow text in legend? Message-ID: An approach to Rainbow text was given here: https://matplotlib.org/stable/gallery/text_labels_and_annotations/rainbow_text.html But what I'd like is to apply this to the legend. Specifically, in the legend I'd like to call attention to certain words in the label with color. Any ideas? Thanks, Neal -- Those who don't understand recursion are doomed to repeat it From mail.python.org at gethmann.org Mon Mar 1 11:51:30 2021 From: mail.python.org at gethmann.org (Julian Gethmann) Date: Mon, 1 Mar 2021 17:51:30 +0100 Subject: [Matplotlib-users] No z-axis background in 3d plots Message-ID: Dear all, I've got two questions concerning axis in 3d plots. When I do something similar to my minimal working example (see below), then I see a grid and light gray filling forming half a cube. 1. How do I turn off this cube in z-direction, so that the x-y-plane still has got the ticks and labels, but there is no x-z-plane, nor a y-z-plane. In the first attached image there is how far I got and the other image is what I intend to have. In the left plot, there I turned off the axis (`ax2.axis('off')`, but this also turns off the x-y-plane and in the right plot there is the box. 2. The best case would be that I get the right plot with a shifted dedicated z-axis, but I haven't looked into creating such new axis, yet. Unfortunately, I couldn't find an option like `ax2.axis(x=True,y=True,z=False)` or `plt.grid('no-z')` and the 3d examples from the gallery also include all this box, even the frontpage example[1] which has no ticks. Also emptying the ticks and labels in z still leaves the gray box (trick 1 in MWE). And trying to hide them behind a white surface (trick 2 in MWE) still leaves a small grey border. --------------------- Minimal Working Example # MWE import matplotlib.pyplot as plt from matplotlib import cm from mpl_toolkits.mplot3d import Axes3D import numpy as np # sample data x = np.linspace(-2, 2, 10) y = np.linspace(-2, 2, 10) X, Y = np.meshgrid(x, y) def fun(x, y): return x + y Z = fun(X, Y) # plotting problem fig = plt.figure() ax1 = fig.add_subplot(1, 1, 1, projection='3d', frame_on=False, ) surf1 = ax1.plot_surface(X, Y, Z, linewidth=0, antialiased=True, cmap=cm.RdYlBu) # trick 1 ax1.set_zticks([]) ax1.set_zticklabels([]) ax1.grid(False) # trick 2 ax1.contourf(X, Y, np.array([np.ones_like(Z)[-1, :] * i for i in np.linspace(-4, 4, 10)]).T, zdir='x', offset=-2, colors="white") ax1.set_xlim(-2,2) ax1.set_ylim(-2,2) --------------------- [1] https://matplotlib.org/stable/gallery/frontpage/3D.html#sphx-glr-gallery-frontpage-3d-py I hope, I could make my intention and attempts clear, hope a solution exists and someone here knows of it and can tell me how to proceed. Thank you very much in advance, Julian -------------- next part -------------- A non-text attachment was scrubbed... Name: 3dwithbackground.png Type: image/png Size: 62874 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 3dwithoutbackground.png Type: image/png Size: 65713 bytes Desc: not available URL: From dhoese at gmail.com Wed Mar 17 17:50:54 2021 From: dhoese at gmail.com (David Hoese) Date: Wed, 17 Mar 2021 16:50:54 -0500 Subject: [Matplotlib-users] VisPy User Survey Message-ID: <3064f063-9f1d-e282-186e-e0da6976f693@gmail.com> Hi everyone, You may have seen this on the various VisPy project's lists, but we thought it would help to branch out to other communities as well. The VisPy project wants to know more about our users. We've put together a little survey: https://forms.gle/2BrqGZN3e9EWqPvG6 The results of this survey will have a major impact on the future of VisPy so please take a couple minutes to help us out if you've ever used VisPy, tried to use it, or even really thought about using it. https://vispy.org/ Thanks. Dave From mail.python.org at gethmann.org Fri Mar 19 05:45:35 2021 From: mail.python.org at gethmann.org (Julian Gethmann) Date: Fri, 19 Mar 2021 10:45:35 +0100 Subject: [Matplotlib-users] No z-axis background in 3d plots In-Reply-To: References: Message-ID: <3452c5b5-19b9-ecc4-5479-5f7520bc44f5@gethmann.org> Dear all, I found a solution to my first problem, which I share here for completeness. Instead of trick 2 in the MWE one can use the following code to set the background to transparent white/(1,1,1,0). ``` ax1.set_facecolor('white') ax1.w_xaxis.set_pane_color((1.0, 1.0, 1.0, 0.0)) ax1.w_yaxis.set_pane_color((1.0, 1.0, 1.0, 0.0)) ax1.w_zaxis.set_pane_color((1.0, 1.0, 1.0, 0.0)) ax1.w_zaxis.line.set_visible(False) ``` Cheers, Julian On 01/03/2021 17:51, Julian Gethmann wrote: > Dear all, > > I've got two questions concerning axis in 3d plots. > When I do something similar to my minimal working example (see below), > then I see a grid and light gray filling forming half a cube. > > 1. How do I turn off this cube in z-direction, so that the x-y-plane > still has got the ticks and labels, but there is no x-z-plane, nor a > y-z-plane. > In the first attached image there is how far I got and the other image > is what I intend to have. > In the left plot, there I turned off the axis (`ax2.axis('off')`, but > this also turns off the x-y-plane and in the right plot there is the box. > > 2. The best case would be that I get the right plot with a shifted > dedicated z-axis, but I haven't looked into creating such new axis, yet. > > Unfortunately, I couldn't find an option like > `ax2.axis(x=True,y=True,z=False)` or `plt.grid('no-z')` and the 3d > examples from the gallery also include all this box, even the frontpage > example[1] which has no ticks. > Also emptying the ticks and labels in z still leaves the gray box (trick > 1 in MWE). And trying to hide them behind a white surface (trick 2 in > MWE) still leaves a small grey border. > > --------------------- > Minimal Working Example > > # MWE > import matplotlib.pyplot as plt > from matplotlib import cm > from mpl_toolkits.mplot3d import Axes3D > import numpy as np > > # sample data > x = np.linspace(-2, 2, 10) > y = np.linspace(-2, 2, 10) > X, Y = np.meshgrid(x, y) > def fun(x, y): > ??? return x + y > Z = fun(X, Y) > > # plotting problem > fig = plt.figure() > ax1 = fig.add_subplot(1, 1, 1, projection='3d', frame_on=False, ) > surf1 = ax1.plot_surface(X, Y, Z, linewidth=0, antialiased=True, > cmap=cm.RdYlBu) > > # trick 1 > ax1.set_zticks([]) > ax1.set_zticklabels([]) > ax1.grid(False) > > # trick 2 > ax1.contourf(X, Y, > ???????????? np.array([np.ones_like(Z)[-1, :] * i for i in > np.linspace(-4, 4, 10)]).T, > ???????????? zdir='x', offset=-2, colors="white") > ax1.set_xlim(-2,2) > ax1.set_ylim(-2,2) > --------------------- > > [1] > https://matplotlib.org/stable/gallery/frontpage/3D.html#sphx-glr-gallery-frontpage-3d-py > > > I hope, I could make my intention and attempts clear, hope a solution > exists and someone here knows of it and can tell me how to proceed. > > > Thank you very much in advance, > > Julian > > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users > From quantum.analyst at gmail.com Fri Mar 26 21:15:11 2021 From: quantum.analyst at gmail.com (Elliott Sales de Andrade) Date: Fri, 26 Mar 2021 21:15:11 -0400 Subject: [Matplotlib-users] [ANN] Matplotlib 3.4.0 Message-ID: <29ab1463-d5d1-26fb-2295-04b178555069@gmail.com> Hi all, We are pleased to announce the release of 3.4.0. Pre-built wheels are available for most major platforms, and can be installed using `pip install matplotlib==3.4.0`. Starting with this release, we now provide wheels for aarch64. Other packages may also be available already; please check with your preferred source. We would like to thank the 177 authors over 772 pull requests for their contributions to this release. Highlights of this release include: * Figure and Axes creation / management o New subfigure functionality o Single-line string notation for |subplot_mosaic| o Changes to behavior of Axes creation methods (|gca|, |add_axes|, |add_subplot|) o |add_subplot|/|add_axes| gained an /axes_class/ parameter o Subplot and subplot2grid can now work with constrained layout * Plotting methods o |axline| supports transform parameter o New automatic labeling for bar charts o A list of hatches can be specified to |bar| and |barh| o Setting |BarContainer| orientation o Contour plots now default to using |ScalarFormatter| o |Axes.errorbar| cycles non-color properties correctly o |errorbar| /errorevery/ parameter matches /markevery/ o |hexbin| supports data reference for /C/ parameter o Support callable for formatting of Sankey labels o |Axes.spines| access shortcuts o New |stairs| method and |StepPatch| artist o Added /orientation/ parameter for stem plots o Angles on Bracket arrow styles o |TickedStroke| patheffect * Colors and colormaps o Collection color specification and mapping o Transparency (alpha) can be set as an array in collections o pcolormesh has improved transparency handling by enabling snapping o IPython representations for Colormap objects o |Colormap.set_extremes| and |Colormap.with_extremes| o Get under/over/bad colors of Colormap objects o New |cm.unregister_cmap| function o New |CenteredNorm| for symmetrical data around a center o New |FuncNorm| for arbitrary normalizations o GridSpec-based colorbars can now be positioned above or to the left of the main axes * Titles, ticks, and labels o supxlabel and supylabel o Shared-axes |subplots| tick label visibility is now correct for top or left labels o An iterable object with labels can be passed to |Axes.plot| * Fonts and Text o Text transform can rotate text direction o |matplotlib.mathtext| now supports /overset/ and /underset/ LaTeX symbols o /math_fontfamily/ parameter to change |Text| font family o |TextArea|/|AnchoredText| support /horizontalalignment/ o PDF supports URLs on Text artists * rcParams improvements o New rcParams for dates: set converter and whether to use interval_multiples o Date formatters now respect /usetex/ rcParam o Setting /image.cmap/ to a Colormap o Tick and tick label colors can be set independently using rcParams * 3D Axes improvements o Errorbar method in 3D Axes o Stem plots in 3D Axes o 3D Collection properties are now modifiable o Panning in 3D Axes * Interactive tool improvements o New |RangeSlider| widget o Sliders can now snap to arbitrary values o Pausing and Resuming Animations * Sphinx extensions o |plot_directive| /caption/ option * Backend-specific improvements o Consecutive rasterized draws now merged o Support raw/rgba frame format in |FFMpegFileWriter| o nbAgg/WebAgg support middle-click and double-click o nbAgg support binary communication o Indexed color for PNG images in PDF files when possible o Improved font subsettings in PDF/PS o Kerning added to strings in PDFs o Fully-fractional HiDPI in QtAgg o wxAgg supports fullscreen toggle For further details, please see the What's new in Matplotlib 3.4.0 page: https://matplotlib.org/3.4.0/users/whats_new.html and the milestone on GitHub: https://github.com/matplotlib/matplotlib/milestone/53?closed=1 For packagers, this release contains some changes to dependencies: * Qhull is downloaded while building the sdist (if you are not using the sdist). If compiling against the system Qhull, then the reentrant version is required. 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 tcaswell at gmail.com Sat Mar 27 18:14:47 2021 From: tcaswell at gmail.com (Thomas Caswell) Date: Sat, 27 Mar 2021 18:14:47 -0400 Subject: [Matplotlib-users] [ANN] Matplotlib 3.4.0 In-Reply-To: <29ab1463-d5d1-26fb-2295-04b178555069@gmail.com> References: <29ab1463-d5d1-26fb-2295-04b178555069@gmail.com> Message-ID: Thank you to Elliott for being the release manager and to everyone who contributed to this release! Tom On Fri, Mar 26, 2021 at 9:15 PM Elliott Sales de Andrade < quantum.analyst at gmail.com> wrote: > Hi all, > > We are pleased to announce the release of 3.4.0. > > Pre-built wheels are available for most major platforms, and can be > installed using `pip install matplotlib==3.4.0`. Starting with this > release, we now provide wheels for aarch64. Other packages may also be > available already; please check with your preferred source. > > We would like to thank the 177 authors over 772 pull requests for their > contributions to this release. > > Highlights of this release include: > > * Figure and Axes creation / management > o New subfigure functionality > o Single-line string notation for |subplot_mosaic| > o Changes to behavior of Axes creation methods (|gca|, |add_axes|, > |add_subplot|) > o |add_subplot|/|add_axes| gained an /axes_class/ parameter > o Subplot and subplot2grid can now work with constrained layout > * Plotting methods > o |axline| supports transform parameter > o New automatic labeling for bar charts > o A list of hatches can be specified to |bar| and |barh| > o Setting |BarContainer| orientation > o Contour plots now default to using |ScalarFormatter| > o |Axes.errorbar| cycles non-color properties correctly > o |errorbar| /errorevery/ parameter matches /markevery/ > o |hexbin| supports data reference for /C/ parameter > o Support callable for formatting of Sankey labels > o |Axes.spines| access shortcuts > o New |stairs| method and |StepPatch| artist > o Added /orientation/ parameter for stem plots > o Angles on Bracket arrow styles > o |TickedStroke| patheffect > * Colors and colormaps > o Collection color specification and mapping > o Transparency (alpha) can be set as an array in collections > o pcolormesh has improved transparency handling by enabling snapping > o IPython representations for Colormap objects > o |Colormap.set_extremes| and |Colormap.with_extremes| > o Get under/over/bad colors of Colormap objects > o New |cm.unregister_cmap| function > o New |CenteredNorm| for symmetrical data around a center > o New |FuncNorm| for arbitrary normalizations > o GridSpec-based colorbars can now be positioned above or to the > left of the main axes > * Titles, ticks, and labels > o supxlabel and supylabel > o Shared-axes |subplots| tick label visibility is now correct for > top or left labels > o An iterable object with labels can be passed to |Axes.plot| > * Fonts and Text > o Text transform can rotate text direction > o |matplotlib.mathtext| now supports /overset/ and /underset/ > LaTeX symbols > o /math_fontfamily/ parameter to change |Text| font family > o |TextArea|/|AnchoredText| support /horizontalalignment/ > o PDF supports URLs on Text artists > * rcParams improvements > o New rcParams for dates: set converter and whether to use > interval_multiples > o Date formatters now respect /usetex/ rcParam > o Setting /image.cmap/ to a Colormap > o Tick and tick label colors can be set independently using rcParams > * 3D Axes improvements > o Errorbar method in 3D Axes > o Stem plots in 3D Axes > o 3D Collection properties are now modifiable > o Panning in 3D Axes > * Interactive tool improvements > o New |RangeSlider| widget > o Sliders can now snap to arbitrary values > o Pausing and Resuming Animations > * Sphinx extensions > o |plot_directive| /caption/ option > * Backend-specific improvements > o Consecutive rasterized draws now merged > o Support raw/rgba frame format in |FFMpegFileWriter| > o nbAgg/WebAgg support middle-click and double-click > o nbAgg support binary communication > o Indexed color for PNG images in PDF files when possible > o Improved font subsettings in PDF/PS > o Kerning added to strings in PDFs > o Fully-fractional HiDPI in QtAgg > o wxAgg supports fullscreen toggle > > For further details, please see the What's new in Matplotlib 3.4.0 page: > https://matplotlib.org/3.4.0/users/whats_new.html > and the milestone on GitHub: > https://github.com/matplotlib/matplotlib/milestone/53?closed=1 > > For packagers, this release contains some changes to dependencies: > > * Qhull is downloaded while building the sdist (if you are not using > the sdist). If compiling against the system Qhull, then the > reentrant version is required. > > 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. > > > _______________________________________________ > 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 Wed Mar 31 17:14:40 2021 From: quantum.analyst at gmail.com (Elliott Sales de Andrade) Date: Wed, 31 Mar 2021 17:14:40 -0400 Subject: [Matplotlib-users] [ANN] Matplotlib 3.4.1 Message-ID: Hi all, We are pleased to announce the release of 3.4.1. This is the first bug fix release of the 3.4.x series, and fixes a silent misrendering of 3D scatter plots. We recommend skipping 3.4.0 if you need to create 3D plots. Pre-built wheels are available for most major platforms, and can be installed using `pip install matplotlib==3.4.1`. Other packages may also be available already; please check with your preferred source. We would like to thank the 6 authors over 20 pull requests for their contributions to this release. This release contains several critical bug-fixes: * fix errorbar when specifying fillstyle * fix Inkscape cleanup at exit on Windows for tests * fix legends of colour-mapped scatter plots * fix positioning of annotation fancy arrows * fix size and color rendering for 3D scatter plots * fix suptitle manual positioning when using constrained layout * respect antialiasing settings in cairo backends as well 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 the milestone on GitHub: https://github.com/matplotlib/matplotlib/milestone/61?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 suchitraraniojha at gmail.com Sun Mar 14 01:54:46 2021 From: suchitraraniojha at gmail.com (Suchitrarani Ojha) Date: Sun, 14 Mar 2021 06:54:46 -0000 Subject: [Matplotlib-users] Matplotlib Backend Problem! Message-ID: Hello matplotlib community, I am working with spyder(Python 3.7). Yesterday I created a virtual environment for tensorflow. But after that, when I tried to import matplotlib.pyplot as plt, it shows the following error: ModuleNotFoundError: No module named 'matplotlib.artist'. I googled and tried different ways to solve the issue like reinstalling..But nothing helped me to solve the issue. *Specifications:* *Windows 10* *matplotlib version installed 3.2.2* *Obtained Matplotlib from anaconda* Hoping to help in resolving the issue asap. Thanks in advance Here is the detailed view of the error *Command in spyder:* import matplotlib.pyplot as plt *Error:* IPython 7.19.0 -- An enhanced Interactive Python. ========================================================================= NOTE: The following error appeared when setting your Matplotlib backend!! ========================================================================= Traceback (most recent call last): File "F:\Python\Anaconda_3.0\lib\site-packages\spyder_kernels\console\kernel.py", line 580, in _set_mpl_backend get_ipython().run_line_magic(magic, backend) File "F:\Python\Anaconda_3.0\lib\site-packages\IPython\core\interactiveshell.py", line 2327, in run_line_magic result = fn(*args, **kwargs) File "", line 2, in matplotlib File "F:\Python\Anaconda_3.0\lib\site-packages\IPython\core\magic.py", line 187, in call = lambda f, *a, **k: f(*a, **k) File "F:\Python\Anaconda_3.0\lib\site-packages\IPython\core\magics\pylab.py", line 99, in matplotlib gui, backend = self.shell.enable_matplotlib(args.gui.lower() if isinstance(args.gui, str) else args.gui) File "F:\Python\Anaconda_3.0\lib\site-packages\IPython\core\interactiveshell.py", line 3506, in enable_matplotlib pt.activate_matplotlib(backend) File "F:\Python\Anaconda_3.0\lib\site-packages\IPython\core\pylabtools.py", line 320, in activate_matplotlib from matplotlib import pyplot as plt File "F:\Python\Anaconda_3.0\lib\site-packages\matplotlib\pyplot.py", line 32, in import matplotlib.colorbar File "F:\Python\Anaconda_3.0\lib\site-packages\matplotlib\colorbar.py", line 27, in import matplotlib.artist as martist ModuleNotFoundError: No module named 'matplotlib.artist' import sys print(sys.path) import matplotlib.pyplot as plt ['F:\\Work\\CorrelationsAndRegression', 'F:/Work/CorrelationsAndRegression', 'F:\\Python\\Anaconda_3.0\\python37.zip', 'F:\\Python\\Anaconda_3.0\\DLLs', 'F:\\Python\\Anaconda_3.0\\lib', 'F:\\Python\\Anaconda_3.0', '', 'F:\\Python\\Anaconda_3.0\\lib\\site-packages', 'F:\\Python\\Anaconda_3.0\\lib\\site-packages\\win32', 'F:\\Python\\Anaconda_3.0\\lib\\site-packages\\win32\\lib', 'F:\\Python\\Anaconda_3.0\\lib\\site-packages\\Pythonwin', 'F:\\Python\\Anaconda_3.0\\lib\\site-packages\\IPython\\extensions', 'C:\\Users\\Suchitra\\.ipython'] Traceback (most recent call last): File "", line 3, in import matplotlib.pyplot as plt File "F:\Python\Anaconda_3.0\lib\site-packages\matplotlib\pyplot.py", line 32, in import matplotlib.colorbar File "F:\Python\Anaconda_3.0\lib\site-packages\matplotlib\colorbar.py", line 27, in import matplotlib.artist as martist ModuleNotFoundError: No module named 'matplotlib.artist' Regards, Suchitra -------------- next part -------------- An HTML attachment was scrubbed... URL: From dimitrismazarakis77 at gmail.com Fri Mar 26 11:06:03 2021 From: dimitrismazarakis77 at gmail.com (Dimitris Mazarakis) Date: Fri, 26 Mar 2021 15:06:03 -0000 Subject: [Matplotlib-users] Student want to contribute! Message-ID: Hello I am a student at the Department of Management Science & Technology and in the course "Software Engineering in Practice" I have to contribute to an open source project. I was thinking of the project matplotlib beacause I have used it in the past and it is a very useful tool and I also know python language from other courses and projects. It will be very helpful if you gave me an opinion whether I should or not choose your project to contribute. Thank very much for your time! -------------- next part -------------- An HTML attachment was scrubbed... URL: From Jiaqi.xu.bupt at outlook.com Sat Mar 27 00:20:39 2021 From: Jiaqi.xu.bupt at outlook.com (Jiaqi.xu.bupt at outlook.com) Date: Sat, 27 Mar 2021 04:20:39 -0000 Subject: [Matplotlib-users] question Message-ID: Hello ,I couldn't set the cell's length of the border, like this, is too wide, [cid:image001.png at 01D722FE.29821EF0]could you tell me how to thin the border? -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image002.jpg Type: image/jpeg Size: 3313 bytes Desc: image002.jpg URL: