康卉轩
康卉轩

Reputation: 1

Plot in python but it changed my y values automaticlly in the plot

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.

Upvotes: 0

Views: 92

Answers (1)

jwalton
jwalton

Reputation: 5686

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)

Upvotes: 3

Related Questions