Python Forum
Error when plotting a graph.
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Error when plotting a graph.
#4
I do not understand your response. "Well no"? Well no to what? You don't want to plot y= mx+c? This is how you plot y = mx+c
slope = 2  # m
offset = 3  # c
x = np.linspace(-5,5,100)  # Range of x values for solving y
y = x * slope + offset   # y = mx + c
And what do you mean by "accurate enough"? I think values will be calculated to 64 bit resolution. If you want higher resolution in the plot specify more values for the x axis. Can you please provide more information about what you mean by "accurate enough".

If you don't like how the plot is labeled, I intentionally left out labels and legend and the like to focus on the main problem. Now that you should know how to get y values to plot you can do any formatting that you want.
Reply


Messages In This Thread
Error when plotting a graph. - by Oshadha - Mar-14-2022, 03:48 PM
RE: Error when plotting a graph. - by deanhystad - Mar-14-2022, 04:06 PM
RE: Error when plotting a graph. - by Oshadha - Mar-14-2022, 04:53 PM
RE: Error when plotting a graph. - by deanhystad - Mar-14-2022, 06:47 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Plotting by Time, error mansoorahs 1 765 May-16-2023, 09:46 AM
Last Post: Larz60+
  Plotting simple graph (AttributeError) Laplace12 0 1,390 Jul-28-2021, 10:58 AM
Last Post: Laplace12
  Error When Plotting ValueError: x and y must have same first dimension JoeDainton123 1 9,139 Oct-04-2020, 12:58 PM
Last Post: scidam
  Graph not plotting Hass 1 1,983 Sep-14-2019, 09:52 AM
Last Post: luoheng
  Plotting number on graph william888 1 1,736 Sep-02-2019, 02:36 AM
Last Post: scidam
  Graph Plotting Help Talch 1 2,258 Aug-16-2018, 10:29 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

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