Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error bars in logarithmic plots #101

Open
jzazo opened this issue Aug 24, 2018 · 0 comments
Open

Error bars in logarithmic plots #101

jzazo opened this issue Aug 24, 2018 · 0 comments

Comments

@jzazo
Copy link

jzazo commented Aug 24, 2018

Hi! I'm experiencing some issues while plotting error bars and using logarithmic scale on the y-axis.
As I understood from the docs, the ErrorBars(y=[...]) indicates the relative value of the error with respect to the Plot.
Consider the following example (normal scale):

x=[1,2,3,4]`
y=[0.1, 0.01, 0.001, 0.0001]
errY = [0.05, 0.05, 0.05, 0.05]
Axis(Plots.Linear(x,y, errorBars = ErrorBars(y=errY)))

The output is correct, centered on y:

1

However, if I write

x=[1,2,3,4]
y=[1e-1, 1e-2, 1e-3, 1e-4]
errY = [1e-2, 1e-3, 1e-4, 1e-5]
Axis(Plots.Linear(x,y, errorBars = ErrorBars(y=y-errY)), ymode="log")

(note that I've reduce the errY, so that the outcome is always positive for the logarithmic scale), I get a wrong plot, there are no error bars:
2

Finally, if I do not assume relative error but absolute, I get what I want:

x=[1,2,3,4]
y=[1e-1, 1e-2, 1e-3, 1e-4]
errY = [1e-2, 1e-3, 1e-4, 1e-5]
Axis(Plots.Linear(x,y, errorBars = ErrorBars(y=y-errY)), ymode="log")

3

Am I missing something? Is there a bug in the logarithmic scale? Maybe in pgfplots, or the output is processed wrongly by ErrorBars() in the logarithmic case? I just wanted to check, I believe the third plot is correct, but getting there is a bit fishy. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant