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

hline at y=0 appears after setting yscale to log #8783

Closed
Milestone
@dstansby

Description

@dstansby

Bug report

Bug summary

Callingax.axhline(0) after setting the y-scale to log rescales the y-axis to make the horizontal line appear at 1e-300.

Code for reproduction

importmatplotlib.pyplotaspltfig,ax=plt.subplots()ax.scatter([1], [1])ax.set_yscale('log')ax.axhline(0)plt.show()

Actual outcome

figure_1
with the warning

/Users/dstansby/matplotlib/lib/matplotlib/axes/_base.py:3208: UserWarning: Attempted to set non-positive ylimits for log-scale axis; invalid limits will be ignored.  'Attempted to set non-positive ylimits for log-scale axis; '

Expected outcome
I would expect the horizontal line to be ignored, and axis limits to remain as they were originally.

Matplotlib version

  • Operating System: OSX 10.12.5
  • Matplotlib Version: master branch installed using pip
  • Python Version: 3.6.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp