Screenshot instructions:
Windows
Mac
Red Hat Linux
Ubuntu
Click URL instructions:
Rightclick on ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)
From: Donovan Parks <donovan.parks@gm...>  20091014 20:31:23

Hello, I've encountered two bugs recently in matplotlib. I am hoping someone can tell me if these are known issues and if any workarounds have been proposed. The bug occurs for horizontal bar chart where the xaxis has a log scale: from pylab import * val = 3+10*rand(5) # the bar lengths pos = arange(5)+.5 # the bar centers on the y axis axes = subplot(111) axes.barh(pos,val, align='center') axes.set_xscale('log') for a in axes.yaxis.majorTicks: a.tick1On=False a.tick2On=False for a in axes.xaxis.majorTicks: a.tick1On=True a.tick2On=False for loc, spine in axes.spines.iteritems(): if loc in ['left','right','top']: spine.set_color('none') show() If you run this code, you will see that only the end caps of the horizontal bars are drawn. Furthermore, tick marks appear at the top of the plot (despite explicitly turning them off). If a linear scale is used the plot is generated as expected. The issue with tick marks appearing incorrectly with log axes appears to occur with many types of graphs (well, at least the three I tried). Can anyone suggest how I might plot a bar chart with a log scale? Is there any other way I might force the tick marks at the top to not be drawn? Thanks for any and all help. Cheers, Donovan 
From: <PHobson@Geosyntec.com>  20091014 20:40:45

> Original Message > From: Donovan Parks [mailto:donovan.parks@...] > Sent: Wednesday, October 14, 2009 1:31 PM > To: matplotlibusers@... > Subject: [Matplotlibusers] Log scale for horizontal bar chart (2 > bugs) > > Hello, > > I've encountered two bugs recently in matplotlib. I am hoping someone > can tell me if these are known issues and if any workarounds have been > proposed. The bug occurs for horizontal bar chart where the xaxis has > a log scale: > > from pylab import * > > val = 3+10*rand(5) # the bar lengths > pos = arange(5)+.5 # the bar centers on the y axis > > axes = subplot(111) > axes.barh(pos,val, align='center') > axes.set_xscale('log') > > for a in axes.yaxis.majorTicks: > a.tick1On=False > a.tick2On=False > > for a in axes.xaxis.majorTicks: > a.tick1On=True > a.tick2On=False > > for loc, spine in axes.spines.iteritems(): > if loc in ['left','right','top']: > spine.set_color('none') > > show() > > If you run this code, you will see that only the end caps of the > horizontal bars are drawn. Furthermore, tick marks appear at the top > of the plot (despite explicitly turning them off). If a linear scale > is used the plot is generated as expected. The issue with tick marks > appearing incorrectly with log axes appears to occur with many types > of graphs (well, at least the three I tried). Just wanted to chime in here and note that a similar issue can occur with boxplots and logscales. I think the issue here is that the rectangle patch is told to draw at the patch length at *zero*. Since there is no zero on a log scale, the rectangle patch is not fully rendered. That's just my observation/hypothesis. Good luck, paul 
From: JaeJoon Lee <lee.j.joon@gm...>  20091015 19:08:07

barh takes an optional argument "log". set this True (or you may set "left" with some meaningful value, other than 0) http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.barh JJ On Wed, Oct 14, 2009 at 4:30 PM, Donovan Parks <donovan.parks@...> wrote: > Hello, > > I've encountered two bugs recently in matplotlib. I am hoping someone > can tell me if these are known issues and if any workarounds have been > proposed. The bug occurs for horizontal bar chart where the xaxis has > a log scale: > > from pylab import * > > val = 3+10*rand(5) # the bar lengths > pos = arange(5)+.5 # the bar centers on the y axis > > axes = subplot(111) > axes.barh(pos,val, align='center') > axes.set_xscale('log') > > for a in axes.yaxis.majorTicks: > a.tick1On=False > a.tick2On=False > > for a in axes.xaxis.majorTicks: > a.tick1On=True > a.tick2On=False > > for loc, spine in axes.spines.iteritems(): > if loc in ['left','right','top']: > spine.set_color('none') > > show() > > If you run this code, you will see that only the end caps of the > horizontal bars are drawn. Furthermore, tick marks appear at the top > of the plot (despite explicitly turning them off). If a linear scale > is used the plot is generated as expected. The issue with tick marks > appearing incorrectly with log axes appears to occur with many types > of graphs (well, at least the three I tried). > > Can anyone suggest how I might plot a bar chart with a log scale? Is > there any other way I might force the tick marks at the top to not be > drawn? > > Thanks for any and all help. > > Cheers, > Donovan > >  > 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 > _______________________________________________ > Matplotlibusers mailing list > Matplotlibusers@... > https://lists.sourceforge.net/lists/listinfo/matplotlibusers > 
Sign up for the SourceForge newsletter:
No, thanks