Errorbar semilogy switch to log y removed error bars when crosses into negative #9149
Labels
status: closed as inactive
Issues closed by the "Stale" Github Action. Please comment on any you think should still be open.
status: inactive
Marked by the “Stale” Github Action
Milestone
Bug report
Bug summary
When plotting error bars on data points, where the data is positive but the bar with the data-error is entering negative values, switching to log Y axes using semilogy() means that some data points are plotted without error bars at all (both y-err bars disappear).
Code for reproduction
create a file example.dat:
x dx y dy
1.046850 0.0029168 0.042551 0.02420
1.506679 0.0030152 0.027573 0.02252
3.028597 0.1959554 0.021218 0.00974
3.656348 0.1034119 0.002788 0.01059
4.949535 0.4693247 0.006276 0.00969
from astropy.io import ascii
from pylab import figure, errorbar,semilogy
t = ascii.read('example.dat')
figure()
errorbar(t['x'],t['y'],xerr=t['dx'],yerr=t['dy'],fmt='s')
This shows a linear plot with errorbars fine. The third data point error bar extends into negative territory.
semilogy()
Now the plot has a log y axis, but the error bar of the third point is gone.
from astropy.io import ascii
from pylab import figure, errorbar,semilogy
t = ascii.read('example.dat')
figure()
errorbar(t['x'],t['y'],xerr=t['dx'],yerr=t['dy'],fmt='s')
#This shows a linear plot with errorbars fine. The third data point error bar extends into negative territory.
semilogy()
#Now the plot has a log y axis, but the error bar of the third point is gone.
Actual outcome
Expected outcome
An errorbar in the log plot, surely the positive bar, and the negative going a few (3 or 5) decades down (perhaps with an arrow ending).
Matplotlib version
anaconda astroconda
The text was updated successfully, but these errors were encountered: