Thanks to visit codestin.com
Credit goes to github.com

Skip to content

added axis ticks and labels don't replace default labels #9253

Closed as not planned
@gpetty

Description

@gpetty

Bug report

Bug summary

Code that used to work flawlessly for replacing tick locations and labels on a log axis now seems to merely add to the default labels, so both now appear in the plot.

Code for reproduction


from matplotlib import pyplot as plt

# set the axis limits
xmin = -100   # min temperature to plot
xmax = 40    # max temperature
ymin = 100   # min pressure
ymax = 1000  # max pressure
plt.axis([xmin, xmax, ymax, ymin])

plt.semilogy()

# make lists of tick values and tick labels
plist = range(ymin,ymax,100)
plabels = []
for p in plist:
    plabels.append(str(p))

plt.yticks(plist,plabels)

x = [xmin, xmax]
y = [ymin, ymax]
plt.plot(x, y)
plt.show()

Actual outcome

untitled 2

# If applicable, paste the console output here
#
#

Expected outcome

There should be no overwriting of custom labels with the default scientific notation labels. It did work correctly about a year ago, but I cannot say what version of Matplotlib was being used at that time.

Matplotlib version

  • Operating System: Mac osx-64
  • Matplotlib Version: 2.0.2
  • Python Version: 2.7.12
  • Jupyter Version (if applicable): 4.3.0
  • Other Libraries:

conda install matplotlib

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

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions