Skip to content Skip to sidebar Skip to footer

How To Offset The X Axis And Log The Y Axis And To Find The Gradient Of My Graph From An External File

I am new to Python code and I need to graph my experiment data for my lab portfolio however I can't seem to log the y-axis and offset the x-axis or even know where to start for the

Solution 1:

  1. splitting lines yields strings. convert them to numbers: float(line.split()[0]) (or int() if you have integers)
  2. plt.yscale('log')
  3. x limits should be adjusted automatically. if you want to transform the data you can do x_1 = x_1 + offset or you can fiddle with plt.xlim(low, high)

Post a Comment for "How To Offset The X Axis And Log The Y Axis And To Find The Gradient Of My Graph From An External File"