Python Forum
Setting Tick Intervals In Sub Plots
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Setting Tick Intervals In Sub Plots
#1
Hello all

I was hoping someone could point me in the right direction regarding setting the intervals for the Y axis ticks.

I have the following code:-
axes[0].plot((df_raw_data.iloc[start_counter:end_counter,5]),(df_raw_data.iloc[start_counter:end_counter,6])) # 1
axes[0].set_ylabel("Y Label", fontsize=5, weight="bold") # 2
axes[0].set_ylim(25,-25) # 3
axes[0].yaxis.set_tick_params(labelsize = 6)# 4
Line 1 plots the data
Line 2 creates a Y axis label
Line 3 sets the limits of my y axis in this case between 25 & -25
Line 4 sets the font size of my y axis values.

I want to set the increments to 5 (or any value for that matter but also but i want the the value 25 & -25 shown on the Y axis these last values always seem to be omitted.

Can anyone help?

Thank you.
Reply
#2
You need to define yticks explicitly, e.g. ax.set_yticks(range(-25, 26, 5)).
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Multiple Plots in Spyder PythonAndMe2023 0 862 Feb-03-2023, 07:00 PM
Last Post: PythonAndMe2023
  Points not plotting with reference to x-tick labels Mark17 2 1,266 Jun-14-2022, 05:38 PM
Last Post: Mark17
  How to get evenly-spaced datetime tick labels regardless of x-values of data points? Mark17 4 5,207 Apr-04-2022, 07:10 PM
Last Post: Mark17
  Floor division problem with plotting x-axis tick labels Mark17 5 2,080 Apr-03-2022, 01:48 PM
Last Post: Mark17
  Subplot - Plotting 4 plots on the same row Menthix 1 1,415 Nov-07-2021, 09:03 PM
Last Post: deanhystad
  time intervals project_science 7 2,920 Feb-06-2021, 11:49 PM
Last Post: project_science
  Only show every nth tick in chart tgottsc1 1 4,643 Feb-01-2021, 04:30 PM
Last Post: j.crater
  Plotting “simple” diagram with gridlines at specified intervals schniefen 1 2,401 Dec-03-2020, 05:54 PM
Last Post: schniefen
  Complex X Tick Interval JoeDainton123 0 1,465 Oct-05-2020, 07:27 PM
Last Post: JoeDainton123
  Sharing X Axis in Sub plots JoeDainton123 1 2,166 Aug-22-2020, 04:11 AM
Last Post: deanhystad

Forum Jump:

User Panel Messages

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