From Victor.Poughon at cnes.fr Thu Oct 6 08:36:29 2016 From: Victor.Poughon at cnes.fr (Poughon Victor) Date: Thu, 6 Oct 2016 12:36:29 +0000 Subject: [Matplotlib-users] axes.hist() with 2D input Message-ID: <3E55146A6A81B44A9CB69CAB65908CEA35590AE7@TW-MBX-P01.cnesnet.ad.cnes.fr> Hi, Working with images as 2D numpy arrays, it's very confusing to find that: plt.hist(image.flatten()) plt.hist(image) produce such different histograms. What I am expecting is the first one, which is the histogram of the image. But if I forget to flatten the array (which I don't need to do if I use numpy.histogram and then plot, adding to the confusion), the plotted histogram is strange. The number of bins is different, and so are the frequencies. I'm not sure what the point of this message is, but I'd like to share my experience with this. I just spend a good 30 minutes trying to understand why the matplotlib histogram of my image was clearly wrong. The pyplot.hist and axes.hist documentation are not so great in explaining what is plotted with 2D input (I'm still not sure what I'm looking at), or at building an expectation that if you are working with an image, plt.hist(image) is NOT what you want. To sum up, numpy.histogram and matplotlib's hist() have VERY different behaviors for 2D input arrays. numpy flattens, and matplotlib does... what exactly? Any thoughts? cheers, Victor Poughon -------------- next part -------------- An HTML attachment was scrubbed... URL: From pmhobson at gmail.com Thu Oct 6 16:48:29 2016 From: pmhobson at gmail.com (Paul Hobson) Date: Thu, 6 Oct 2016 13:48:29 -0700 Subject: [Matplotlib-users] axes.hist() with 2D input In-Reply-To: <3E55146A6A81B44A9CB69CAB65908CEA35590AE7@TW-MBX-P01.cnesnet.ad.cnes.fr> References: <3E55146A6A81B44A9CB69CAB65908CEA35590AE7@TW-MBX-P01.cnesnet.ad.cnes.fr> Message-ID: pyplot.hist(x) where x is a N (rows) x M (cols) array will generate M histograms and plot on a single Axes object. Consider an array that likely has far fewer columns than your image: import numpy from matplotlib import pyplot data = numpy.random.normal(size=(37, 4)) fig, ax = pyplot.subplots() ax.hist(data) Does that make sense? -p On Thu, Oct 6, 2016 at 5:36 AM, Poughon Victor wrote: > Hi, > > Working with images as 2D numpy arrays, it's very confusing to find that: > > plt.hist(image.flatten()) > plt.hist(image) > > produce such different histograms. What I am expecting is the first one, > which is the histogram of the image. But if I forget to flatten the array > (which I don't need to do if I use numpy.histogram and then plot, adding to > the confusion), the plotted histogram is strange. The number of bins is > different, and so are the frequencies. > > I'm not sure what the point of this message is, but I'd like to share my > experience with this. I just spend a good 30 minutes trying to understand > why the matplotlib histogram of my image was clearly wrong. The pyplot.hist > and axes.hist documentation are not so great in explaining what is plotted > with 2D input (I'm still not sure what I'm looking at), or at building an > expectation that if you are working with an image, plt.hist(image) is NOT > what you want. > > To sum up, numpy.histogram and matplotlib's hist() have VERY different > behaviors for 2D input arrays. numpy flattens, and matplotlib does... what > exactly? > > Any thoughts? > > cheers, > > Victor Poughon > > _______________________________________________ > 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 Victor.Poughon at cnes.fr Fri Oct 7 07:33:44 2016 From: Victor.Poughon at cnes.fr (Poughon Victor) Date: Fri, 7 Oct 2016 11:33:44 +0000 Subject: [Matplotlib-users] axes.hist() with 2D input In-Reply-To: References: <3E55146A6A81B44A9CB69CAB65908CEA35590AE7@TW-MBX-P01.cnesnet.ad.cnes.fr>, Message-ID: <3E55146A6A81B44A9CB69CAB65908CEA35591F65@TW-MBX-P01.cnesnet.ad.cnes.fr> Ohhhhhh I see now. I was so confused because the histogram with my 2D (non flatten()'ed) input looks like this: http://i.imgur.com/NswA4El.png but that's just because there are a lot of columns (3500 in that case), and matplotlib with render the histogram bars *side-by-side* for each bin. Looking at the figure above, I thought that somehow the bins edges were not the same for each column, or that there were thousands of bins, or something like that, but it's just because it's putting 3500 vertical bars in each bin? So there are still 10 bins, but with a lot of vertical bars in each. For reference here is the same histogram with flatten()'ed input: http://i.imgur.com/x0dwUoL.png. Thank you your example code helped me get that. I think the documentation for pyplot.hist and axes.hist could be improved regarding this issue. Should I have a go at it in a PR? Thanks a lot, (matplotlib is awesome) Victor Poughon ________________________________ De : Paul Hobson [pmhobson at gmail.com] Envoy? : jeudi 6 octobre 2016 22:48 ? : Poughon Victor Cc : matplotlib-users at python.org Objet : Re: [Matplotlib-users] axes.hist() with 2D input pyplot.hist(x) where x is a N (rows) x M (cols) array will generate M histograms and plot on a single Axes object. Consider an array that likely has far fewer columns than your image: import numpy from matplotlib import pyplot data = numpy.random.normal(size=(37, 4)) fig, ax = pyplot.subplots() ax.hist(data) Does that make sense? -p On Thu, Oct 6, 2016 at 5:36 AM, Poughon Victor > wrote: Hi, Working with images as 2D numpy arrays, it's very confusing to find that: plt.hist(image.flatten()) plt.hist(image) produce such different histograms. What I am expecting is the first one, which is the histogram of the image. But if I forget to flatten the array (which I don't need to do if I use numpy.histogram and then plot, adding to the confusion), the plotted histogram is strange. The number of bins is different, and so are the frequencies. I'm not sure what the point of this message is, but I'd like to share my experience with this. I just spend a good 30 minutes trying to understand why the matplotlib histogram of my image was clearly wrong. The pyplot.hist and axes.hist documentation are not so great in explaining what is plotted with 2D input (I'm still not sure what I'm looking at), or at building an expectation that if you are working with an image, plt.hist(image) is NOT what you want. To sum up, numpy.histogram and matplotlib's hist() have VERY different behaviors for 2D input arrays. numpy flattens, and matplotlib does... what exactly? Any thoughts? cheers, Victor Poughon _______________________________________________ Matplotlib-users mailing list Matplotlib-users at python.org https://mail.python.org/mailman/listinfo/matplotlib-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From pmhobson at gmail.com Fri Oct 7 11:29:11 2016 From: pmhobson at gmail.com (Paul Hobson) Date: Fri, 7 Oct 2016 08:29:11 -0700 Subject: [Matplotlib-users] axes.hist() with 2D input In-Reply-To: <3E55146A6A81B44A9CB69CAB65908CEA35591F65@TW-MBX-P01.cnesnet.ad.cnes.fr> References: <3E55146A6A81B44A9CB69CAB65908CEA35590AE7@TW-MBX-P01.cnesnet.ad.cnes.fr> <3E55146A6A81B44A9CB69CAB65908CEA35591F65@TW-MBX-P01.cnesnet.ad.cnes.fr> Message-ID: On Fri, Oct 7, 2016 at 4:33 AM, Poughon Victor wrote: > > I think the documentation for pyplot.hist and axes.hist could be improved > regarding this issue. Should I have a go at it in a PR? > > Thanks a lot, > (matplotlib is awesome) > > Victor Poughon > Improvements to the documentation are always welcome. Feel free to take a stab at clarifying the documentation here: https://github.com/matplotlib/matplotlib/blob/master/lib/matplotlib/axes/_axes.py#L5896 and maybe adding an example here: https://github.com/matplotlib/matplotlib/tree/master/examples/statistics (rendered: http://matplotlib.org/devdocs/examples/statistics/histogram_demo_multihist.html ) -------------- next part -------------- An HTML attachment was scrubbed... URL: From winash12 at gmail.com Fri Oct 14 05:59:38 2016 From: winash12 at gmail.com (ashwinD12 .) Date: Fri, 14 Oct 2016 15:29:38 +0530 Subject: [Matplotlib-users] Unable to display data using matplotlib Message-ID: Hello, I am using this example from this cookbook - http://nbviewer.jupyter.org/github/unidata/notebook-gallery/blob/master/notebooks/850mb_Temperature_Advection.ipynb and I get this exception when I run it - I am wondering whether I need to matplotlib.use('Tkagg') which I did add but does not fix the problem. File "/usr/lib/python3/dist-packages/matplotlib/backends/backend_agg.py", line 474, in draw self.figure.draw(self.renderer)File "/usr/lib/python3/dist-packages/matplotlib/artist.py", line 61, in draw_wrapper draw(artist, renderer, *args, **kwargs)File "/usr/lib/python3/dist-packages/matplotlib/figure.py", line 1159, in draw func(*args) File "/usr/lib/python3/dist-packages/matplotlib/artist.py", line 61, in draw_wrapper draw(artist, renderer, *args, **kwargs) File "/usr/local/lib/python3.5/dist-packages/cartopy/mpl/geoaxes.py", line 355, in draw inframe=inframe)File "/usr/lib/python3/dist-packages/matplotlib/artist.py", line 61, in draw_wrapper draw(artist, renderer, *args, **kwargs)File "/usr/lib/python3/dist-packages/matplotlib/axes/_base.py", line 2324, in draw a.draw(renderer)File "/usr/lib/python3/dist-packages/matplotlib/artist.py", line 61, in draw_wrapper draw(artist, renderer, *args, **kwargs) File "/usr/local/lib/python3.5/dist-packages/cartopy/mpl/feature_artist.py", line 103, in draw geoms = self._feature.intersecting_geometries(extent)File "/usr/local/lib/python3.5/dist-packages/cartopy/feature.py", line 113, in intersecting_geometriesreturn (geom for geom in self.geometries() if File "/usr/local/lib/python3.5/dist-packages/cartopy/feature.py", line 180, in geometries name=self.name) File "/usr/local/lib/python3.5/dist-packages/cartopy/io/shapereader.py", line 246, in natural_earthreturn ne_downloader.path(format_dict)File "/usr/local/lib/python3.5/dist-packages/cartopy/io/__init__.py", line 223, in path result_path = self.acquire_resource(target_path, format_dict)File "/usr/local/lib/python3.5/dist-packages/cartopy/io/shapereader.py", line 301, in acquire_resource shapefile_online = self._urlopen(url)File "/usr/local/lib/python3.5/dist-packages/cartopy/io/__init__.py", line 262, in _urlopenreturn urlopen(url)File "/usr/lib/python3.5/urllib/request.py", line 163, in urlopenreturn opener.open(url, data, timeout)File "/usr/lib/python3.5/urllib/request.py", line 472, in open response = meth(req, response)File "/usr/lib/python3.5/urllib/request.py", line 582, in http_response'http', request, response, code, msg, hdrs)File "/usr/lib/python3.5/urllib/request.py", line 504, in error result = self._call_chain(*args)File "/usr/lib/python3.5/urllib/request.py", line 444, in _call_chain result = func(*args)File "/usr/lib/python3.5/urllib/request.py", line 696, in http_error_302return self.parent.open(new, timeout=req.timeout)File "/usr/lib/python3.5/urllib/request.py", line 472, in open response = meth(req, response) File "/usr/lib/python3.5/urllib/request.py", line 582, in http_response'http', request, response, code, msg, hdrs) File "/usr/lib/python3.5/urllib/request.py", line 510, in errorreturn self._call_chain(*args)File "/usr/lib/python3.5/urllib/request.py", line 444, in _call_chain result = func(*args) File "/usr/lib/python3.5/urllib/request.py", line 590, in http_error_default raise HTTPError(req.full_url, code, msg, hdrs, fp) urllib.error.HTTPError: HTTP Error 404: Not FoundTraceback (most recent call last): File "tempAdv.py", line 72, in plt.show() File "/usr/lib/python3/dist-packages/matplotlib/pyplot.py", line 244, in showreturn _show(*args, **kw) File "/usr/lib/python3/dist-packages/matplotlib/backend_bases.py", line 192, in __call__ self.mainloop() File "/usr/lib/python3/dist-packages/matplotlib/backends/backend_tkagg.py", line 74, in mainloop Tk.mainloop() File "/usr/lib/python3.5/tkinter/__init__.py", line 408, in mainloop _default_root.tk.mainloop(n) AttributeError: 'NoneType' object has no attribute 'tk -------------- next part -------------- An HTML attachment was scrubbed... URL: From joy.merwin at gmail.com Fri Oct 14 06:51:08 2016 From: joy.merwin at gmail.com (Joy merwin monteiro) Date: Fri, 14 Oct 2016 12:51:08 +0200 Subject: [Matplotlib-users] Unable to display data using matplotlib In-Reply-To: References: Message-ID: The end of the error traceback says: " raise HTTPError(req.full_url, code, msg, hdrs, fp) urllib.error.HTTPError: HTTP Error 404: Not Found " Looks like the code is trying to access an online resource that is not available. Don't think it has anything to do with matplotlib. Joy On Fri, Oct 14, 2016 at 11:59 AM, ashwinD12 . wrote: > Hello, > I am using this example from this cookbook - > http://nbviewer.jupyter.org/github/unidata/notebook- > gallery/blob/master/notebooks/850mb_Temperature_Advection.ipynb > > and I get this exception when I run it - > > I am wondering whether I need to matplotlib.use('Tkagg') which I did add > but does not fix the problem. > > File "/usr/lib/python3/dist-packages/matplotlib/backends/backend_agg.py", line 474, in draw > self.figure.draw(self.renderer)File "/usr/lib/python3/dist-packages/matplotlib/artist.py", line 61, in draw_wrapper > draw(artist, renderer, *args, **kwargs)File "/usr/lib/python3/dist-packages/matplotlib/figure.py", line 1159, in draw > func(*args) > File "/usr/lib/python3/dist-packages/matplotlib/artist.py", line 61, in draw_wrapper > draw(artist, renderer, *args, **kwargs) > File "/usr/local/lib/python3.5/dist-packages/cartopy/mpl/geoaxes.py", line 355, in draw > inframe=inframe)File "/usr/lib/python3/dist-packages/matplotlib/artist.py", line 61, in draw_wrapper > draw(artist, renderer, *args, **kwargs)File "/usr/lib/python3/dist-packages/matplotlib/axes/_base.py", line 2324, in draw > a.draw(renderer)File "/usr/lib/python3/dist-packages/matplotlib/artist.py", line 61, in draw_wrapper > draw(artist, renderer, *args, **kwargs) > File "/usr/local/lib/python3.5/dist-packages/cartopy/mpl/feature_artist.py", line 103, in draw > geoms = self._feature.intersecting_geometries(extent)File "/usr/local/lib/python3.5/dist-packages/cartopy/feature.py", line 113, in intersecting_geometriesreturn (geom for geom in self.geometries() if > File "/usr/local/lib/python3.5/dist-packages/cartopy/feature.py", line 180, in geometries > name=self.name) > File "/usr/local/lib/python3.5/dist-packages/cartopy/io/shapereader.py", line 246, in natural_earthreturn ne_downloader.path(format_dict)File "/usr/local/lib/python3.5/dist-packages/cartopy/io/__init__.py", line 223, in path > result_path = self.acquire_resource(target_path, format_dict)File "/usr/local/lib/python3.5/dist-packages/cartopy/io/shapereader.py", line 301, in acquire_resource > shapefile_online = self._urlopen(url)File "/usr/local/lib/python3.5/dist-packages/cartopy/io/__init__.py", line 262, in _urlopenreturn urlopen(url)File "/usr/lib/python3.5/urllib/request.py", line 163, in urlopenreturn opener.open(url, data, timeout)File "/usr/lib/python3.5/urllib/request.py", line 472, in open > response = meth(req, response)File "/usr/lib/python3.5/urllib/request.py", line 582, in http_response'http', request, response, code, msg, hdrs)File "/usr/lib/python3.5/urllib/request.py", line 504, in error > result = self._call_chain(*args)File "/usr/lib/python3.5/urllib/request.py", line 444, in _call_chain > result = func(*args)File "/usr/lib/python3.5/urllib/request.py", line 696, in http_error_302return self.parent.open(new, timeout=req.timeout)File "/usr/lib/python3.5/urllib/request.py", line 472, in open > response = meth(req, response) > File "/usr/lib/python3.5/urllib/request.py", line 582, in http_response'http', request, response, code, msg, hdrs) > File "/usr/lib/python3.5/urllib/request.py", line 510, in errorreturn self._call_chain(*args)File "/usr/lib/python3.5/urllib/request.py", line 444, in _call_chain > result = func(*args) > File "/usr/lib/python3.5/urllib/request.py", line 590, in http_error_default > raise HTTPError(req.full_url, code, msg, hdrs, fp) > urllib.error.HTTPError: HTTP Error 404: Not FoundTraceback (most recent call last): > File "tempAdv.py", line 72, in > plt.show() > File "/usr/lib/python3/dist-packages/matplotlib/pyplot.py", line 244, in showreturn _show(*args, **kw) > File "/usr/lib/python3/dist-packages/matplotlib/backend_bases.py", line 192, in __call__ > self.mainloop() > > > File "/usr/lib/python3/dist-packages/matplotlib/backends/backend_tkagg.py", line 74, in mainloop > > Tk.mainloop() > > File "/usr/lib/python3.5/tkinter/__init__.py", line 408, in mainloop > _default_root.tk.mainloop(n) > > AttributeError: 'NoneType' object has no attribute 'tk > > > > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users > > -- The best ruler, when he finishes his tasks and completes his affairs, the people say ?It all happened naturally? - Te Tao Ch'ing -------------- next part -------------- An HTML attachment was scrubbed... URL: From winash12 at gmail.com Fri Oct 14 07:15:01 2016 From: winash12 at gmail.com (ashwinD12 .) Date: Fri, 14 Oct 2016 16:45:01 +0530 Subject: [Matplotlib-users] Unable to display data using matplotlib In-Reply-To: References: Message-ID: Thanks for your response. The code as shown in that URL apparently has worked and the plot has been shown. I am not trying to modify the source code and as I understand the code it is using matplotlib and cartopy. So the question is there some backend matplotlib setting (such as the URL you mentioned) that needs to be set in order to get this to work ? My first understanding was since the error is related to Tk and matplotlib there is something I am not doing right such as what is described here - http://matplotlib.org/examples/user_interfaces/embedding_in_tk2.html ? Ashwin. On Fri, Oct 14, 2016 at 4:21 PM, Joy merwin monteiro wrote: > The end of the error traceback says: > > " > > raise HTTPError(req.full_url, code, msg, hdrs, fp) > urllib.error.HTTPError: HTTP Error 404: Not Found > " > > Looks like the code is trying to access an online resource that is not available. > > Don't think it has anything to do with matplotlib. > > Joy > > > On Fri, Oct 14, 2016 at 11:59 AM, ashwinD12 . wrote: > >> Hello, >> I am using this example from this cookbook - >> http://nbviewer.jupyter.org/github/unidata/notebook-gallery/ >> blob/master/notebooks/850mb_Temperature_Advection.ipynb >> >> and I get this exception when I run it - >> >> I am wondering whether I need to matplotlib.use('Tkagg') which I did add >> but does not fix the problem. >> >> File "/usr/lib/python3/dist-packages/matplotlib/backends/backend_agg.py", line 474, in draw >> self.figure.draw(self.renderer)File "/usr/lib/python3/dist-packages/matplotlib/artist.py", line 61, in draw_wrapper >> draw(artist, renderer, *args, **kwargs)File "/usr/lib/python3/dist-packages/matplotlib/figure.py", line 1159, in draw >> func(*args) >> File "/usr/lib/python3/dist-packages/matplotlib/artist.py", line 61, in draw_wrapper >> draw(artist, renderer, *args, **kwargs) >> File "/usr/local/lib/python3.5/dist-packages/cartopy/mpl/geoaxes.py", line 355, in draw >> inframe=inframe)File "/usr/lib/python3/dist-packages/matplotlib/artist.py", line 61, in draw_wrapper >> draw(artist, renderer, *args, **kwargs)File "/usr/lib/python3/dist-packages/matplotlib/axes/_base.py", line 2324, in draw >> a.draw(renderer)File "/usr/lib/python3/dist-packages/matplotlib/artist.py", line 61, in draw_wrapper >> draw(artist, renderer, *args, **kwargs) >> File "/usr/local/lib/python3.5/dist-packages/cartopy/mpl/feature_artist.py", line 103, in draw >> geoms = self._feature.intersecting_geometries(extent)File "/usr/local/lib/python3.5/dist-packages/cartopy/feature.py", line 113, in intersecting_geometriesreturn (geom for geom in self.geometries() if >> File "/usr/local/lib/python3.5/dist-packages/cartopy/feature.py", line 180, in geometries >> name=self.name) >> File "/usr/local/lib/python3.5/dist-packages/cartopy/io/shapereader.py", line 246, in natural_earthreturn ne_downloader.path(format_dict)File "/usr/local/lib/python3.5/dist-packages/cartopy/io/__init__.py", line 223, in path >> result_path = self.acquire_resource(target_path, format_dict)File "/usr/local/lib/python3.5/dist-packages/cartopy/io/shapereader.py", line 301, in acquire_resource >> shapefile_online = self._urlopen(url)File "/usr/local/lib/python3.5/dist-packages/cartopy/io/__init__.py", line 262, in _urlopenreturn urlopen(url)File "/usr/lib/python3.5/urllib/request.py", line 163, in urlopenreturn opener.open(url, data, timeout)File "/usr/lib/python3.5/urllib/request.py", line 472, in open >> response = meth(req, response)File "/usr/lib/python3.5/urllib/request.py", line 582, in http_response'http', request, response, code, msg, hdrs)File "/usr/lib/python3.5/urllib/request.py", line 504, in error >> result = self._call_chain(*args)File "/usr/lib/python3.5/urllib/request.py", line 444, in _call_chain >> result = func(*args)File "/usr/lib/python3.5/urllib/request.py", line 696, in http_error_302return self.parent.open(new, timeout=req.timeout)File "/usr/lib/python3.5/urllib/request.py", line 472, in open >> response = meth(req, response) >> File "/usr/lib/python3.5/urllib/request.py", line 582, in http_response'http', request, response, code, msg, hdrs) >> File "/usr/lib/python3.5/urllib/request.py", line 510, in errorreturn self._call_chain(*args)File "/usr/lib/python3.5/urllib/request.py", line 444, in _call_chain >> result = func(*args) >> File "/usr/lib/python3.5/urllib/request.py", line 590, in http_error_default >> raise HTTPError(req.full_url, code, msg, hdrs, fp) >> urllib.error.HTTPError: HTTP Error 404: Not FoundTraceback (most recent call last): >> File "tempAdv.py", line 72, in >> plt.show() >> File "/usr/lib/python3/dist-packages/matplotlib/pyplot.py", line 244, in showreturn _show(*args, **kw) >> File "/usr/lib/python3/dist-packages/matplotlib/backend_bases.py", line 192, in __call__ >> self.mainloop() >> >> >> File "/usr/lib/python3/dist-packages/matplotlib/backends/backend_tkagg.py", line 74, in mainloop >> >> Tk.mainloop() >> >> File "/usr/lib/python3.5/tkinter/__init__.py", line 408, in mainloop >> _default_root.tk.mainloop(n) >> >> AttributeError: 'NoneType' object has no attribute 'tk >> >> >> >> _______________________________________________ >> Matplotlib-users mailing list >> Matplotlib-users at python.org >> https://mail.python.org/mailman/listinfo/matplotlib-users >> >> > > > -- > The best ruler, when he finishes his > tasks and completes his affairs, > the people say > ?It all happened naturally? > > - Te Tao Ch'ing > -------------- next part -------------- An HTML attachment was scrubbed... URL: From winash12 at gmail.com Fri Oct 14 07:42:41 2016 From: winash12 at gmail.com (ashwinD12 .) Date: Fri, 14 Oct 2016 17:12:41 +0530 Subject: [Matplotlib-users] Unable to display data using matplotlib In-Reply-To: References: Message-ID: Andrew - you are so right ! I was using an older version and now after having upgraded to 0.14.2 I can see a beautiful matplotlib + cartopy plot and thanks for setting me in the right direction. On Fri, Oct 14, 2016 at 4:57 PM, Andrew Dawson < andrew.dawson at physics.ox.ac.uk> wrote: > I think this is a 404 error coming from cartopy as it tries to download > the country/state/province borders. This was a known issue in cartopy, > which has been resolved in later releases. Which version of cartopy are you > using? You can check with `python -c "import cartopy; > print(cartopy.__version__)"`. > > On 14 October 2016 at 12:15, ashwinD12 . wrote: > >> Thanks for your response. >> >> The code as shown in that URL apparently has worked and the plot has been >> shown. I am not trying to modify the source code and as I understand the >> code it is using matplotlib and cartopy. So the question is there some >> backend matplotlib setting (such as the URL you mentioned) that needs to be >> set in order to get this to work ? >> >> My first understanding was since the error is related to Tk and >> matplotlib there is something I am not doing right such as what is >> described here - http://matplotlib.org/examples >> /user_interfaces/embedding_in_tk2.html ? >> >> Ashwin. >> >> On Fri, Oct 14, 2016 at 4:21 PM, Joy merwin monteiro < >> joy.merwin at gmail.com> wrote: >> >>> The end of the error traceback says: >>> >>> " >>> >>> raise HTTPError(req.full_url, code, msg, hdrs, fp) >>> urllib.error.HTTPError: HTTP Error 404: Not Found >>> " >>> >>> Looks like the code is trying to access an online resource that is not available. >>> >>> Don't think it has anything to do with matplotlib. >>> >>> Joy >>> >>> >>> On Fri, Oct 14, 2016 at 11:59 AM, ashwinD12 . >>> wrote: >>> >>>> Hello, >>>> I am using this example from this cookbook - >>>> http://nbviewer.jupyter.org/github/unidata/notebook-gallery/ >>>> blob/master/notebooks/850mb_Temperature_Advection.ipynb >>>> >>>> and I get this exception when I run it - >>>> >>>> I am wondering whether I need to matplotlib.use('Tkagg') which I did >>>> add but does not fix the problem. >>>> >>>> File "/usr/lib/python3/dist-packages/matplotlib/backends/backend_agg.py", line 474, in draw >>>> self.figure.draw(self.renderer)File "/usr/lib/python3/dist-packages/matplotlib/artist.py", line 61, in draw_wrapper >>>> draw(artist, renderer, *args, **kwargs)File "/usr/lib/python3/dist-packages/matplotlib/figure.py", line 1159, in draw >>>> func(*args) >>>> File "/usr/lib/python3/dist-packages/matplotlib/artist.py", line 61, in draw_wrapper >>>> draw(artist, renderer, *args, **kwargs) >>>> File "/usr/local/lib/python3.5/dist-packages/cartopy/mpl/geoaxes.py", line 355, in draw >>>> inframe=inframe)File "/usr/lib/python3/dist-packages/matplotlib/artist.py", line 61, in draw_wrapper >>>> draw(artist, renderer, *args, **kwargs)File "/usr/lib/python3/dist-packages/matplotlib/axes/_base.py", line 2324, in draw >>>> a.draw(renderer)File "/usr/lib/python3/dist-packages/matplotlib/artist.py", line 61, in draw_wrapper >>>> draw(artist, renderer, *args, **kwargs) >>>> File "/usr/local/lib/python3.5/dist-packages/cartopy/mpl/feature_artist.py", line 103, in draw >>>> geoms = self._feature.intersecting_geometries(extent)File "/usr/local/lib/python3.5/dist-packages/cartopy/feature.py", line 113, in intersecting_geometriesreturn (geom for geom in self.geometries() if >>>> File "/usr/local/lib/python3.5/dist-packages/cartopy/feature.py", line 180, in geometries >>>> name=self.name) >>>> File "/usr/local/lib/python3.5/dist-packages/cartopy/io/shapereader.py", line 246, in natural_earthreturn ne_downloader.path(format_dict)File "/usr/local/lib/python3.5/dist-packages/cartopy/io/__init__.py", line 223, in path >>>> result_path = self.acquire_resource(target_path, format_dict)File "/usr/local/lib/python3.5/dist-packages/cartopy/io/shapereader.py", line 301, in acquire_resource >>>> shapefile_online = self._urlopen(url)File "/usr/local/lib/python3.5/dist-packages/cartopy/io/__init__.py", line 262, in _urlopenreturn urlopen(url)File "/usr/lib/python3.5/urllib/request.py", line 163, in urlopenreturn opener.open(url, data, timeout)File "/usr/lib/python3.5/urllib/request.py", line 472, in open >>>> response = meth(req, response)File "/usr/lib/python3.5/urllib/request.py", line 582, in http_response'http', request, response, code, msg, hdrs)File "/usr/lib/python3.5/urllib/request.py", line 504, in error >>>> result = self._call_chain(*args)File "/usr/lib/python3.5/urllib/request.py", line 444, in _call_chain >>>> result = func(*args)File "/usr/lib/python3.5/urllib/request.py", line 696, in http_error_302return self.parent.open(new, timeout=req.timeout)File "/usr/lib/python3.5/urllib/request.py", line 472, in open >>>> response = meth(req, response) >>>> File "/usr/lib/python3.5/urllib/request.py", line 582, in http_response'http', request, response, code, msg, hdrs) >>>> File "/usr/lib/python3.5/urllib/request.py", line 510, in errorreturn self._call_chain(*args)File "/usr/lib/python3.5/urllib/request.py", line 444, in _call_chain >>>> result = func(*args) >>>> File "/usr/lib/python3.5/urllib/request.py", line 590, in http_error_default >>>> raise HTTPError(req.full_url, code, msg, hdrs, fp) >>>> urllib.error.HTTPError: HTTP Error 404: Not FoundTraceback (most recent call last): >>>> File "tempAdv.py", line 72, in >>>> plt.show() >>>> File "/usr/lib/python3/dist-packages/matplotlib/pyplot.py", line 244, in showreturn _show(*args, **kw) >>>> File "/usr/lib/python3/dist-packages/matplotlib/backend_bases.py", line 192, in __call__ >>>> self.mainloop() >>>> >>>> >>>> File "/usr/lib/python3/dist-packages/matplotlib/backends/backend_tkagg.py", line 74, in mainloop >>>> >>>> Tk.mainloop() >>>> >>>> File "/usr/lib/python3.5/tkinter/__init__.py", line 408, in mainloop >>>> _default_root.tk.mainloop(n) >>>> >>>> AttributeError: 'NoneType' object has no attribute 'tk >>>> >>>> >>>> >>>> _______________________________________________ >>>> Matplotlib-users mailing list >>>> Matplotlib-users at python.org >>>> https://mail.python.org/mailman/listinfo/matplotlib-users >>>> >>>> >>> >>> >>> -- >>> The best ruler, when he finishes his >>> tasks and completes his affairs, >>> the people say >>> ?It all happened naturally? >>> >>> - Te Tao Ch'ing >>> >> >> >> _______________________________________________ >> Matplotlib-users mailing list >> Matplotlib-users at python.org >> https://mail.python.org/mailman/listinfo/matplotlib-users >> >> > > > -- > Dr Andrew Dawson > Atmospheric, Oceanic & Planetary Physics > Clarendon Laboratory > Parks Road > Oxford OX1 3PU, UK > Tel: +44 (0)1865 282352 > Email: andrew.dawson at physics.ox.ac.uk > Web Site: http://www2.physics.ox.ac.uk/contacts/people/dawson > -------------- next part -------------- An HTML attachment was scrubbed... URL: From andrew.dawson at physics.ox.ac.uk Fri Oct 14 07:27:19 2016 From: andrew.dawson at physics.ox.ac.uk (Andrew Dawson) Date: Fri, 14 Oct 2016 12:27:19 +0100 Subject: [Matplotlib-users] Unable to display data using matplotlib In-Reply-To: References: Message-ID: I think this is a 404 error coming from cartopy as it tries to download the country/state/province borders. This was a known issue in cartopy, which has been resolved in later releases. Which version of cartopy are you using? You can check with `python -c "import cartopy; print(cartopy.__version__)"`. On 14 October 2016 at 12:15, ashwinD12 . wrote: > Thanks for your response. > > The code as shown in that URL apparently has worked and the plot has been > shown. I am not trying to modify the source code and as I understand the > code it is using matplotlib and cartopy. So the question is there some > backend matplotlib setting (such as the URL you mentioned) that needs to be > set in order to get this to work ? > > My first understanding was since the error is related to Tk and > matplotlib there is something I am not doing right such as what is > described here - http://matplotlib.org/examples/user_interfaces/ > embedding_in_tk2.html ? > > Ashwin. > > On Fri, Oct 14, 2016 at 4:21 PM, Joy merwin monteiro > wrote: > >> The end of the error traceback says: >> >> " >> >> raise HTTPError(req.full_url, code, msg, hdrs, fp) >> urllib.error.HTTPError: HTTP Error 404: Not Found >> " >> >> Looks like the code is trying to access an online resource that is not available. >> >> Don't think it has anything to do with matplotlib. >> >> Joy >> >> >> On Fri, Oct 14, 2016 at 11:59 AM, ashwinD12 . wrote: >> >>> Hello, >>> I am using this example from this cookbook - >>> http://nbviewer.jupyter.org/github/unidata/notebook-gallery/ >>> blob/master/notebooks/850mb_Temperature_Advection.ipynb >>> >>> and I get this exception when I run it - >>> >>> I am wondering whether I need to matplotlib.use('Tkagg') which I did add >>> but does not fix the problem. >>> >>> File "/usr/lib/python3/dist-packages/matplotlib/backends/backend_agg.py", line 474, in draw >>> self.figure.draw(self.renderer)File "/usr/lib/python3/dist-packages/matplotlib/artist.py", line 61, in draw_wrapper >>> draw(artist, renderer, *args, **kwargs)File "/usr/lib/python3/dist-packages/matplotlib/figure.py", line 1159, in draw >>> func(*args) >>> File "/usr/lib/python3/dist-packages/matplotlib/artist.py", line 61, in draw_wrapper >>> draw(artist, renderer, *args, **kwargs) >>> File "/usr/local/lib/python3.5/dist-packages/cartopy/mpl/geoaxes.py", line 355, in draw >>> inframe=inframe)File "/usr/lib/python3/dist-packages/matplotlib/artist.py", line 61, in draw_wrapper >>> draw(artist, renderer, *args, **kwargs)File "/usr/lib/python3/dist-packages/matplotlib/axes/_base.py", line 2324, in draw >>> a.draw(renderer)File "/usr/lib/python3/dist-packages/matplotlib/artist.py", line 61, in draw_wrapper >>> draw(artist, renderer, *args, **kwargs) >>> File "/usr/local/lib/python3.5/dist-packages/cartopy/mpl/feature_artist.py", line 103, in draw >>> geoms = self._feature.intersecting_geometries(extent)File "/usr/local/lib/python3.5/dist-packages/cartopy/feature.py", line 113, in intersecting_geometriesreturn (geom for geom in self.geometries() if >>> File "/usr/local/lib/python3.5/dist-packages/cartopy/feature.py", line 180, in geometries >>> name=self.name) >>> File "/usr/local/lib/python3.5/dist-packages/cartopy/io/shapereader.py", line 246, in natural_earthreturn ne_downloader.path(format_dict)File "/usr/local/lib/python3.5/dist-packages/cartopy/io/__init__.py", line 223, in path >>> result_path = self.acquire_resource(target_path, format_dict)File "/usr/local/lib/python3.5/dist-packages/cartopy/io/shapereader.py", line 301, in acquire_resource >>> shapefile_online = self._urlopen(url)File "/usr/local/lib/python3.5/dist-packages/cartopy/io/__init__.py", line 262, in _urlopenreturn urlopen(url)File "/usr/lib/python3.5/urllib/request.py", line 163, in urlopenreturn opener.open(url, data, timeout)File "/usr/lib/python3.5/urllib/request.py", line 472, in open >>> response = meth(req, response)File "/usr/lib/python3.5/urllib/request.py", line 582, in http_response'http', request, response, code, msg, hdrs)File "/usr/lib/python3.5/urllib/request.py", line 504, in error >>> result = self._call_chain(*args)File "/usr/lib/python3.5/urllib/request.py", line 444, in _call_chain >>> result = func(*args)File "/usr/lib/python3.5/urllib/request.py", line 696, in http_error_302return self.parent.open(new, timeout=req.timeout)File "/usr/lib/python3.5/urllib/request.py", line 472, in open >>> response = meth(req, response) >>> File "/usr/lib/python3.5/urllib/request.py", line 582, in http_response'http', request, response, code, msg, hdrs) >>> File "/usr/lib/python3.5/urllib/request.py", line 510, in errorreturn self._call_chain(*args)File "/usr/lib/python3.5/urllib/request.py", line 444, in _call_chain >>> result = func(*args) >>> File "/usr/lib/python3.5/urllib/request.py", line 590, in http_error_default >>> raise HTTPError(req.full_url, code, msg, hdrs, fp) >>> urllib.error.HTTPError: HTTP Error 404: Not FoundTraceback (most recent call last): >>> File "tempAdv.py", line 72, in >>> plt.show() >>> File "/usr/lib/python3/dist-packages/matplotlib/pyplot.py", line 244, in showreturn _show(*args, **kw) >>> File "/usr/lib/python3/dist-packages/matplotlib/backend_bases.py", line 192, in __call__ >>> self.mainloop() >>> >>> >>> File "/usr/lib/python3/dist-packages/matplotlib/backends/backend_tkagg.py", line 74, in mainloop >>> >>> Tk.mainloop() >>> >>> File "/usr/lib/python3.5/tkinter/__init__.py", line 408, in mainloop >>> _default_root.tk.mainloop(n) >>> >>> AttributeError: 'NoneType' object has no attribute 'tk >>> >>> >>> >>> _______________________________________________ >>> Matplotlib-users mailing list >>> Matplotlib-users at python.org >>> https://mail.python.org/mailman/listinfo/matplotlib-users >>> >>> >> >> >> -- >> The best ruler, when he finishes his >> tasks and completes his affairs, >> the people say >> ?It all happened naturally? >> >> - Te Tao Ch'ing >> > > > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users at python.org > https://mail.python.org/mailman/listinfo/matplotlib-users > > -- Dr Andrew Dawson Atmospheric, Oceanic & Planetary Physics Clarendon Laboratory Parks Road Oxford OX1 3PU, UK Tel: +44 (0)1865 282352 Email: andrew.dawson at physics.ox.ac.uk Web Site: http://www2.physics.ox.ac.uk/contacts/people/dawson -------------- next part -------------- An HTML attachment was scrubbed... URL: From pmhobson at gmail.com Thu Oct 20 12:48:47 2016 From: pmhobson at gmail.com (Paul Hobson) Date: Thu, 20 Oct 2016 09:48:47 -0700 Subject: [Matplotlib-users] MEP28 (Draft) Boxplots Enhancements and Simplifications Message-ID: Hello everyone, We are soliciting feedback and comments on a new MEP (#28) proposing some high-level changes to the boxplot API has been released in *draft* form here: http://matplotlib.org/devdocs/devel/MEP/MEP28.html The goals of the MEP are as follows: 1) Deprecate and remove seldom used*, difficult-to-use, and redundant** kwargs 2) Synchronize parameter names between `boxplot` and `bxp` 3a) Allow user-defined pre- and post-stat calculation data transformation functions to `boxplot` OR 3b) Allow users to pass their own statistics function (with parameters) to ` boxplot` The functionality of #3a/3b is currently available to users if they go through the `bxp` function instead of the `boxplot` function. However, this isn't much help for users of downstream libraries like pandas and seaborn. The goal of #3 in general is to allow the following in e.g., seaborn: import seaborn tips = seaborn.load_data('tips')g = seaborn.factorplot(x="day", y="total_bill", hue="sex", data=tips, kind='box', palette="PRGn", shownotches=True, statfxn=my_box_stats, bootstrap_method='BCA', whisker_method='dynamic') This kind of flexibility would also be available under the current pandas API. This MEP is very much still a draft and has not been accepted. If you have opinions about the proposed changes (positive or negative) we're all ears. -Paul H. * It is our perception that the usermedians and conf_intervals parameters don't get much use and are fairly difficult use. Additionally, the logic that handles and validates them is quite complex and difficult to maintain. ** The sym parameter is redundant with the flierprops parameter, which has been around for a few releases now. The code that reconciles the default marker style with both of these inputs is also complex and difficult to maintain. -------------- next part -------------- An HTML attachment was scrubbed... URL: From pmhobson at gmail.com Sun Oct 23 12:11:20 2016 From: pmhobson at gmail.com (Paul Hobson) Date: Sun, 23 Oct 2016 09:11:20 -0700 Subject: [Matplotlib-users] MEP28 (Draft) Boxplots Enhancements and Simplifications In-Reply-To: References: Message-ID: Bumping this to see if the weekend crowd has any strong feelings about the state of the boxplot API and how you'd like to see it (not) change. -p On Thu, Oct 20, 2016 at 9:48 AM, Paul Hobson wrote: > Hello everyone, > > We are soliciting feedback and comments on a new MEP (#28) proposing some > high-level changes to the boxplot API has been released in *draft* form > here: > > http://matplotlib.org/devdocs/devel/MEP/MEP28.html > > The goals of the MEP are as follows: > 1) Deprecate and remove seldom used*, difficult-to-use, and redundant** > kwargs > 2) Synchronize parameter names between `boxplot` and `bxp` > 3a) Allow user-defined pre- and post-stat calculation data transformation > functions to `boxplot` > OR > 3b) Allow users to pass their own statistics function (with parameters) to > `boxplot` > > The functionality of #3a/3b is currently available to users if they go > through the `bxp` function instead of the `boxplot` function. However, > this isn't much help for users of downstream libraries like pandas and > seaborn. The goal of #3 in general is to allow the following in e.g., > seaborn: > > import seaborn > tips = seaborn.load_data('tips')g = seaborn.factorplot(x="day", y="total_bill", hue="sex", data=tips, > kind='box', palette="PRGn", shownotches=True, > statfxn=my_box_stats, bootstrap_method='BCA', > whisker_method='dynamic') > > > This kind of flexibility would also be available under the current pandas > API. > > This MEP is very much still a draft and has not been accepted. If you have > opinions about the proposed changes (positive or negative) we're all ears. > > -Paul H. > > * It is our perception that the usermedians and conf_intervals parameters > don't get much use and are fairly difficult use. Additionally, the logic > that handles and validates them is quite complex and difficult to maintain. > > ** The sym parameter is redundant with the flierprops parameter, which > has been around for a few releases now. The code that reconciles the > default marker style with both of these inputs is also complex and > difficult to maintain. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jni.soma at gmail.com Mon Oct 31 06:32:42 2016 From: jni.soma at gmail.com (Juan Nunez-Iglesias) Date: Mon, 31 Oct 2016 21:32:42 +1100 Subject: [Matplotlib-users] Spines and styles Message-ID: Hi all, Is there a way to remove the top and right axis spines in a Matplotlib Style file? Thanks, Juan. -------------- next part -------------- An HTML attachment was scrubbed... URL: From tcaswell at gmail.com Mon Oct 31 09:53:46 2016 From: tcaswell at gmail.com (Thomas Caswell) Date: Mon, 31 Oct 2016 13:53:46 +0000 Subject: [Matplotlib-users] Spines and styles In-Reply-To: References: Message-ID: The 'axes.spine.SIDE' rcparams. This went in for 1.5.0 via https://github.com/matplotlib/matplotlib/pull/4218 Tom On Mon, Oct 31, 2016 at 6:33 AM Juan Nunez-Iglesias wrote: > Hi all, > > Is there a way to remove the top and right axis spines in a Matplotlib > Style file? > > Thanks, > > Juan. > _______________________________________________ > 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.soma at gmail.com Mon Oct 31 19:10:18 2016 From: jni.soma at gmail.com (Juan Nunez-Iglesias) Date: Tue, 1 Nov 2016 10:10:18 +1100 Subject: [Matplotlib-users] Spines and styles In-Reply-To: References: Message-ID: Thanks Tom! These don't appear in the example rcparams file in the documentation, here: http://matplotlib.org/users/customizing.html Would a PR be welcomed with example settings? To clarify, would this be a correctly-formatted setting? axes.spine.left = True axes.spine.bottom = True axes.spine.top = False axes.spine.right = False and correspondingly in the style file: axes.spine.left: true axes.spine.bottom: true axes.spine.top: false axes.spine.right: false ? Thanks, Juan. On Tue, Nov 1, 2016 at 12:53 AM, Thomas Caswell wrote: > The 'axes.spine.SIDE' rcparams. > > This went in for 1.5.0 via https://github.com/matplotlib/matplotlib/pull/ > 4218 > > Tom > > On Mon, Oct 31, 2016 at 6:33 AM Juan Nunez-Iglesias > wrote: > >> Hi all, >> >> Is there a way to remove the top and right axis spines in a Matplotlib >> Style file? >> >> Thanks, >> >> Juan. >> _______________________________________________ >> Matplotlib-users mailing list >> Matplotlib-users at python.org >> https://mail.python.org/mailman/listinfo/matplotlib-users >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tcaswell at gmail.com Mon Oct 31 19:43:27 2016 From: tcaswell at gmail.com (Thomas Caswell) Date: Mon, 31 Oct 2016 23:43:27 +0000 Subject: [Matplotlib-users] Spines and styles In-Reply-To: References: Message-ID: mpl.rcParams['axies.spine.left'] = True and such. The syntax for rcparams/style file is correct. Yes, a documentation PR would be (is always)) welcome :) Tom On Mon, Oct 31, 2016 at 7:10 PM Juan Nunez-Iglesias wrote: > Thanks Tom! > > These don't appear in the example rcparams file in the documentation, here: > http://matplotlib.org/users/customizing.html > > Would a PR be welcomed with example settings? > > To clarify, would this be a correctly-formatted setting? > > axes.spine.left = True > axes.spine.bottom = True > axes.spine.top = False > axes.spine.right = False > > and correspondingly in the style file: > > axes.spine.left: true > axes.spine.bottom: true > axes.spine.top: false > axes.spine.right: false > > ? > > Thanks, > > Juan. > > On Tue, Nov 1, 2016 at 12:53 AM, Thomas Caswell > wrote: > > The 'axes.spine.SIDE' rcparams. > > This went in for 1.5.0 via > https://github.com/matplotlib/matplotlib/pull/4218 > > Tom > > On Mon, Oct 31, 2016 at 6:33 AM Juan Nunez-Iglesias > wrote: > > Hi all, > > Is there a way to remove the top and right axis spines in a Matplotlib > Style file? > > Thanks, > > Juan. > _______________________________________________ > 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.soma at gmail.com Mon Oct 31 19:48:52 2016 From: jni.soma at gmail.com (Juan Nunez-Iglesias) Date: Tue, 1 Nov 2016 10:48:52 +1100 Subject: [Matplotlib-users] Spines and styles In-Reply-To: References: Message-ID: Hmmm: Bad key "axes.spine.top" on line 12 in /Users/nuneziglesiasj/projects/elegant-scipy/style/elegant.mplstyle. You probably need to get an updated matplotlibrc file from http://github.com/matplotlib/matplotlib/blob/master/matplotlibrc.template or from the matplotlib source distribution I'm on 1.5.3... On Tue, Nov 1, 2016 at 10:43 AM, Thomas Caswell wrote: > mpl.rcParams['axies.spine.left'] = True > > and such. The syntax for rcparams/style file is correct. > > Yes, a documentation PR would be (is always)) welcome :) > > Tom > > On Mon, Oct 31, 2016 at 7:10 PM Juan Nunez-Iglesias > wrote: > >> Thanks Tom! >> >> These don't appear in the example rcparams file in the documentation, >> here: >> http://matplotlib.org/users/customizing.html >> >> Would a PR be welcomed with example settings? >> >> To clarify, would this be a correctly-formatted setting? >> >> axes.spine.left = True >> axes.spine.bottom = True >> axes.spine.top = False >> axes.spine.right = False >> >> and correspondingly in the style file: >> >> axes.spine.left: true >> axes.spine.bottom: true >> axes.spine.top: false >> axes.spine.right: false >> >> ? >> >> Thanks, >> >> Juan. >> >> On Tue, Nov 1, 2016 at 12:53 AM, Thomas Caswell >> wrote: >> >> The 'axes.spine.SIDE' rcparams. >> >> This went in for 1.5.0 via https://github.com/matplotlib/matplotlib/pull/ >> 4218 >> >> Tom >> >> On Mon, Oct 31, 2016 at 6:33 AM Juan Nunez-Iglesias >> wrote: >> >> Hi all, >> >> Is there a way to remove the top and right axis spines in a Matplotlib >> Style file? >> >> Thanks, >> >> Juan. >> _______________________________________________ >> Matplotlib-users mailing list >> Matplotlib-users at python.org >> https://mail.python.org/mailman/listinfo/matplotlib-users >> >> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From tcaswell at gmail.com Mon Oct 31 19:50:34 2016 From: tcaswell at gmail.com (Thomas Caswell) Date: Mon, 31 Oct 2016 23:50:34 +0000 Subject: [Matplotlib-users] Spines and styles In-Reply-To: References: Message-ID: Sorry, it is spines (plural) On Mon, Oct 31, 2016 at 7:49 PM Juan Nunez-Iglesias wrote: > Hmmm: > > Bad key "axes.spine.top" on line 12 in > /Users/nuneziglesiasj/projects/elegant-scipy/style/elegant.mplstyle. > You probably need to get an updated matplotlibrc file from > http://github.com/matplotlib/matplotlib/blob/master/matplotlibrc.template > or from the matplotlib source distribution > > I'm on 1.5.3... > > On Tue, Nov 1, 2016 at 10:43 AM, Thomas Caswell > wrote: > > mpl.rcParams['axies.spine.left'] = True > > and such. The syntax for rcparams/style file is correct. > > Yes, a documentation PR would be (is always)) welcome :) > > Tom > > On Mon, Oct 31, 2016 at 7:10 PM Juan Nunez-Iglesias > wrote: > > Thanks Tom! > > These don't appear in the example rcparams file in the documentation, here: > http://matplotlib.org/users/customizing.html > > Would a PR be welcomed with example settings? > > To clarify, would this be a correctly-formatted setting? > > axes.spine.left = True > axes.spine.bottom = True > axes.spine.top = False > axes.spine.right = False > > and correspondingly in the style file: > > axes.spine.left: true > axes.spine.bottom: true > axes.spine.top: false > axes.spine.right: false > > ? > > Thanks, > > Juan. > > On Tue, Nov 1, 2016 at 12:53 AM, Thomas Caswell > wrote: > > The 'axes.spine.SIDE' rcparams. > > This went in for 1.5.0 via > https://github.com/matplotlib/matplotlib/pull/4218 > > Tom > > On Mon, Oct 31, 2016 at 6:33 AM Juan Nunez-Iglesias > wrote: > > Hi all, > > Is there a way to remove the top and right axis spines in a Matplotlib > Style file? > > Thanks, > > Juan. > _______________________________________________ > 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 rohbhot at gmail.com Mon Oct 31 08:58:48 2016 From: rohbhot at gmail.com (Rohan Bhojannawar) Date: Mon, 31 Oct 2016 12:58:48 -0000 Subject: [Matplotlib-users] Version issue Message-ID: I'm using OpenCV with Ubuntu 16.04 My matplotlib is installed only in python 2.7. What do you suggest I do for me to use the same library with another version of python viz. python 3.5 installed in my system ? My .py files run if properly using matplotlib if I type python2.7 instead of python3 in terminal. Kindly suggest. -------------- next part -------------- An HTML attachment was scrubbed... URL: