Dear matplotlibers,

I encountered a bug (?) in fill_between when using logarithmic scales and
the last part of y and yerr arrays as set to zero: a diagonal stripe going from
the rightmost non zero value to the first value is drawn.
It's visible in the right panel of the attached figure, while is not
present if the plot is linear (left panel).
If xaxis is log and yaxis is linear the plot is correctly drawn.

I'm using mpl.__version__ = '1.1.1rc' under Kubuntu 12.04 with Python 2.7.3

The plot has been created with the script below.

Is this a bug or am I missing something?

Cheers
Francesco


##### error_fill_between.py ######
import matplotlib.pyplot as plt
import numpy as np

#values to plot
x = np.linspace( 1, 10, num=100 )
y = np.exp( -x**2 )
y[50:] = 0
yerr = y* np.random.rand(100)

#figure
fig = plt.figure()

ax1 = fig.add_subplot(121)  #first axes: linear
ax1.errorbar( x,y,yerr, c='r' )
ax1.fill_between( x,y-yerr,y+yerr, color='b', alpha=0.4 )

ax2 = fig.add_subplot(122)  #second axes: logarithmic
ax2.errorbar( x,y,yerr, c='r' )
ax2.fill_between( x,y-yerr,y+yerr, color='b', alpha=0.4 )
ax2.set_xscale( "log" )
ax2.set_yscale( "log" )

plt.show()
###### end script  #########

Attachment: error_fill_between.pdf
Description: Adobe PDF document

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to