[Matplotlib-users] Pie Charts, How to control pie chart size in figure?
Hi, I am making a simple pie chart that needs to be small ~3x3 inches. The problem I am having is that the text labels get pushed out side the figure. Is there anyway to make the plot smaller relative to the figure size? Here is my code and the resulting plot: from pylab import * # make a square figure and axes figure(1, figsize=(3,3)) ax = axes([0.0, 0.0, 1.0, 0.9]) labels = 'Central\nCampus','Medical\nCampus','North\nCampus' fracs = [880,220,1000] explode=(0.05, 0.05, 0.05) ppl=pie(fracs, explode=explode, labels=labels, shadow=True,autopct='%1.0f%%') title('GSRAs by Campus') <>-- This SF.net email is sponsored by Make an app they can't live without Enter the BlackBerry Developer Challenge http://p.sf.net/sfu/RIM-dev2dev ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] _legmarker attribute error in in legend using vlines
When I try to make a legend after using the vlines command, I get a _legmarker error. my code: / plot(two_theta,y_value_list_1) vlines(two_theta,[0],y_value_list_2,linewidth = 2) legend(['1','2'])/ the error: /Exception in Tkinter callback Traceback (most recent call last): File "/usr/lib/python2.6/lib-tk/Tkinter.py", line 1413, in __call__ return self.func(*args) File "/usr/lib/python2.6/dist-packages/matplotlib/backends/backend_tkagg.py", line 212, in resize self.show() File "/usr/lib/python2.6/dist-packages/matplotlib/backends/backend_tkagg.py", line 215, in draw FigureCanvasAgg.draw(self) File "/usr/lib/python2.6/dist-packages/matplotlib/backends/backend_agg.py", line 279, in draw self.figure.draw(self.renderer) File "/usr/lib/python2.6/dist-packages/matplotlib/figure.py", line 772, in draw for a in self.axes: a.draw(renderer) File "/usr/lib/python2.6/dist-packages/matplotlib/axes.py", line 1601, in draw a.draw(renderer) File "/usr/lib/python2.6/dist-packages/matplotlib/legend.py", line 316, in draw self._update_legend_box(renderer) File "/usr/lib/python2.6/dist-packages/matplotlib/legend.py", line 626, in _update_legend_box legline_marker = legline._legmarker AttributeError: 'Line2D' object has no attribute '_legmarker' /This stopped working after I installed ubuntu 9.4 thanks, -mike w. -- Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Is there an easy way to turn on automatic subticks?
Ryan May wrote: > On Fri, Oct 16, 2009 at 12:23 PM, Michael Waters wrote: > >> I am making regular Cartesian coordinate graphs with linear scales on >> the axis. I would really like to have automatic subticks to make reading >> data easier. Is there an easy way to do this? >> > > Yes, you just need to set a locator for the minor ticks, which is set > to NullLocator by default. > > import matplotlib.pyplot as plt > from matplotlib.ticker import MaxNLocator > plt.plot([1,2,3]) > ax = plt.gca() > ax.xaxis.set_minor_locator(MaxNLocator(nbins=30, steps=[1, 2, 5, 10])) > plt.show() > > You might also want to look at: > > http://matplotlib.sourceforge.net/examples/pylab_examples/major_minor_demo1.html?highlight=codex%20minor > > Ryan > > That does it! Thanks a bunch. -mike w. -- Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Is there an easy way to turn on automatic subticks?
I am making regular Cartesian coordinate graphs with linear scales on the axis. I would really like to have automatic subticks to make reading data easier. Is there an easy way to do this? Thanks -mike w. -- Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users