Re: [Matplotlib-users] Plot object

2012-03-29 Thread Emmanuel Mayssat
Turns out this is what I was looking for ! http://matplotlib.sourceforge.net/examples/pylab_examples/subplots_demo.html#pylab-examples-subplots-demo f, axarr = plt.subplots(2, 2) axarr[0,0].plot(x, y) axarr[0,0].set_title('Axis [0,0]') axarr[0,1].scatter(x, y) axarr[0,1].set_title('Axis [0,1]') a

Re: [Matplotlib-users] Formatting the ticks in a plot

2012-03-29 Thread Brad Malone
Paul, That fixes my problem perfectly. Thanks for the solution! Best, Brad On Thu, Mar 29, 2012 at 1:59 PM, Paul Hobson wrote: > Brad, > > Matplotlib axes objects have set_xticklabels methods. It's brute > force, but this will work: > ax = gca() > ax.set_xticks([0., 0.015, 0.03]) > ax.set_xtic

Re: [Matplotlib-users] Formatting the ticks in a plot

2012-03-29 Thread Paul Hobson
Brad, Matplotlib axes objects have set_xticklabels methods. It's brute force, but this will work: ax = gca() ax.set_xticks([0., 0.015, 0.03]) ax.set_xticklabels(['0', '0.015', '0.03']) Hope that helps, -paul On Thu, Mar 29, 2012 at 1:13 PM, Brad Malone wrote: > Hello, > > I am working on a plo

[Matplotlib-users] Formatting the ticks in a plot

2012-03-29 Thread Brad Malone
Hello, I am working on a plot in which I need to modify the value of the xticks. A snippet of my code is attached below: fig=figure() > > gs=matplotlib.gridspec.GridSpec(1,2,width_ratios=[3,1]) > gs.update(wspace=0.1) > ax=subplot(gs[0]) > ylabel('Frequency (cm'+r'$^

Re: [Matplotlib-users] reverse colormap?

2012-03-29 Thread Tony Yu
On Thu, Mar 29, 2012 at 1:31 PM, Chao YUE wrote: > Dear all, > > here in cookbook it says "Ever wanted to reverse a colormap, or to > desaturate one ? Here is a routine to apply a function to the look up table > of a colormap: " > http://www.scipy.org/Cookbook/Matplotlib/ColormapTransformations >

[Matplotlib-users] reverse colormap?

2012-03-29 Thread Chao YUE
Dear all, here in cookbook it says "Ever wanted to reverse a colormap, or to desaturate one ? Here is a routine to apply a function to the look up table of a colormap: " http://www.scipy.org/Cookbook/Matplotlib/ColormapTransformations but I don't know how to use cmap_map function as in the link t

[Matplotlib-users] Plot object

2012-03-29 Thread Emmanuel Mayssat
Hello, I am programming using POO (object programming) I cannot find a way to create a plot as an object In concept, I would like to do something like """ from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas from matplotlib.figure import Figure self.figure = Figure

Re: [Matplotlib-users] Errorbars not drawn correctly in logarithmic scales

2012-03-29 Thread arsbbr
I never got the trick with set_yscale="clip" to work for my plots (MPL 1.1.0). So I'm passing my error values to this little function in order to correct the yerr_neg: def filt_neg_err(y, yerr, set_ymin=1e-6): ymin = y - yerr filt = ymin < 0 yerr_pos = yerr.copy() yerr_neg = yerr.

[Matplotlib-users] how to set contourf plot colorbar narrow?

2012-03-29 Thread Chao YUE
Dear all, I make a contourf plot but I think the colorbar is too wide. Can I make it narrower (slimmer)? plt.contourf(data) cbar=plt.colorbar() ?? thanks for any suggestions. cheers, Chao -- *** Chao YUE Laborat

Re: [Matplotlib-users] how to maintain fractional minor tick spacing

2012-03-29 Thread Christopher Graves
On Tue, Mar 27, 2012 at 3:31 AM, Mike Kaufman wrote: > On 3/26/12 12:49 PM, Christopher Graves wrote: > >> On Sun, Mar 11, 2012 at 2:32 PM, Christopher Graves >> mailto:christoph.gra...@gmail.com>> wrote: >> > > Try this: >> >>from pylab import * >>from matplotlib.ticker i