> -----Original Message-----
> From: Donovan Parks [mailto:donovan.pa...@gmail.com]
> Sent: Wednesday, October 14, 2009 1:31 PM
> To: matplotlib-users@lists.sourceforge.net
> Subject: [Matplotlib-users] 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 x-axis 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 log-scales. 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

------------------------------------------------------------------------------
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

Reply via email to