X Tutup
Skip to content

axvline is sometimes not shown #6960

@idavydov

Description

@idavydov

Usually if you plot histogram + axvline, the x axis limits are extended so the vertical line is visible.

E.g.
figure_1_good

But sometimes the x axis is not extended to be able to show a vertical line.
Here's the code to demonstrate the issue:

from matplotlib import pylab as plt
plt.hist([9138, 9138, 9133, 9137, 9134, 9128, 9133, 9134, 9134, 9142])
plt.axvline(x=9144, color='red')
plt.show()

figure_1_bad

(the red vertical line should be visible on the right, x=9144)

  • Matplolib: 1.5.1-1ubuntu1 (from repository), Python 2.7.12, Ubuntu 16.04.1
  • The same problem can be reproduced in python 3.5.2.

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

      X Tutup