From story645 at gmail.com Mon Apr 1 16:02:48 2019 From: story645 at gmail.com (Hannah) Date: Mon, 1 Apr 2019 16:02:48 -0400 Subject: [Matplotlib-users] equally spaced nice colors? In-Reply-To: References: Message-ID: You should be able to use the tab10/tab20 etc. colormaps directly, if that's a similar palette: https://matplotlib.org/examples/color/colormaps_reference.html On Fri, Feb 22, 2019 at 8:08 AM Neal Becker wrote: > I'm currently using seaborn to get equally spaced nice colors: > > import seaborn as sns > colors = np.array(sns.color_palette("hls", len (solution))) > > Now that mpl has all new improved color models, do I still need to use sns > or can I easily do something similar with mpl directly? > > _______________________________________________ > 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 kotaro.saito at psi.ch Mon Apr 1 17:23:20 2019 From: kotaro.saito at psi.ch (Saito Kotaro (PSI)) Date: Mon, 1 Apr 2019 23:23:20 +0200 Subject: [Matplotlib-users] equally spaced nice colors? In-Reply-To: References: Message-ID: Dear Neal, Answer 1: If you are looking for equally spaced colors from a given colormap. Choose your favorite ?nice" colormap from here. https://matplotlib.org/tutorials/colors/colormaps.html I use viridis for example. import matplotlib.pyplot as plt cmap = plt.get_cmap('viridis') print('Default number of colors in the lookup table:', len(cmap.colors)) # default: 256 colors print('First color:', cmap.colors[0]) print('Last color:', cmap.colors[-1]) print('10 equally spaced colors:', cmap(np.linspace(0, 1, 10))) print('wrong example:', cmap(range(10))) And you?ll get this: Default number of colors in the lookup table: 256 First color: [0.267004, 0.004874, 0.329415] Last color: [0.993248, 0.906157, 0.143936] 10 equally spaced colors: [[ 0.267004 0.004874 0.329415 1. ] [ 0.281412 0.155834 0.469201 1. ] [ 0.244972 0.287675 0.53726 1. ] [ 0.190631 0.407061 0.556089 1. ] [ 0.147607 0.511733 0.557049 1. ] [ 0.119699 0.61849 0.536347 1. ] [ 0.20803 0.718701 0.472873 1. ] [ 0.430983 0.808473 0.346476 1. ] [ 0.709898 0.868751 0.169257 1. ] [ 0.993248 0.906157 0.143936 1. ]] wrong example: [[ 0.267004 0.004874 0.329415 1. ] [ 0.26851 0.009605 0.335427 1. ] [ 0.269944 0.014625 0.341379 1. ] [ 0.271305 0.019942 0.347269 1. ] [ 0.272594 0.025563 0.353093 1. ] [ 0.273809 0.031497 0.358853 1. ] [ 0.274952 0.037752 0.364543 1. ] [ 0.276022 0.044167 0.370164 1. ] [ 0.277018 0.050344 0.375715 1. ] [ 0.277941 0.056324 0.381191 1. ]] See these for details. https://matplotlib.org/api/cm_api.html#matplotlib.cm.get_cmap https://matplotlib.org/tutorials/colors/colormap-manipulation.html#getting-colormaps-and-accessing-their-values Answer 2: If you are looking for "evenly-spaced colors in a circular color space" with constant brightness and saturation like hls in seaborn, I guess matplotlib doesn?t support that type of colormaps for the moment as you can find here https://matplotlib.org/tutorials/colors/colormaps.html. You need to make your own or find ones that someone made like hls in seaborn. Best regards, Kotaro //================//================// Paul Scherrer Institut Kotaro SAITO ????? Laboratory for Neutron Scattering and Imaging WHGA/348 5232 Villigen PSI, Schweiz +41 56 310 3179 kotaro.saito at psi.ch https://sites.google.com/view/kotarosaito/ //================//================// > 2019/02/22 14:01?Neal Becker ????: > > I'm currently using seaborn to get equally spaced nice colors: > > import seaborn as sns > colors = np.array(sns.color_palette("hls", len (solution))) > > Now that mpl has all new improved color models, do I still need to use sns > or can I easily do something similar with mpl directly? > > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users From dhirendra.cub at gmail.com Tue Apr 16 17:05:01 2019 From: dhirendra.cub at gmail.com (Dhirendra Kumar) Date: Wed, 17 Apr 2019 02:35:01 +0530 Subject: [Matplotlib-users] Query about streamplot Message-ID: Hii Folks I have an array with dimension (plev: 7, lat: 81). I was trying to draw streamline plot for Omega and V wind [Hadley cell]. I am facing some error with* plt.streamplot* as it says that both the dimension should be of equal size (i.e. N * N ). Is there any other way to create a streamline plot for the data having unequal values along both the dimensions? I seek help of the community in this regard. I hope I framed my question correctly. Please let me know if I need to clarify more details. Thank you -- ======================================== Dhirendra Kumar PhD Student School of Environmental Sciences, JNU New Delhi (India) Contact: +91 9910778043 Alternate email: dhirendra.cub at outlook.com ========================================= -------------- next part -------------- An HTML attachment was scrubbed... URL: From vincent.adrien at gmail.com Wed Apr 17 02:14:07 2019 From: vincent.adrien at gmail.com (Adrien VINCENT) Date: Wed, 17 Apr 2019 08:14:07 +0200 Subject: [Matplotlib-users] Query about streamplot In-Reply-To: References: Message-ID: Hi Kumar, Could provided a snippet with a (standalone) minimal working example of what you have tried ? AFAICT, looking at https://matplotlib.org/api/_as_gen/matplotlib.axes.Axes.streamplot.html it does not look like X and Y arrays of coordinates have to be of equal length (but the velocity arrays U and V should have relevant dimensions relative to X and Y). Best regards, Adrien On April 16, 2019 11:05:01 PM GMT+02:00, Dhirendra Kumar wrote: >Hii Folks > >I have an array with dimension (plev: 7, lat: 81). I was trying to draw >streamline plot for Omega and V wind [Hadley cell]. I am facing some >error >with* plt.streamplot* as it says that both the dimension should be of >equal >size (i.e. N * N ). Is there any other way to create a streamline plot >for >the data having unequal values along both the dimensions? > >I seek help of the community in this regard. > >I hope I framed my question correctly. Please let me know if I need to >clarify more details. > >Thank you -- Envoy? de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma bri?vet?. From vincent.adrien at gmail.com Wed Apr 17 03:57:20 2019 From: vincent.adrien at gmail.com (vincent.adrien at gmail.com) Date: Wed, 17 Apr 2019 09:57:20 +0200 Subject: [Matplotlib-users] Query about streamplot In-Reply-To: References: Message-ID: <3356979b-8fc1-6a0a-02f1-75ce482aad36@gmail.com> Kumar, FWIW, based on the [streamplot example](https://matplotlib.org/gallery/images_contours_and_fields/plot_streamplot.html) in the gallery, the following snippet seems to be working just fine (with Matplotlib 3.0.1) ?even though? the amount of X and Y coordinate values is (Nx, Ny) = (100, 50). ```python import numpy as np import matplotlib.pyplot as plt # Dummy data w = 3 Nx, Ny = 100, 50 Y, X = np.mgrid[-w:w:50j, -w:w:100j] U = -1 - X**2 + Y V = 1 + X - Y**2 fig, ax = plt.subplots() ax.streamplot(X, Y, U, V) ax.set_title(f"{Nx/Ny:g}? more points along X than Y") ``` Best, Adrien Le 17/04/2019 ? 08:14, Adrien VINCENT a ?crit?: > Hi Kumar, > > Could provided a snippet with a (standalone) minimal working example of what you have tried ? > > AFAICT, looking at https://matplotlib.org/api/_as_gen/matplotlib.axes.Axes.streamplot.html it does not look like X and Y arrays of coordinates have to be of equal length (but the velocity arrays U and V should have relevant dimensions relative to X and Y). > > Best regards, > Adrien > > > > On April 16, 2019 11:05:01 PM GMT+02:00, Dhirendra Kumar wrote: >> Hii Folks >> >> I have an array with dimension (plev: 7, lat: 81). I was trying to draw >> streamline plot for Omega and V wind [Hadley cell]. I am facing some >> error >> with* plt.streamplot* as it says that both the dimension should be of >> equal >> size (i.e. N * N ). Is there any other way to create a streamline plot >> for >> the data having unequal values along both the dimensions? >> >> I seek help of the community in this regard. >> >> I hope I framed my question correctly. Please let me know if I need to >> clarify more details. >> >> Thank you > -------------- next part -------------- A non-text attachment was scrubbed... Name: streamplot_example_for_kumar.png Type: image/png Size: 86118 bytes Desc: not available URL: From dhirendra.cub at gmail.com Wed Apr 17 05:55:31 2019 From: dhirendra.cub at gmail.com (Dhirendra Kumar) Date: Wed, 17 Apr 2019 15:25:31 +0530 Subject: [Matplotlib-users] Query about streamplot In-Reply-To: <3356979b-8fc1-6a0a-02f1-75ce482aad36@gmail.com> References: <3356979b-8fc1-6a0a-02f1-75ce482aad36@gmail.com> Message-ID: Hii Adrien Thanks for the reply. I have tried your example and could replicate it. But in case of my script I have two variables: *V* and *Omega* having sizes: ([('plev', 12), ('lat', 81)])) ([('plev', 12), ('lat', 81)])) Plev has to be plotted on y axis and lat has to be plotted on x axis. I am using following lines to create the plot: plt.subplot(331) plt.contourf(CC_W_CON11,cmap='RdBu') plt.streamplot(X, Y, Omega, V) This gives me an error as: File "/opt/apps/ANACONDA/lib/python3.7/site-packages/matplotlib/pyplot.py", line 2951, in streamplot if data is not None else {})) File "/opt/apps/ANACONDA/lib/python3.7/site-packages/matplotlib/__init__.py", line 1810, in inner return func(ax, *args, **kwargs) File "/opt/apps/ANACONDA/lib/python3.7/site-packages/matplotlib/axes/_axes.py", line 4882, in streamplot integration_direction=integration_direction) File "/opt/apps/ANACONDA/lib/python3.7/site-packages/matplotlib/streamplot.py", line 79, in streamplot grid = Grid(x, y) File "/opt/apps/ANACONDA/lib/python3.7/site-packages/matplotlib/streamplot.py", line 311, in __init__ raise ValueError("The rows of 'x' must be equal") *ValueError: The rows of 'x' must be equal* Could you please look if there is any mistake ?? Thanks On Wed, Apr 17, 2019 at 1:27 PM vincent.adrien at gmail.com < vincent.adrien at gmail.com> wrote: > Kumar, > > FWIW, based on the [streamplot > example]( > https://matplotlib.org/gallery/images_contours_and_fields/plot_streamplot.html > ) > in the gallery, the following snippet seems to be working just fine > (with Matplotlib 3.0.1) ?even though? the amount of X and Y coordinate > values is (Nx, Ny) = (100, 50). > > ```python > import numpy as np > import matplotlib.pyplot as plt > > # Dummy data > w = 3 > Nx, Ny = 100, 50 > Y, X = np.mgrid[-w:w:50j, -w:w:100j] > U = -1 - X**2 + Y > V = 1 + X - Y**2 > > fig, ax = plt.subplots() > > ax.streamplot(X, Y, U, V) > ax.set_title(f"{Nx/Ny:g}? more points along X than Y") > ``` > > Best, > Adrien > > Le 17/04/2019 ? 08:14, Adrien VINCENT a ?crit : > > Hi Kumar, > > > > Could provided a snippet with a (standalone) minimal working example of > what you have tried ? > > > > AFAICT, looking at > https://matplotlib.org/api/_as_gen/matplotlib.axes.Axes.streamplot.html > it does not look like X and Y arrays of coordinates have to be of equal > length (but the velocity arrays U and V should have relevant dimensions > relative to X and Y). > > > > Best regards, > > Adrien > > > > > > > > On April 16, 2019 11:05:01 PM GMT+02:00, Dhirendra Kumar < > dhirendra.cub at gmail.com> wrote: > >> Hii Folks > >> > >> I have an array with dimension (plev: 7, lat: 81). I was trying to draw > >> streamline plot for Omega and V wind [Hadley cell]. I am facing some > >> error > >> with* plt.streamplot* as it says that both the dimension should be of > >> equal > >> size (i.e. N * N ). Is there any other way to create a streamline plot > >> for > >> the data having unequal values along both the dimensions? > >> > >> I seek help of the community in this regard. > >> > >> I hope I framed my question correctly. Please let me know if I need to > >> clarify more details. > >> > >> Thank you > > > > -- ======================================== Dhirendra Kumar PhD Student School of Environmental Sciences, JNU New Delhi (India) Contact: +91 9910778043 Alternate email: dhirendra.cub at outlook.com ========================================= -------------- next part -------------- An HTML attachment was scrubbed... URL: From vincent.adrien at gmail.com Wed Apr 17 10:22:04 2019 From: vincent.adrien at gmail.com (vincent.adrien at gmail.com) Date: Wed, 17 Apr 2019 16:22:04 +0200 Subject: [Matplotlib-users] Query about streamplot In-Reply-To: References: <3356979b-8fc1-6a0a-02f1-75ce482aad36@gmail.com> Message-ID: Kumar, As far as I understand it, it looks like your issue may be due to X (and possibly Y) being 2d-array. If V and Omega are arrays with shape **(Ny, Nx)**, then X and Y should be **1d-arrays** with Nx and Ny elements respectively. For simplicity sake (I guess), there is actually a special (not very well documented) case if X and Y are 2d-arrays : - each row of X has to be the same; - each column in Y has to be same. The error that you saw suggest that the rows in your array X differ from one another. Adrien Le 17/04/2019 ? 11:55, Dhirendra Kumar a ?crit?: > Hii Adrien > > Thanks for the reply. I have tried your example and could replicate it. > But in case of my script I have two variables: > > *V* and *Omega* having sizes: > ([('plev', 12), ('lat', 81)])) > ([('plev', 12), ('lat', 81)])) > > Plev has to be plotted on y axis and lat has to be plotted on x axis.? > > I am using following lines to create the plot: > > plt.subplot(331) > plt.contourf(CC_W_CON11,cmap='RdBu') > plt.streamplot(X, Y, Omega,? V) > > This gives me an error as: > > ? File > "/opt/apps/ANACONDA/lib/python3.7/site-packages/matplotlib/pyplot.py", > line 2951, in streamplot > ? ? if data is not None else {})) > ? File > "/opt/apps/ANACONDA/lib/python3.7/site-packages/matplotlib/__init__.py", > line 1810, in inner > ? ? return func(ax, *args, **kwargs) > ? File > "/opt/apps/ANACONDA/lib/python3.7/site-packages/matplotlib/axes/_axes.py", > line 4882, in streamplot > ? ? integration_direction=integration_direction) > ? File > "/opt/apps/ANACONDA/lib/python3.7/site-packages/matplotlib/streamplot.py", > line 79, in streamplot > ? ? grid = Grid(x, y) > ? File > "/opt/apps/ANACONDA/lib/python3.7/site-packages/matplotlib/streamplot.py", > line 311, in __init__ > ? ? raise ValueError("The rows of 'x' must be equal") > *ValueError: The rows of 'x' must be equal* > * > * > Could you please look if there is any mistake ?? > > Thanks > > > On Wed, Apr 17, 2019 at 1:27 PM vincent.adrien at gmail.com > > wrote: > > Kumar, > > FWIW, based on the [streamplot > example](https://matplotlib.org/gallery/images_contours_and_fields/plot_streamplot.html) > in the gallery, the following snippet seems to be working just fine > (with Matplotlib 3.0.1) ?even though? the amount of X and Y coordinate > values is (Nx, Ny) = (100, 50). > > ```python > import numpy as np > import matplotlib.pyplot as plt > > # Dummy data > w = 3 > Nx, Ny = 100, 50 > Y, X = np.mgrid[-w:w:50j, -w:w:100j] > U = -1 - X**2 + Y > V = 1 + X - Y**2 > > fig, ax = plt.subplots() > > ax.streamplot(X, Y, U, V) > ax.set_title(f"{Nx/Ny:g}? more points along X than Y") > ``` > > Best, > Adrien > > Le 17/04/2019 ? 08:14, Adrien VINCENT a ?crit?: > > Hi Kumar, > > > > Could provided a snippet with a (standalone) minimal working > example of what you have tried ? > > > > AFAICT, looking at > https://matplotlib.org/api/_as_gen/matplotlib.axes.Axes.streamplot.html > it does not look like X and Y arrays of coordinates have to be of > equal length (but the velocity arrays U and V should have relevant > dimensions relative to X and Y). > > > > Best regards, > > Adrien > > > > > > > > On April 16, 2019 11:05:01 PM GMT+02:00, Dhirendra Kumar > > wrote: > >> Hii Folks > >> > >> I have an array with dimension (plev: 7, lat: 81). I was trying > to draw > >> streamline plot for Omega and V wind [Hadley cell].? I am facing some > >> error > >> with* plt.streamplot* as it says that both the dimension should be of > >> equal > >> size (i.e. N * N ). Is there any other way to create a streamline > plot > >> for > >> the data having unequal values along both the dimensions? > >> > >> I seek help of the community in this regard. > >> > >> I hope I framed my question correctly.? Please let me know if I > need to > >> clarify more details. > >> > >> Thank you > > > > > > -- > ======================================== > Dhirendra Kumar > PhD Student > School of Environmental Sciences, JNU > New Delhi (India) > Contact: +91 9910778043 > Alternate email: dhirendra.cub at outlook.com > > ========================================= From dhirendra.cub at gmail.com Wed Apr 17 14:58:48 2019 From: dhirendra.cub at gmail.com (Dhirendra Kumar) Date: Thu, 18 Apr 2019 00:28:48 +0530 Subject: [Matplotlib-users] Query about streamplot In-Reply-To: References: <3356979b-8fc1-6a0a-02f1-75ce482aad36@gmail.com> Message-ID: Hii Adrien I guess I have found the problem but don't know how to go about it. The documentation here ( https://matplotlib.org/api/_as_gen/matplotlib.pyplot.streamplot.html) says that x and y should be: *x*, *y* : 1d arraysan *evenly spaced* grid.but in my case although I have the same shape of the V and Omega values, it is unevenly distributed as a grid. The plev values are: [1000. 925. 850. 700. 600. 500. 400. 300. 250. 200. 150. 100.] while x varies from 0-40 N at an interval of 0.5. So apparently it produces an unevely distributed gridspace in lat-plev (xy).Please let me know what you think about this.ThanksDhirendra On Wed, Apr 17, 2019 at 7:51 PM vincent.adrien at gmail.com < vincent.adrien at gmail.com> wrote: > Kumar, > > As far as I understand it, it looks like your issue may be due to X (and > possibly Y) being 2d-array. If V and Omega are arrays with shape **(Ny, > Nx)**, then X and Y should be **1d-arrays** with Nx and Ny elements > respectively. For simplicity sake (I guess), there is actually a special > (not very well documented) case if X and Y are 2d-arrays : > - each row of X has to be the same; > - each column in Y has to be same. > > The error that you saw suggest that the rows in your array X differ from > one another. > > Adrien > > Le 17/04/2019 ? 11:55, Dhirendra Kumar a ?crit : > > Hii Adrien > > > > Thanks for the reply. I have tried your example and could replicate it. > > But in case of my script I have two variables: > > > > *V* and *Omega* having sizes: > > ([('plev', 12), ('lat', 81)])) > > ([('plev', 12), ('lat', 81)])) > > > > Plev has to be plotted on y axis and lat has to be plotted on x axis. > > > > I am using following lines to create the plot: > > > > plt.subplot(331) > > plt.contourf(CC_W_CON11,cmap='RdBu') > > plt.streamplot(X, Y, Omega, V) > > > > This gives me an error as: > > > > File > > "/opt/apps/ANACONDA/lib/python3.7/site-packages/matplotlib/pyplot.py", > > line 2951, in streamplot > > if data is not None else {})) > > File > > "/opt/apps/ANACONDA/lib/python3.7/site-packages/matplotlib/__init__.py", > > line 1810, in inner > > return func(ax, *args, **kwargs) > > File > > > "/opt/apps/ANACONDA/lib/python3.7/site-packages/matplotlib/axes/_axes.py", > > line 4882, in streamplot > > integration_direction=integration_direction) > > File > > > "/opt/apps/ANACONDA/lib/python3.7/site-packages/matplotlib/streamplot.py", > > line 79, in streamplot > > grid = Grid(x, y) > > File > > > "/opt/apps/ANACONDA/lib/python3.7/site-packages/matplotlib/streamplot.py", > > line 311, in __init__ > > raise ValueError("The rows of 'x' must be equal") > > *ValueError: The rows of 'x' must be equal* > > * > > * > > Could you please look if there is any mistake ?? > > > > Thanks > > > > > > On Wed, Apr 17, 2019 at 1:27 PM vincent.adrien at gmail.com > > > > wrote: > > > > Kumar, > > > > FWIW, based on the [streamplot > > example]( > https://matplotlib.org/gallery/images_contours_and_fields/plot_streamplot.html > ) > > in the gallery, the following snippet seems to be working just fine > > (with Matplotlib 3.0.1) ?even though? the amount of X and Y > coordinate > > values is (Nx, Ny) = (100, 50). > > > > ```python > > import numpy as np > > import matplotlib.pyplot as plt > > > > # Dummy data > > w = 3 > > Nx, Ny = 100, 50 > > Y, X = np.mgrid[-w:w:50j, -w:w:100j] > > U = -1 - X**2 + Y > > V = 1 + X - Y**2 > > > > fig, ax = plt.subplots() > > > > ax.streamplot(X, Y, U, V) > > ax.set_title(f"{Nx/Ny:g}? more points along X than Y") > > ``` > > > > Best, > > Adrien > > > > Le 17/04/2019 ? 08:14, Adrien VINCENT a ?crit : > > > Hi Kumar, > > > > > > Could provided a snippet with a (standalone) minimal working > > example of what you have tried ? > > > > > > AFAICT, looking at > > > https://matplotlib.org/api/_as_gen/matplotlib.axes.Axes.streamplot.html > > it does not look like X and Y arrays of coordinates have to be of > > equal length (but the velocity arrays U and V should have relevant > > dimensions relative to X and Y). > > > > > > Best regards, > > > Adrien > > > > > > > > > > > > On April 16, 2019 11:05:01 PM GMT+02:00, Dhirendra Kumar > > > wrote: > > >> Hii Folks > > >> > > >> I have an array with dimension (plev: 7, lat: 81). I was trying > > to draw > > >> streamline plot for Omega and V wind [Hadley cell]. I am facing > some > > >> error > > >> with* plt.streamplot* as it says that both the dimension should > be of > > >> equal > > >> size (i.e. N * N ). Is there any other way to create a streamline > > plot > > >> for > > >> the data having unequal values along both the dimensions? > > >> > > >> I seek help of the community in this regard. > > >> > > >> I hope I framed my question correctly. Please let me know if I > > need to > > >> clarify more details. > > >> > > >> Thank you > > > > > > > > > > > -- > > ======================================== > > Dhirendra Kumar > > PhD Student > > School of Environmental Sciences, JNU > > New Delhi (India) > > Contact: +91 9910778043 > > Alternate email: dhirendra.cub at outlook.com > > > > ========================================= > > -- ======================================== Dhirendra Kumar PhD Student School of Environmental Sciences, JNU New Delhi (India) Contact: +91 9910778043 Alternate email: dhirendra.cub at outlook.com ========================================= -------------- next part -------------- An HTML attachment was scrubbed... URL: From tcaswell at gmail.com Sat Apr 20 22:09:52 2019 From: tcaswell at gmail.com (Thomas Caswell) Date: Sat, 20 Apr 2019 22:09:52 -0400 Subject: [Matplotlib-users] [REL] Matplotlib 3.1.0rc1 Message-ID: Folks, We have tagged Matplotlib v3.1.0rc1. The tarball and wheels are on pypi and can be installed via pip install --pre --upgrade matplotlib conda-forge packages are Highlights of the new features: - A concise date formatter - Secondary axis support (ex, degrees and radians) - A helper method for scatter legends - A progress callback for animations - No longer requires a framework build of Python to use OSX backend - Major and minor ticks will no longer collide by default In addition we have many API deprecations, mostly to obscure corners of the code base, in an effort to make the library more coherent and maintainable. Please test RC and let us know if any of these deprecations break down stream projects. For full details see: https://matplotlib.org/devdocs/users/whats_new.html#what-s-new-in-matplotlib-3-1 and https://matplotlib.org/devdocs/api/api_changes.html#api-changes-for-3-1-0 I expect there to be at least one more rc and aim for the final release the first week of May. Thank you to all the people who worked on this release! Tom -- Thomas Caswell tcaswell at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From niklas.berliner at gmail.com Tue Apr 30 05:02:19 2019 From: niklas.berliner at gmail.com (Niklas Berliner) Date: Tue, 30 Apr 2019 10:02:19 +0100 Subject: [Matplotlib-users] Hexbin plot, PolyCollection and inconsistent facecolor values Message-ID: Hi, I am trying to change the edgecolor of some hexbin patches in a hexbin plot. Fiddling around with it to understand how this could work, I encountered a behaviour I cannot understand. I initially opened an issue at seaborn here https://github.com/mwaskom/seaborn/issues/1734 . I get the same behaviour with pure matplotlib and am now asking here for help. Calling get_facecolors() on the PolyCollection returned by plt.hexbin gives different results depending on the jupyter notebook cell within which the call is made. Here's my example (assuming the code is run in a notebook, using Python 3.6.8, NumPy 1.16.2, Matplotlib 3.0.3, Jupyter 4.4.0) Cell 1: ------- import matplotlib import matplotlib.pyplot as plt import numpy as np ------- Cell 2: ------- x = np.array([1,1,1,1.5,1.5,2]) y = np.array([1,1,1,1,1,1]) ------- Cell 3: ------- polycollection = plt.hexbin(x, y, C=np.ones(x.shape), reduce_C_function=np.sum, extent=[1, 2, 0.5, 1.5], gridsize=3, linewidths=1, edgecolors='face') print(polycollection.get_facecolors()) ------- This plots three hexbins with different counts and different colours. Here, get_facecolors() returns a (1,4) array, namely, [[0.12156863 0.46666667 0.70588235 1. ]] Cell 4: ------- print(polycollection.get_facecolors()) ------- When calling get_facecolors() again in the next cell, a (3,4) array is returned, namely, [[0.993248 0.906157 0.143936 1. ] [0.127568 0.566949 0.550556 1. ] [0.267004 0.004874 0.329415 1. ]] The second array seems to be the correct one I think (there are different colors for each of the three hexbins). What is happening here? I am very confused! Thanks, Niklas -------------- next part -------------- An HTML attachment was scrubbed... URL: From pierig.havez_bodivit at icloud.com Sun Apr 14 09:01:39 2019 From: pierig.havez_bodivit at icloud.com (Pierig Havez-Bodivit) Date: Sun, 14 Apr 2019 13:01:39 -0000 Subject: [Matplotlib-users] Constant failed import Message-ID: Hi, my name is Pierig, I?m a French student, I use python for my study but I?ve got issue with your library. I?m running it on PyCharm and Pyzo on MacOSX and while I can import your library, there's no way of using any of the module, such as : plt.figure() or plt.plot() while other libraries like numpy work. I?ve got this message: I really need your library to work, can you help me with that? Sincerely yours Pierig -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Screen Shot 2019-04-14 at 14.57.40.png Type: image/png Size: 597280 bytes Desc: not available URL: From ramond_yuan at 139.com Mon Apr 15 05:51:32 2019 From: ramond_yuan at 139.com (ramond_yuan) Date: Mon, 15 Apr 2019 09:51:32 -0000 Subject: [Matplotlib-users] how to create 3D plot from a csv or excel Message-ID: <2b065cb44e049cb-00018.Richmail.00041743235583558693@139.com> Hello,all: I am a beginner using matplotlib. Can you help me to solve below questions: I want to create a 3D plot from a csv file or excel file. The x axis is ?time? The y axis is ?RB??from RB0 to RB49? The z axis is ?value? When using matplotlib, I meet to problems:1, the x, y axis is not value, they are text. 2, The z value is not a formula?but corresponding to the table. I cannot found answers from the web, so could any body give me some support. Thanks. Ramond Yuan -------------- next part -------------- An HTML attachment was scrubbed... URL: From madicken.munk at gmail.com Fri Apr 26 18:38:39 2019 From: madicken.munk at gmail.com (Madicken Munk) Date: Fri, 26 Apr 2019 22:38:39 -0000 Subject: [Matplotlib-users] 2019 John Hunter Excellence in Plotting Contest Reminder Message-ID: Hi everybody, I'd like to remind you all about the 2019 John Hunter Excellence in Plotting Contest. My apologies to those of you getting this on multiple lists. In memory of John Hunter, we are pleased to be reviving the SciPy John Hunter Excellence in Plotting Competition for 2019. 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 the conference. John Hunter?s family and NumFocus 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, 8th to the form at https://goo.gl/forms/cFTB3FUBrMPfQ7Vz1 - Winners will be announced at Scipy 2019 in Austin, TX. - 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, 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. This 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 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). SciPy John Hunter Excellence in Plotting Competition Co-Chairs Hannah Aizenman Thomas Caswell Madicken Munk Nelle Varoquaux -------------- next part -------------- An HTML attachment was scrubbed... URL: