Skip to content Skip to sidebar Skip to footer

Error Bars In Matplotlib Display Over Other Curves

I have a plot in which some data is represented by a scatter plot with error bars and I want to fit a curve to it. However, no matter where in the code I plot the curve, the error

Solution 1:

You can specify the zorder:

ln2 = ax3.errorbar(x,r,yerr=x,color='red',fmt='o',zorder=1)

enter image description here

If you also want to have the green line in the foreground you need to move it's axes ax to a higher zorder (default is 0) and hide the axes patch of ax so that the then underlying ax3 stays visible:

ax.set_zorder(1)
ax.patch.set_visible(False)

enter image description here

Post a Comment for "Error Bars In Matplotlib Display Over Other Curves"