Set tight axis for log? / axis('tight') doesn't work

Dear all,
I need some help :slight_smile:

I have been trying to plot several subplots, with the y axis being in linear
and the x axis in log.

I need both axis to be tight to the data.

Here's what I have:

import wx
import scipy.io.matlab as matlab
import numpy
import matplotlib
matplotlib.use('WXAgg')
from matplotlib.pyplot import *
from matplotlib.figure import Figure
from matplotlib.backends.backend_wxagg import \
    FigureCanvasWxAgg as FigCanvas, \
    NavigationToolbar2WxAgg as NavigationToolbar
from pylab import *

fig = Figure((6.5, 5.0), dpi=100)
axes = fig.add_subplot(xlen,ylen,pos, polar=False, autoscale_on=False)
        
axes.errorbar(data1[0,0][0], mean(data2[n],1),
(var(data2[n],1)/sqrt(len(data2[n]))),
(var(data2[n],1)/sqrt(len(data2[n]))))
axes.set_xscale('log')
axes.axis('tight')
axes.set_ylim([0,max(mean(tuning[n],1))*1.2+0.1])
       
I also used to have error (AttributeError: 'MaskedArray' object has no
attribute 'putmask') with this code.

I have been looking for solution in forum archive, and someone suggested
using set_autoscale_on(False) but I tried and this didn't work.

Any help would be much much appreciated!
Thanks!

···


View this message in context: http://www.nabble.com/Set-tight-axis-for-log----axis('tight')-doesn't-work-tp24777527p24777527.html
Sent from the matplotlib - users mailing list archive at Nabble.com.