Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Errorbar semilogy switch to log y removed error bars when crosses into negative #9149

Closed as not planned
Labels
status: closed as inactiveIssues closed by the "Stale" Github Action. Please comment on any you think should still be open.status: inactiveMarked by the “Stale” Github Action
@PaulKuin

Description

@PaulKuin

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.

# Paste your code here##

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

screen shot 2017-09-01 at 15 43 50

screen shot 2017-09-01 at 15 44 05

# If applicable, paste the console output here##

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

  • Operating System: OSX
  • Matplotlib Version: 2.0.2
  • Python Version:2.7
  • Jupyter Version (if applicable):
  • Other Libraries: astropy

anaconda astroconda

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: closed as inactiveIssues closed by the "Stale" Github Action. Please comment on any you think should still be open.status: inactiveMarked by the “Stale” Github Action

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp