Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problem with the x-axis
#7
(Dec-22-2020, 09:58 PM)MK_CodingSpace Wrote: When you do subplot, it should be something like this
fig, axs = plt.subplots(2)
axs[0].plot(x, y)
axs[1].plot(x, -y)

I was using a state-based approach here. Your response discusses an object-oriented approach, which we used successfully in the other thread.

Assuming I stuck with this state-based approach, though, I don't understand why they didn't print as subplots. If the line I tried at 10 or 22 stays at 10, then there's nothing in the for loop to direct which subplot should be drawn. If that line goes at 22, though, then shouldn't it direct which subplot to draw? It doesn't. Why?
Reply


Messages In This Thread
Problem with the x-axis - by Mark17 - Dec-22-2020, 03:01 PM
RE: Problem with the x-axis - by MK_CodingSpace - Dec-22-2020, 05:15 PM
RE: Problem with the x-axis - by Mark17 - Dec-22-2020, 08:26 PM
RE: Problem with the x-axis - by MK_CodingSpace - Dec-22-2020, 09:31 PM
RE: Problem with the x-axis - by Mark17 - Dec-22-2020, 09:43 PM
RE: Problem with the x-axis - by MK_CodingSpace - Dec-23-2020, 02:30 PM
RE: Problem with the x-axis - by MK_CodingSpace - Dec-22-2020, 09:58 PM
RE: Problem with the x-axis - by Mark17 - Dec-23-2020, 01:46 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Floor division problem with plotting x-axis tick labels Mark17 5 2,157 Apr-03-2022, 01:48 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,483 Sep-14-2021, 08:29 AM
Last Post: hobbyist
  Difference Between Figure Axis and Sub Plot Axis in MatplotLib JoeDainton123 2 2,514 Aug-21-2020, 10:17 PM
Last Post: JoeDainton123

Forum Jump:

User Panel Messages

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