You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(3) |
Jun
|
Jul
|
Aug
(12) |
Sep
(12) |
Oct
(56) |
Nov
(65) |
Dec
(37) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(59) |
Feb
(78) |
Mar
(153) |
Apr
(205) |
May
(184) |
Jun
(123) |
Jul
(171) |
Aug
(156) |
Sep
(190) |
Oct
(120) |
Nov
(154) |
Dec
(223) |
2005 |
Jan
(184) |
Feb
(267) |
Mar
(214) |
Apr
(286) |
May
(320) |
Jun
(299) |
Jul
(348) |
Aug
(283) |
Sep
(355) |
Oct
(293) |
Nov
(232) |
Dec
(203) |
2006 |
Jan
(352) |
Feb
(358) |
Mar
(403) |
Apr
(313) |
May
(165) |
Jun
(281) |
Jul
(316) |
Aug
(228) |
Sep
(279) |
Oct
(243) |
Nov
(315) |
Dec
(345) |
2007 |
Jan
(260) |
Feb
(323) |
Mar
(340) |
Apr
(319) |
May
(290) |
Jun
(296) |
Jul
(221) |
Aug
(292) |
Sep
(242) |
Oct
(248) |
Nov
(242) |
Dec
(332) |
2008 |
Jan
(312) |
Feb
(359) |
Mar
(454) |
Apr
(287) |
May
(340) |
Jun
(450) |
Jul
(403) |
Aug
(324) |
Sep
(349) |
Oct
(385) |
Nov
(363) |
Dec
(437) |
2009 |
Jan
(500) |
Feb
(301) |
Mar
(409) |
Apr
(486) |
May
(545) |
Jun
(391) |
Jul
(518) |
Aug
(497) |
Sep
(492) |
Oct
(429) |
Nov
(357) |
Dec
(310) |
2010 |
Jan
(371) |
Feb
(657) |
Mar
(519) |
Apr
(432) |
May
(312) |
Jun
(416) |
Jul
(477) |
Aug
(386) |
Sep
(419) |
Oct
(435) |
Nov
(320) |
Dec
(202) |
2011 |
Jan
(321) |
Feb
(413) |
Mar
(299) |
Apr
(215) |
May
(284) |
Jun
(203) |
Jul
(207) |
Aug
(314) |
Sep
(321) |
Oct
(259) |
Nov
(347) |
Dec
(209) |
2012 |
Jan
(322) |
Feb
(414) |
Mar
(377) |
Apr
(179) |
May
(173) |
Jun
(234) |
Jul
(295) |
Aug
(239) |
Sep
(276) |
Oct
(355) |
Nov
(144) |
Dec
(108) |
2013 |
Jan
(170) |
Feb
(89) |
Mar
(204) |
Apr
(133) |
May
(142) |
Jun
(89) |
Jul
(160) |
Aug
(180) |
Sep
(69) |
Oct
(136) |
Nov
(83) |
Dec
(32) |
2014 |
Jan
(71) |
Feb
(90) |
Mar
(161) |
Apr
(117) |
May
(78) |
Jun
(94) |
Jul
(60) |
Aug
(83) |
Sep
(102) |
Oct
(132) |
Nov
(154) |
Dec
(96) |
2015 |
Jan
(45) |
Feb
(138) |
Mar
(176) |
Apr
(132) |
May
(119) |
Jun
(124) |
Jul
(77) |
Aug
(31) |
Sep
(34) |
Oct
(22) |
Nov
(23) |
Dec
(9) |
2016 |
Jan
(26) |
Feb
(17) |
Mar
(10) |
Apr
(8) |
May
(4) |
Jun
(8) |
Jul
(6) |
Aug
(5) |
Sep
(9) |
Oct
(4) |
Nov
|
Dec
|
2017 |
Jan
(5) |
Feb
(7) |
Mar
(1) |
Apr
(5) |
May
|
Jun
(3) |
Jul
(6) |
Aug
(1) |
Sep
|
Oct
(2) |
Nov
(1) |
Dec
|
2018 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2020 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2025 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
S | M | T | W | T | F | S |
---|---|---|---|---|---|---|
|
1
(8) |
2
(4) |
3
(2) |
4
(9) |
5
(7) |
6
(3) |
7
(6) |
8
(5) |
9
(2) |
10
(7) |
11
(3) |
12
(9) |
13
(2) |
14
(1) |
15
(2) |
16
(2) |
17
(5) |
18
(5) |
19
(8) |
20
(3) |
21
(1) |
22
(6) |
23
(3) |
24
(3) |
25
(2) |
26
(16) |
27
(1) |
28
(1) |
29
(2) |
30
(5) |
|
|
|
|
From: John L. <joh...@sb...> - 2013-04-19 03:03:19
|
Thanks to both Francesco Montesano and Benjamin Root. I have done some reading. And I have made some progress, though I am not quite where I want to be yet. So the problem appears to be that the only backend for which I had suitable Python 3 libraries was agg. It only requires libpng, which I have. I can render a Matplotlib canvas, but it appears that the only output that agg offers is in the form of PNG files to disk. I cannot create a live window on the screen. Reading more, I realize that the way I was getting GUI output previously (with Python 2.7 and Matplotlib 1.1) was through wxPython. Unfortunately, it appears that wxPython's star is fading, and a Python 3-compatible version will not be written. In fact, wxPython hasn't released a new version in nine months. The other choices for Matplotlib GUI output on Linux appear to be through GTK, PySide, and PyQt. I am not familiar with GTK, but I know that it is widely-used. Also, GTK appears to be Python 3-compatible, and so that is where I need to go. I'm going through a trial and error process. Unfortunately, the names of the repositories in Ubuntu are not very helpful. I installed a few GTK and python-gtk related packages that I thought were relevant. On my first build attempt I got no errors, but also, I didn't get a GTKAgg backend. Upon re-reading, I saw that I should modify matplotlib's setup.cfg file to force a GTK build attempt, and to report errors if it fails. That's what it does. In the "optional backend dependencies" section I am not seeing any GTK libraries listed, even though I have installed python-gtk2-dev (2.24.0), python-gobject-2-dev (2.28.6), libgtk2.0-dev (2.24.10), libglib2.0-dev (2.32.3), python-gi-dev (3.2.2), python-gobject-dev (3.2.2), python3-gi (3.2.2), and a few DOZEN packages on which these depend. If anyone knows the way forward from here, I would appreciate your advice. Thanks again. |
From: Michael D. <md...@st...> - 2013-04-18 17:06:14
|
Can you please provide a complete, minimal and self-contained script that reproduces the error? The example below has many undefined variables etc. Cheers, Mike On 04/16/2013 07:09 PM, Christophe Pettus wrote: > # preamble code collecting data > > ind = np.arange(len(table_name)) > > width = 0.35 > > fig = plot.figure(figsize=DEFAULT_FIGURE_SIZE) > ax = fig.add_subplot(111, axisbg='#fafafa', alpha=0.9) > > ax.set_title('Largest Tables') > > ax.set_xlabel('Size (log scale)') > > ax.set_xscale('log') > ax.grid(True) > > ax.xaxis.set_major_formatter(FuncFormatter(magnitude_ticks)) > > dbar = ax.barh(ind, data_size, width, linewidth=0, color='blue', label='Main Data') # exception here > ibar = ax.barh(ind, index_toast_size, width, left=data_size, linewidth=0, color='red', label='Toast/Indexes') > ax.set_yticks(ind + width/2) > ax.set_yticklabels(table_name, fontproperties=xx_small_font) > > ax.legend(loc='lower right', prop=x_small_font) > > plot.tight_layout() > > plot.savefig(REPORT_DIR_PATH + '/table_sizes.pdf') > > plot.close() |
From: Benjamin R. <ben...@ou...> - 2013-04-18 14:36:00
|
On Thu, Apr 18, 2013 at 3:34 AM, John Ladasky <joh...@sb...>wrote: > Hello everyone, > > After not using Matplotlib for over a year, I'm returning to it. > Meanwhile, I have upgraded from Python 2.7 to Python 3.2, and I want to > do all of my software development in Python 3 from now on. > > My OS is Ubuntu 12.04.1. Python 2.7 is still the default Python for > Ubuntu, and many of the Python 3 packages are not offered as official > repositories yet. I downloaded Matplotlib 1.2.1, then built it using > Python 3. Eventually, I got no build error messages, and proceeded to > install. (I always have to pick through dependency problems one error > message at a time. I wish there was a better way. The Matplotlib docs > could be a little better in this respect.) > > When I open a Python3 interpreter, I can import matplotlib. But I am > not seeing ANYTHING with commands like plt.show(). It executes, and > then returns. No output is generated. > > This very short and simple test program of mine used to produce output > with Python 2.7 and Matplotlib 1.1.0. But with Python 3 and Matplolib > 1.2.1, I am getting nothing... > > import numpy as np > import matplotlib.pyplot as plt > > x = np.arange(0, 5, 0.1); > y = np.sin(x) > plt.plot(x, y) > plt.show() > > It runs. No error messages are generated. But I don't get a graph. I > don't even see a graph flicker on to the screen and disappear an instant > later. > > Any advice will be appreciated! > > You will need to make sure you install the gtk packages (both the libraries and the dev packages) *before* building from source. If it can't find the dev packages, then it won't build the interactive backend for it. I can't remember if there are python3 specific packages for gtk (or any other gui for that matter). |
From: Francesco M. <fra...@gm...> - 2013-04-18 09:44:08
|
Hi John, 2013/4/18 John Ladasky <joh...@sb...> > On 04/18/2013 01:01 AM, Francesco Montesano wrote: > >> does plt.savefig('test.png') work? >> > Yes, it does! Thank you, that was a useful hint. Good, than I would say that is a clear sign that you have a non interactive backend. Can you please give use the output of plt.get_backend() ? > > If the figure get saved, it can be that you are using a non interactive >> backend >> > Ugh, the one thing that I never understood about Matplotlib was backends. > So, what am I missing? (Whatever I am missing now, I had it working a > year ago when I was using matplotlib 1.1.0 on Python 2.7.) > This link http://matplotlib.org/faq/usage_faq.html#what-is-a-backend should explain you what a backend is. If you want to use always a specific backend, you should select it in the matplotlibrc file You should have a line like this #backend : TkAgg Just uncomment it and put the backend that you want to use > I have also just tried ipython3. Nothing that I do in the live > interpreter displays any graphs. > > That is not surprising: if matplotlib doesn't use an interactive backend, you can't show the figures, whatever interpreter you use. I hope that now is clearer, Fra ps: try to remember to reply to the list :D |
From: Francesco M. <fra...@gm...> - 2013-04-18 08:02:08
|
Hi John, does plt.savefig('test.png') work? If the figure get saved, it can be that you are using a non interactive backend Cheers Fra 2013/4/18 John Ladasky <joh...@sb...> > Hello everyone, > > After not using Matplotlib for over a year, I'm returning to it. > Meanwhile, I have upgraded from Python 2.7 to Python 3.2, and I want to > do all of my software development in Python 3 from now on. > > My OS is Ubuntu 12.04.1. Python 2.7 is still the default Python for > Ubuntu, and many of the Python 3 packages are not offered as official > repositories yet. I downloaded Matplotlib 1.2.1, then built it using > Python 3. Eventually, I got no build error messages, and proceeded to > install. (I always have to pick through dependency problems one error > message at a time. I wish there was a better way. The Matplotlib docs > could be a little better in this respect.) > > When I open a Python3 interpreter, I can import matplotlib. But I am > not seeing ANYTHING with commands like plt.show(). It executes, and > then returns. No output is generated. > > This very short and simple test program of mine used to produce output > with Python 2.7 and Matplotlib 1.1.0. But with Python 3 and Matplolib > 1.2.1, I am getting nothing... > > import numpy as np > import matplotlib.pyplot as plt > > x = np.arange(0, 5, 0.1); > y = np.sin(x) > plt.plot(x, y) > plt.show() > > It runs. No error messages are generated. But I don't get a graph. I > don't even see a graph flicker on to the screen and disappear an instant > later. > > Any advice will be appreciated! > > > > ------------------------------------------------------------------------------ > Precog is a next-generation analytics platform capable of advanced > analytics on semi-structured data. The platform includes APIs for building > apps and a phenomenal toolset for data science. Developers can use > our toolset for easy data analysis & visualization. Get a free account! > http://www2.precog.com/precogplatform/slashdotnewsletter > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
From: John L. <joh...@sb...> - 2013-04-18 07:34:28
|
Hello everyone, After not using Matplotlib for over a year, I'm returning to it. Meanwhile, I have upgraded from Python 2.7 to Python 3.2, and I want to do all of my software development in Python 3 from now on. My OS is Ubuntu 12.04.1. Python 2.7 is still the default Python for Ubuntu, and many of the Python 3 packages are not offered as official repositories yet. I downloaded Matplotlib 1.2.1, then built it using Python 3. Eventually, I got no build error messages, and proceeded to install. (I always have to pick through dependency problems one error message at a time. I wish there was a better way. The Matplotlib docs could be a little better in this respect.) When I open a Python3 interpreter, I can import matplotlib. But I am not seeing ANYTHING with commands like plt.show(). It executes, and then returns. No output is generated. This very short and simple test program of mine used to produce output with Python 2.7 and Matplotlib 1.1.0. But with Python 3 and Matplolib 1.2.1, I am getting nothing... import numpy as np import matplotlib.pyplot as plt x = np.arange(0, 5, 0.1); y = np.sin(x) plt.plot(x, y) plt.show() It runs. No error messages are generated. But I don't get a graph. I don't even see a graph flicker on to the screen and disappear an instant later. Any advice will be appreciated! |
From: <car...@ya...> - 2013-04-17 19:19:01
|
Hi guys, Im new in matplotlib and having some hard times. From the user point of view everything works fine. I have a window with a button. Pressing the button a new window pops showing the plot. After play with it i click at X to close this window. And click at X again to close the window with the button. BUT im not dropped back to a free prompt. The main window is locked and still running in background. Here goes the important parts of code: import matplotlib import matplotlib.pyplot as Plt from matplotlib.figure import Figure class MainPanel(wx.Panel): def __init__(self, parent): #=None wx.Panel.__init__(self, parent) .... wxpython stuff goes here.... self.btn1.Bind(wx.EVT_BUTTON, self.cplot) .... def cplot(self, event): self.new = NewWindow(self) self.new.cidplot(self) self.new.Show() return class NewWindow(wx.Frame): def __init__(self,event): wx.Frame.__init__(self, None, -1, 'Plot', size=(556, 618)) wx.Frame.CenterOnScreen(self) self.Bind(wx.EVT_CLOSE, self.OnClose) def OnClose(self,event): self.Destroy() def cidplot(self,event): self.fig = Figure() self.axes = self.fig.add_subplot(111) self.canvas = FigCanvas(self, -1, self.fig) self.axes.set_ylabel("Parts") self.axes.set_ylim(0,100) self.axes.grid(True) ....more axes settings... bars = self.axes.bar(left=self.ii, height=self.tt, width=0.2, align='center', alpha=0.8) .... self.canvas.draw() Plt.savefig("Parts.pdf", dpi=300) class MainFrame(wx.Frame): def __init__(self): wx.Frame.__init__(self, None, title = "System Test") self.SetSize((556, 618)) panel = MainPanel(self) self.Show() if __name__ == "__main__": app = wx.App(False) frame = MainFrame() app.MainLoop() I think the problem is at self.fig = Figure() (Same happens if i use Plt.figure()) Im doing something wrong when i create a new window or is at my matplotlib part? Some better way to do it? Thanks in advance. Any ideia is welcome. -- View this message in context: http://matplotlib.1069221.n5.nabble.com/After-close-the-plot-window-the-process-keeps-running-tp40919.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
From: Alexa <ale...@gm...> - 2013-04-17 16:34:56
|
Hi Ben, Thank you for your quick reply. That did the trick! I will into ax.label_outer() , thanks for the suggestion. - Alexa -- View this message in context: http://matplotlib.1069221.n5.nabble.com/Trouble-with-x-axis-labeling-tp40916p40918.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
From: Benjamin R. <ben...@ou...> - 2013-04-17 16:04:23
|
On Wed, Apr 17, 2013 at 11:54 AM, Alexa <ale...@gm...> wrote: > Hello All! > > I searched for my problem and while I found similar questions this seemed > to > be a unique problem. > > I am creating an image that is six vertically stacked subplots and I want > only the axis of the bottom subplot to be labelled. However, as you can see > from the image I attached it's picking the wrong subplot to label. It's as > if the program is not understanding that there is one more plot. If I just > plot five plots than everything works. I'm not sure what is going wrong > with > me code. It would be extremely helpful if someone could take a look. > > xlabel = ["",5000,5500,6000,6500,7000,""] > plt.figure() > > night = (glob.glob('*_sci.txt')) > for i in range(0,len(night)): > # Read in data for each night > wave = np.loadtxt(night[i], usecols=[0]) > flux = np.loadtxt(night[i], usecols=[1]) > # Create subplots > temp = 610 +i > spect = plt.subplot(temp,sharex=True) > # Draw plot > plt.plot(wave, flux, color="green") > plt.subplots_adjust(hspace = 0.001) > spect.set_autoscaley_on(False) > pylab.ylim([0,0.5e-13]) > # Make y tick makers > temp = tic.MaxNLocator(3) > plt.gca().yaxis.set_major_locator(tic.MaxNLocator(prune='lower')) > plt.gca().yaxis.set_major_locator(tic.MaxNLocator(prune='upper')) > spect.yaxis.set_major_locator(temp) > # Get rid of redundant x tick labels > if i < len(night)-1: > plt.setp(spect.get_xticklabels(), visible=False) > > > spect.set_xticklabels(xlabel, minor=False) > plt.xlabel("Observed Wavelength $(\AA)$",fontsize=16) > > > <http://matplotlib.1069221.n5.nabble.com/file/n40916/Example.png> > > > plt.subplot() uses 1-based indexing. So, the first plot you make is "610" because i == 0 in the first iteration. This corresponds to the *last" subplot you actually want (i.e., the bottom one). If you just have a 611 + i, the problem would be fixed. Btw, there is an ax.label_outer() function that would make the code easier to read. Ben Root |
From: Alexa <ale...@gm...> - 2013-04-17 15:54:50
|
Hello All! I searched for my problem and while I found similar questions this seemed to be a unique problem. I am creating an image that is six vertically stacked subplots and I want only the axis of the bottom subplot to be labelled. However, as you can see from the image I attached it's picking the wrong subplot to label. It's as if the program is not understanding that there is one more plot. If I just plot five plots than everything works. I'm not sure what is going wrong with me code. It would be extremely helpful if someone could take a look. xlabel = ["",5000,5500,6000,6500,7000,""] plt.figure() night = (glob.glob('*_sci.txt')) for i in range(0,len(night)): # Read in data for each night wave = np.loadtxt(night[i], usecols=[0]) flux = np.loadtxt(night[i], usecols=[1]) # Create subplots temp = 610 +i spect = plt.subplot(temp,sharex=True) # Draw plot plt.plot(wave, flux, color="green") plt.subplots_adjust(hspace = 0.001) spect.set_autoscaley_on(False) pylab.ylim([0,0.5e-13]) # Make y tick makers temp = tic.MaxNLocator(3) plt.gca().yaxis.set_major_locator(tic.MaxNLocator(prune='lower')) plt.gca().yaxis.set_major_locator(tic.MaxNLocator(prune='upper')) spect.yaxis.set_major_locator(temp) # Get rid of redundant x tick labels if i < len(night)-1: plt.setp(spect.get_xticklabels(), visible=False) spect.set_xticklabels(xlabel, minor=False) plt.xlabel("Observed Wavelength $(\AA)$",fontsize=16) <http://matplotlib.1069221.n5.nabble.com/file/n40916/Example.png> -- View this message in context: http://matplotlib.1069221.n5.nabble.com/Trouble-with-x-axis-labeling-tp40916.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
From: Jae-Joon L. <lee...@gm...> - 2013-04-17 01:11:28
|
The anchored_artists needs improvements and things are still opaque. For now you can do something like below, ``` a = AnchoredSizeBar(ax.transData, 0.1, "test", loc=8, pad=0.1, borderpad=0.1, sep=2, prop=None, frameon=False) rect = a.size_bar._children[0] rect.set_ec("g") ``` `rect` is a patch instance responsible for the bar. By default its height is 0 and facecolor="none". Similarly, the text label can be accessed via `a.txt_label._text`. Regards, -JJ On Wed, Apr 17, 2013 at 1:47 AM, Mathew Topper <mat...@ed...>wrote: > Hi, > > Is there anyway to set the color of an AnchoredSizeBar artist from the > mpl_toolkits.axes_grid.anchored_artists toolkit? > > Thanks, > > Mat > -- > Dr. Mathew Topper > Institute for Energy Systems > School of Engineering > The University of Edinburgh > Faraday Building > The King’s Buildings > Edinburgh EH9 3JL > Tel: +44 (0)131 650 5570 > School fax: +44 (0)131 650 6554 > mat...@ed... <mailto:mat...@ed...> > http://www.see.ed.ac.uk <http://www.see.ed.ac.uk/> > > The University of Edinburgh is a charitable body, registered in > Scotland, with registration number SC005336. > > > > ------------------------------------------------------------------------------ > Precog is a next-generation analytics platform capable of advanced > analytics on semi-structured data. The platform includes APIs for building > apps and a phenomenal toolset for data science. Developers can use > our toolset for easy data analysis & visualization. Get a free account! > http://www2.precog.com/precogplatform/slashdotnewsletter > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
From: Christophe P. <xo...@th...> - 2013-04-16 23:26:40
|
After upgrading to 1.2.1 from 1.1, I'm getting an exception on the below-noted line; any thoughts what might have changed? File "/Users/xof/Documents/Dev/tuneup/reports/tables.py", line 60, in table_sizes dbar = ax.barh(ind, data_size, width, linewidth=0, color='blue', label='Main Data') File "/Users/xof/Documents/Dev/environments/tuneup/lib/python2.6/site-packages/matplotlib/axes.py", line 5021, in barh orientation='horizontal', **kwargs) File "/Users/xof/Documents/Dev/environments/tuneup/lib/python2.6/site-packages/matplotlib/axes.py", line 4901, in bar self.add_patch(r) File "/Users/xof/Documents/Dev/environments/tuneup/lib/python2.6/site-packages/matplotlib/axes.py", line 1570, in add_patch self._update_patch_limits(p) File "/Users/xof/Documents/Dev/environments/tuneup/lib/python2.6/site-packages/matplotlib/axes.py", line 1588, in _update_patch_limits xys = patch.get_patch_transform().transform(vertices) File "/Users/xof/Documents/Dev/environments/tuneup/lib/python2.6/site-packages/matplotlib/patches.py", line 581, in get_patch_transform self._update_patch_transform() File "/Users/xof/Documents/Dev/environments/tuneup/lib/python2.6/site-packages/matplotlib/patches.py", line 577, in _update_patch_transform bbox = transforms.Bbox.from_bounds(x, y, width, height) File "/Users/xof/Documents/Dev/environments/tuneup/lib/python2.6/site-packages/matplotlib/transforms.py", line 786, in from_bounds return Bbox.from_extents(x0, y0, x0 + width, y0 + height) TypeError: unsupported operand type(s) for +: 'NoneType' and 'float' The code is: # preamble code collecting data ind = np.arange(len(table_name)) width = 0.35 fig = plot.figure(figsize=DEFAULT_FIGURE_SIZE) ax = fig.add_subplot(111, axisbg='#fafafa', alpha=0.9) ax.set_title('Largest Tables') ax.set_xlabel('Size (log scale)') ax.set_xscale('log') ax.grid(True) ax.xaxis.set_major_formatter(FuncFormatter(magnitude_ticks)) dbar = ax.barh(ind, data_size, width, linewidth=0, color='blue', label='Main Data') # exception here ibar = ax.barh(ind, index_toast_size, width, left=data_size, linewidth=0, color='red', label='Toast/Indexes') ax.set_yticks(ind + width/2) ax.set_yticklabels(table_name, fontproperties=xx_small_font) ax.legend(loc='lower right', prop=x_small_font) plot.tight_layout() plot.savefig(REPORT_DIR_PATH + '/table_sizes.pdf') plot.close() -- -- Christophe Pettus xo...@th... |
From: Mathew T. <mat...@ed...> - 2013-04-16 16:48:05
|
Hi, Is there anyway to set the color of an AnchoredSizeBar artist from the mpl_toolkits.axes_grid.anchored_artists toolkit? Thanks, Mat -- Dr. Mathew Topper Institute for Energy Systems School of Engineering The University of Edinburgh Faraday Building The King’s Buildings Edinburgh EH9 3JL Tel: +44 (0)131 650 5570 School fax: +44 (0)131 650 6554 mat...@ed... <mailto:mat...@ed...> http://www.see.ed.ac.uk <http://www.see.ed.ac.uk/> The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. |
From: Joe K. <jof...@gm...> - 2013-04-15 11:57:54
|
> Apart from implementing this natively in matplotlib, I was thinking if > I could work around this limitation for our purposes in the following > way: My objects to draw will always sit in a Collection. I could derive > my own Collection class with a draw() method that changes the > linewidth of the collections, taking into account the current > axes.transData and figure.dpi. Using that I should be able to > achieve my goal, right? (given that I restrict myself to plots with > the same scaling in all directions) > > Not to plug one of my own answers, but there's an example of using a callback to keep linewidths in data coordinates here: http://stackoverflow.com/a/15673254/325565 Have a look at the second example in the answer for the callback approach. Using something like ``shapely`` to buffer your lines as the first example does is also an option. Hope that helps a bit anyway, -Joe |
From: Michael W. <wim...@gm...> - 2013-04-15 10:04:54
|
Dear Mike, thanks for your quick answer! Sorry for the late reply, I was away over the weekend. We are using matplotlib to plot two-dimensional and three-dimensional (mostly regular) lattices (it's a physics application), with grid sites being represented by a symbol and links representes by lines. The size of these grids varies strongly (i.e. how many symbols and lines are plotted), and it would be easiest if I could specify linewidths relative to some data coordinate system (e.g. the line width being 5% of the grid spacing). Arguably, this is not what matplotlib is intended for, but sometimes we also want to plot data information on top of that lattice, and then the tools of matplotlib are extremely handy. Also, what I have in mind will always be for a linear-scale, unit aspect-ratio plot, so that the problems you mentioned (log-scale, different scaling in different directions) would not be applicable. In the general case I agree one would need to make the lines actually a filled stroke. I'll nevertheless file a ticket. On github? Apart from implementing this natively in matplotlib, I was thinking if I could work around this limitation for our purposes in the following way: My objects to draw will always sit in a Collection. I could derive my own Collection class with a draw() method that changes the linewidth of the collections, taking into account the current axes.transData and figure.dpi. Using that I should be able to achieve my goal, right? (given that I restrict myself to plots with the same scaling in all directions) Michael 2013/4/12 Michael Droettboom <md...@st...>: > Unfortunately, I don't think there is a way to do this at present. Out > of curiosity, what is the use case? > > I wonder if the best way to do this would be to expose the stroking to > the Python level, so given a line one could get a filled path that is > the stroked line. I'm not sure how else this could work, since the > zooming could be different in each direction, etc., or could even by > log-scaled etc. > > Would you mind creating an issue ticket for this? (Patches welcome, > too, of course, and I can provide pointers if you want to take this on > yourself...) > > Mike > > On 04/12/2013 05:34 AM, Michael Wimmer wrote: >> I have a collection of Patches and Lines that have their coordinates in >> data space, i.e. like in the following example: >> >> >> import matplotlib.pyplot as plt >> import matplotlib.patches as mpatches >> import matplotlib.collections as mcollections >> import matplotlib.lines as mlines >> >> fig = plt.figure() >> ax = fig.add_subplot(111) >> >> patches = [] >> patches.append(mlines.Line2D((0,1),(0,1), linewidth=1)) >> patches.append(mpatches.Circle((0,0), 0.25, linewidth=1)) >> patches.append(mpatches.Circle((1,1), 0.25, linewidth=1)) >> >> coll = mcollections.PatchCollection(patches) >> ax.add_collection(coll) >> ax.autoscale_view() >> >> plt.show() >> >> >> Now, in this example the line width is always given with respect to the >> screen space, i.e. does not change when I zoom into the plot. Is it >> possible to specify a linewidth with respect to data space? I.e. to say >> that a line (in both the Line2D and the Circle) should be let's say 0.1 >> in data space, and thus scale accordingly if I zoom in? >> >> -Michael >> >> ------------------------------------------------------------------------------ >> Precog is a next-generation analytics platform capable of advanced >> analytics on semi-structured data. The platform includes APIs for building >> apps and a phenomenal toolset for data science. Developers can use >> our toolset for easy data analysis & visualization. Get a free account! >> http://www2.precog.com/precogplatform/slashdotnewsletter >> _______________________________________________ >> Matplotlib-users mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > > ------------------------------------------------------------------------------ > Precog is a next-generation analytics platform capable of advanced > analytics on semi-structured data. The platform includes APIs for building > apps and a phenomenal toolset for data science. Developers can use > our toolset for easy data analysis & visualization. Get a free account! > http://www2.precog.com/precogplatform/slashdotnewsletter > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
From: Benjamin R. <ben...@ou...> - 2013-04-14 02:23:10
|
On Sat, Mar 23, 2013 at 12:09 AM, Russell Warren <ru...@pe...> wrote: > I'm trying to use path.Path.contains_point for point-in-polygon testing > and am running into a few different confusing situations. My specific > issues/questions are: > > 1. I'm seeing different behaviour dependent on path direction (clockwise > or counter-clockwise). Is there a "correct" direction to use? > No, it shouldn't matter, AFAICT. If there are differences, then it should be reported as a bug. > > 2. What is the expected behaviour for Path.contains_point when the point > is on a boundary? > > The original algorithm that it was based off of considered it outside (again, from memory), but warns that floating-point errors renders this point largely theoretical. > 3. What is the radius parameter supposed to do? The docs say it "allows > the path to be made slightly larger or smaller", but I'm clearly not > understanding this properly (see the cw_path hit test failure with r=0.1 > below). > > That is a terrible description of the functionality, I agree. Essentially, if you have a positive radius, it effectively dilates the polygon for the purposes of point-testing, while a negative radius effectively erodes the polygon (but not for plotting... only for point testing). > Here is a short example showing some issues with a unit rectangle... > > >>> from matplotlib.path import Path > >>> cw_path = Path([[0,0], [0,1], [1,1], [1,0]]) > >>> ccw_path = Path([[0,0], [1,0], [1,1], [0,1]]) > >>> #Point on x axis not detected for either path... > ... cw_path.contains_point([0.5, 0]) > 0 > >>> ccw_path.contains_point([0.5, 0]) > 0 > >>> #Add a large radius and ccw_path works, but not cw_path (!!?)... > ... r = 0.1 > >>> cw_path.contains_point([0.5, 0], radius=r) > 0 > >>> ccw_path.contains_point([0.5, 0], radius=r) > 1 > > The following ipython notebook has more detailed tests, but the main > points are in the sample above. > http://nbviewer.ipython.org/7e1b347b8b21b338bee1 > > I've found at least one reference [1] online indicating that "this > function is intended for use when mouse-clicking". Does that mean I should > not use it for generic point-in-polygon testing? > > That entirely depends upon your needs. The algorithm has very low overhead, but it isn't highly optimized. This makes it ideal for occasional point tests on arbitrary polygons (such as processing mouse-clicks). But if you want to systematically do many point tests for every single polygon, then maybe a more rigorously designed and implemented algorithm (such as Shapely's) is more suited for your needs. Note that Shapely's algorithm has higher overhead, but can test many more points faster than ours. I hope that clears things up! Ben Root |
From: Mark L. <bre...@ya...> - 2013-04-13 19:01:34
|
I've found the solution. MonthLocator doesn't support the bysetpos argument that rrule can use. Thankfully from my POV the following two lines give me exactly what I want. rule = rrulewrapper(MONTHLY, bymonthday=(firstDate.day, -1), bysetpos=1) majorLocator = RRuleLocator(rule) Just wish I'd read the docs more carefully in the first place to save my time and yours. On 05/04/2013 10:17, Mark Lawrence wrote: > On 04/04/2013 19:00, Mark Lawrence wrote: >> Sadly no :( I want the day of the month that I'm processing *OR* the >> last day. The worst case for this is obviously the 31st of each month. >> The rrule code I've given provides exactly that. When transferred to >> mpl that doesn't work. > > Best seen by changing the lines I gave originally to this. > > start = datetime.date(2013, 4, 5) > until = datetime.date(2014, 4, 5) > dates = rrule(MONTHLY, bymonthday=(5, -1), bysetpos=1, until=until) > > rrule output as follows. > > 2013-04-05 10:15:24 > 2013-05-05 10:15:24 > 2013-06-05 10:15:24 > 2013-07-05 10:15:24 > 2013-08-05 10:15:24 > 2013-09-05 10:15:24 > 2013-10-05 10:15:24 > 2013-11-05 10:15:24 > 2013-12-05 10:15:24 > 2014-01-05 10:15:24 > 2014-02-05 10:15:24 > 2014-03-05 10:15:24 > > Plot attached. > >> >> On 04/04/2013 17:31, Phil Elson wrote: >>> Hi Mark, >>> >>> Thanks for persevering :-) >>> >>> What is it you want to achieve? Is it that you just want the last day of >>> each month as the located value? >>> >>> Changing your locator to: >>> >>> ax.xaxis.set_major_locator(MonthLocator(bymonthday = -1)) >>> >>> Seems to do the trick for me (I've never looked at the mpl date magic, >>> so I can give no guarantees). >>> >>> HTH, >>> >>> >>> On 4 April 2013 17:18, Mark Lawrence >>> <bre...@ya... >>> <mailto:bre...@ya...>> wrote: >>> >>> On 01/04/2013 14:48, Mark Lawrence wrote: >>> > On 29/03/2013 15:49, Mark Lawrence wrote: >>> >> Hi all, >>> >> >>> >> From http://labix.org/python-dateutil >>> >> >>> >> "To generate a rrule for the use case of "a date on the >>> specified day of >>> >> the month, unless it is beyond the end of month, in which case >>> it will >>> >> be the last day of the month" use the following: >>> >> >>> >> rrule(MONTHLY, bymonthday=(some_day, -1), bysetpos=1) >>> >> >>> >> This will generate a value for every calendar month regardless >>> of the >>> >> day of the month it is started from." >>> >> >>> >> Using bymonthday with MonthLocator gives ticks on the day given >>> and the >>> >> last day of the month, which looks extremely ugly. Code below >>> demonstrates. >>> >> >>> >> from dateutil.rrule import * >>> >> import datetime >>> >> import matplotlib.pyplot as plt >>> >> from matplotlib.ticker import FormatStrFormatter, >>> MultipleLocator >>> >> from matplotlib.dates import DateFormatter, MonthLocator, >>> DayLocator >>> >> >>> >> start = datetime.date(2013, 3, 29) >>> >> until = datetime.date(2014, 3, 29) >>> >> dates = rrule(MONTHLY, bymonthday=(29, -1), bysetpos=1, >>> until=until) >>> >> for d in dates:print(d) >>> >> >>> >> dates = [start, until] >>> >> values = [0, 1] >>> >> plt.ylabel('Balance') >>> >> plt.grid() >>> >> ax = plt.subplot(111) >>> >> plt.plot_date(dates, values, fmt = 'rx-') >>> >> ax.xaxis.set_major_locator(MonthLocator(bymonthday = >>> (dates[0].day, -1))) >>> >> ax.xaxis.set_major_formatter(DateFormatter('%d/%m/%y')) >>> >> ax.yaxis.set_major_formatter(FormatStrFormatter('£%0.2f')) >>> >> ax.yaxis.set_minor_locator(MultipleLocator(5)) >>> >> plt.axis(xmin=dates[0], xmax=dates[-1]) >>> >> plt.setp(plt.gca().get_xticklabels(), rotation = 45, >>> fontsize = 10) >>> >> plt.setp(plt.gca().get_yticklabels(), fontsize = 10) >>> >> plt.show() >>> >> >>> > >>> > Seems an apt date to realise that I didn't say much :( >>> > >>> > Assuming that I'm correct would you like an issue raised on >>> the bug >>> > tracker? If not please correct the mistake I've made, >>> presumably in >>> > reading the docs, which I think are excellent by the way. >>> > >>> >>> Anybody? >>> >>> -- >>> If you're using GoogleCrap™ please read this >>> http://wiki.python.org/moin/GoogleGroupsPython. >>> >> -- If you're using GoogleCrap™ please read this http://wiki.python.org/moin/GoogleGroupsPython. Mark Lawrence |
From: Randy B. L. <mum...@gm...> - 2013-04-13 16:32:09
|
hi, every one: I used to use TkAgg as backend on my macbook for matplotlib which was installed from macports. for a while, the plot window was launched in X11. after a latest macports update, it stopped using x11 instead a standalone python window will be used now. I was wondering if there is a way to instruct matplotlib to open plot window in x11? thanks! -- Randy |
From: ChaoYue <cha...@gm...> - 2013-04-12 16:01:26
|
I'm afraid the scatter plot does not allow afterward adjustment with size currently (by using setp). Probably you should redraw the scatter points with different sizes. like for x,y,z in zip(xlist,ylist,sizelist): m.scatter(x,y,s=z) if you question is to change the real 2km or 1.5km to the size on the map, sorry I don't know as I never did this. Probably you need consider projection. Chao On Fri, Apr 12, 2013 at 4:33 PM, marz_cyclone [via matplotlib] < ml-...@n5...> wrote: > Hi all, > > I'm trying to do a scatter plot within a map created by basemap. > > m = Basemap(projection='ortho',lat_0=45,lon_0=0,resolution='l') > X,Y = m(lon,lat) > m.scatter(X,Y,s=sizes,c=data,edgecolor='none') > > This works fine. Now I want to change the sizes of the markers so that the > marker at point A has a size that corresponds to circle with radius of 2.5 > km, point B to 1.5 km, .... and so on. > > Has anyone ever done this? > > Thanks in advance. > > Mario Mech > > > ------------------------------------------------------------------------------ > > Precog is a next-generation analytics platform capable of advanced > analytics on semi-structured data. The platform includes APIs for building > apps and a phenomenal toolset for data science. Developers can use > our toolset for easy data analysis & visualization. Get a free account! > http://www2.precog.com/precogplatform/slashdotnewsletter > _______________________________________________ > Matplotlib-users mailing list > [hidden email] <http://user/SendEmail.jtp?type=node&node=40883&i=0> > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > > ------------------------------ > If you reply to this email, your message will be added to the discussion > below: > http://matplotlib.1069221.n5.nabble.com/basemap-scatter-tp40883.html > To start a new topic under matplotlib - users, email > ml-...@n5... > To unsubscribe from matplotlib, click here<http://matplotlib.1069221.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=2&code=Y2hhb3l1ZWpveUBnbWFpbC5jb218MnwxMzg1NzAzMzQx> > . > NAML<http://matplotlib.1069221.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml> > -- *********************************************************************************** Chao YUE Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL) UMR 1572 CEA-CNRS-UVSQ Batiment 712 - Pe 119 91191 GIF Sur YVETTE Cedex Tel: (33) 01 69 08 29 02; Fax:01.69.08.77.16 ************************************************************************************ -- View this message in context: http://matplotlib.1069221.n5.nabble.com/basemap-scatter-tp40883p40884.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
From: Mario M. <me...@me...> - 2013-04-12 14:33:14
|
Hi all, I'm trying to do a scatter plot within a map created by basemap. m = Basemap(projection='ortho',lat_0=45,lon_0=0,resolution='l') X,Y = m(lon,lat) m.scatter(X,Y,s=sizes,c=data,edgecolor='none') This works fine. Now I want to change the sizes of the markers so that the marker at point A has a size that corresponds to circle with radius of 2.5 km, point B to 1.5 km, .... and so on. Has anyone ever done this? Thanks in advance. Mario Mech |
From: Michael D. <md...@st...> - 2013-04-12 13:35:44
|
Unfortunately, I don't think there is a way to do this at present. Out of curiosity, what is the use case? I wonder if the best way to do this would be to expose the stroking to the Python level, so given a line one could get a filled path that is the stroked line. I'm not sure how else this could work, since the zooming could be different in each direction, etc., or could even by log-scaled etc. Would you mind creating an issue ticket for this? (Patches welcome, too, of course, and I can provide pointers if you want to take this on yourself...) Mike On 04/12/2013 05:34 AM, Michael Wimmer wrote: > I have a collection of Patches and Lines that have their coordinates in > data space, i.e. like in the following example: > > > import matplotlib.pyplot as plt > import matplotlib.patches as mpatches > import matplotlib.collections as mcollections > import matplotlib.lines as mlines > > fig = plt.figure() > ax = fig.add_subplot(111) > > patches = [] > patches.append(mlines.Line2D((0,1),(0,1), linewidth=1)) > patches.append(mpatches.Circle((0,0), 0.25, linewidth=1)) > patches.append(mpatches.Circle((1,1), 0.25, linewidth=1)) > > coll = mcollections.PatchCollection(patches) > ax.add_collection(coll) > ax.autoscale_view() > > plt.show() > > > Now, in this example the line width is always given with respect to the > screen space, i.e. does not change when I zoom into the plot. Is it > possible to specify a linewidth with respect to data space? I.e. to say > that a line (in both the Line2D and the Circle) should be let's say 0.1 > in data space, and thus scale accordingly if I zoom in? > > -Michael > > ------------------------------------------------------------------------------ > Precog is a next-generation analytics platform capable of advanced > analytics on semi-structured data. The platform includes APIs for building > apps and a phenomenal toolset for data science. Developers can use > our toolset for easy data analysis & visualization. Get a free account! > http://www2.precog.com/precogplatform/slashdotnewsletter > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
From: andrew n. <and...@gm...> - 2013-04-12 13:19:26
|
> > Message: 1 > Date: Fri, 12 Apr 2013 13:55:32 +0400 > From: Bakhtiyor Zokhidov <bak...@ma...> > Subject: [Matplotlib-users] Impossible to draw a direction of arrows > in Matplotlib??? > > Hi, > I have encountered some problem while I was drawing a direction of > arrow. I have point (x,y) coordinates and angle of them. What I want to > do is that to draw arrow according to the given angle (just to show the > point direction as an arrow in each point coordinate). Here, we should > assume coordinates of '+x', '+y', '-x ', '-y' are 90, 0, 270, 180 > degrees, respectively.? > I am a bit unfamiliar with Python drawing tools. I am still not sure to > draw directional point (arrow based on angle) whether I use pylab or > some other modules or.. still not sure at all. I put the following codes > as a sample to give better description: I see the potential for some confusion over the direction of arrows on a plot here. In standard trigonometry angles of 0, 90, 180, 270 degrees lie along '+x' (1, 0), '+y' (0, 1), '-x' (-1, 0) and '-y' (0, -1). Totally different to what you want. However, this is obviously different to the compass rose. ________________ Dr Andrew Nelson and...@gm... _________________ |
From: Ryan N. <rne...@gm...> - 2013-04-12 12:43:00
|
I'm not sure that I understand exactly what you are trying to do, but you may want to look into Matplotlib annotation. Here's a really quick example: import matplotlib.pyplot as plt plt.annotate('', (1, 1), (0, 0), arrowprops=dict(facecolor='black')) plt.axis([-1, 2, -1, 2]) plt.show() There are many options to make very fancy arrows, and there are several places in the docs to read about this in more detail: http://matplotlib.org/users/annotations_intro.html http://matplotlib.org/users/annotations_guide.html Hope that helps a little. Good luck. Ryan On 4/12/2013 5:55 AM, Bakhtiyor Zokhidov wrote: > Hi, > I have encountered some problem while I was drawing a direction of > arrow. I have point (x,y) coordinates and angle of them. What I want to > do is that to draw arrow according to the given angle (just to show the > point direction as an arrow in each point coordinate). Here, we should > assume coordinates of '+x', '+y', '-x ', '-y' are 90, 0, 270, 180 > degrees, respectively. > I am a bit unfamiliar with Python drawing tools. I am still not sure to > draw directional point (arrow based on angle) whether I use pylab or > some other modules or.. still not sure at all. I put the following codes > as a sample to give better description: > > import numpy as np > import scipy as sp > import pylab as pl > > > def draw_line(x,y,angle): > # Inputs: > x = np.array([ 2, 4, 8, 10, 12, 14, 16]) > y = np.array([ 5, 10, 15, 20, 25, 30, 35]) > angles = np.array([45,275,190,100,280,18,45]) > > # First, draw (x,y) coordinate > ??? > # Second, according to the angle indicate the direction as > an arrow > ??? > > Thanks in advance for your friendly support, > > > ------------------------------------------------------------------------------ > Precog is a next-generation analytics platform capable of advanced > analytics on semi-structured data. The platform includes APIs for building > apps and a phenomenal toolset for data science. Developers can use > our toolset for easy data analysis & visualization. Get a free account! > http://www2.precog.com/precogplatform/slashdotnewsletter > > > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
From: Bakhtiyor Z. <bak...@ma...> - 2013-04-12 09:55:44
|
Hi, I have encountered some problem while I was drawing a direction of arrow. I have point (x,y) coordinates and angle of them. What I want to do is that to draw arrow according to the given angle (just to show the point direction as an arrow in each point coordinate). Here, we should assume coordinates of '+x', '+y', '-x ', '-y' are 90, 0, 270, 180 degrees, respectively. I am a bit unfamiliar with Python drawing tools. I am still not sure to draw directional point (arrow based on angle) whether I use pylab or some other modules or.. still not sure at all. I put the following codes as a sample to give better description: import numpy as np import scipy as sp import pylab as pl def draw_line(x,y,angle): # Inputs: x = np.array([ 2, 4, 8, 10, 12, 14, 16]) y = np.array([ 5, 10, 15, 20, 25, 30, 35]) angles = np.array([45,275,190,100,280,18,45]) # First, draw (x,y) coordinate ??? # Second, according to the angle indicate the direction as an arrow ??? Thanks in advance for your friendly support, |
From: Michael W. <wim...@gm...> - 2013-04-12 09:34:43
|
I have a collection of Patches and Lines that have their coordinates in data space, i.e. like in the following example: import matplotlib.pyplot as plt import matplotlib.patches as mpatches import matplotlib.collections as mcollections import matplotlib.lines as mlines fig = plt.figure() ax = fig.add_subplot(111) patches = [] patches.append(mlines.Line2D((0,1),(0,1), linewidth=1)) patches.append(mpatches.Circle((0,0), 0.25, linewidth=1)) patches.append(mpatches.Circle((1,1), 0.25, linewidth=1)) coll = mcollections.PatchCollection(patches) ax.add_collection(coll) ax.autoscale_view() plt.show() Now, in this example the line width is always given with respect to the screen space, i.e. does not change when I zoom into the plot. Is it possible to specify a linewidth with respect to data space? I.e. to say that a line (in both the Line2D and the Circle) should be let's say 0.1 in data space, and thus scale accordingly if I zoom in? -Michael |