Python Forum
How to avoid the extra set of y-axis labels?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to avoid the extra set of y-axis labels?
#2
twinx() creates a new axis. Your code creates two many new axis because you call twinx() multiple times. You should do something like this:
y2 = axs[0].twinx()
y2.set_ylabel('SPX Price')
I like the "Plots with different scales" example shown here

https://matplotlib.org/stable/api/_as_ge...twinx.html
Mark17 likes this post
Reply


Messages In This Thread
RE: How to avoid the extra set of y-axis labels? - by deanhystad - May-16-2022, 07:24 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How can histogram bins be separated and reduce number of labels printed on x-axis? cadena 1 911 Sep-07-2022, 09:47 AM
Last Post: Larz60+
  Floor division problem with plotting x-axis tick labels Mark17 5 2,147 Apr-03-2022, 01:48 PM
Last Post: Mark17
  x-axis labels with Matplotlib Mark17 8 2,289 Mar-23-2022, 06:10 PM
Last Post: Mark17
  Sample labels from excel file in order to put them on x-axis and y-axis of a plot hobbyist 11 4,471 Sep-14-2021, 08:29 AM
Last Post: hobbyist
  How to preserve x-axis labels despite deleted subplot? Mark17 1 1,953 Dec-23-2020, 09:02 PM
Last Post: Mark17
  Difference Between Figure Axis and Sub Plot Axis in MatplotLib JoeDainton123 2 2,511 Aug-21-2020, 10:17 PM
Last Post: JoeDainton123
  An Extra 'None' leoahum 5 3,977 Oct-18-2018, 08:20 PM
Last Post: volcano63

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020