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?
#5
twinx() is a function that creates an additional axis. Each time you call it it makes a new axis. In the working code twinx() is called once, to create one additional axis. You called twinx() multiple times on the same plot. This poor plot has 3 y axis
axs[0].twinx().set_ylabel('SPX Price') # This creates a new axis (#2)
axs[0].plot(sample_df['Spread_Price'],color='red')
axs[0].twinx().plot(sample_df['SPX']) # This creates an additional axis (#3), not the same as above
Reply


Messages In This Thread
RE: How to avoid the extra set of y-axis labels? - by deanhystad - May-16-2022, 08:15 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 893 Sep-07-2022, 09:47 AM
Last Post: Larz60+
  Floor division problem with plotting x-axis tick labels Mark17 5 2,114 Apr-03-2022, 01:48 PM
Last Post: Mark17
  x-axis labels with Matplotlib Mark17 8 2,242 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,394 Sep-14-2021, 08:29 AM
Last Post: hobbyist
  How to preserve x-axis labels despite deleted subplot? Mark17 1 1,943 Dec-23-2020, 09:02 PM
Last Post: Mark17
  Difference Between Figure Axis and Sub Plot Axis in MatplotLib JoeDainton123 2 2,480 Aug-21-2020, 10:17 PM
Last Post: JoeDainton123
  An Extra 'None' leoahum 5 3,921 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