0

When I wanna plot my data in python, it shows modified values of my y-values instead of original data.

enter image description here

As can be seen in the plot, it subtracts 1.455e2(which is written beside the y axis) from my original data and I wanna show the original data in my plot. Here's my script about the plot:

plt.xlabel("H(Oe)")
plt.ylabel("R*E-3(dBm)")

plt.plot(h_1,r_2,linestyle="-",linewidth=1,label="2.50_GHz")
plt.legend(loc='upper left')
plt.grid(color="k", linestyle=":")
plt.savefig("0_deg_2.50_GHz_R.png", dpi=300,bbox_inches = 'tight')
plt.show()

And actually it does show the original y-values for some other data files, I'm using the exactly same script but for this one it always shows the modified values. Does anyone know how to fix it? Thanks a lot.

Gabriel
  • 40,504
  • 73
  • 230
  • 404
  • you don't have a `plt.plot(h_1, your_modified_values...)` above this code, do you? or the modified values in `r_2`? – E. Bassett Mar 17 '20 at 20:58
  • https://stackoverflow.com/questions/9303728/matplotlib-yaxis-range-display-using-absolute-values-rather-than-offset-values – BigBen Mar 17 '20 at 21:02

1 Answers1

3

This is not scientific notation but is known as an offset (hence the + before the number). The original values can be seen by adding the offset to all of the values.

You can prevent an offset being used as:

plt.ticklabel_format(useOffset=False)
jwalton
  • 5,286
  • 1
  • 18
  • 36