python - Plotting a curve from numpy array with large values -


i trying plot curve molecular dynamics potential energies data stored in numpy array. can see figure attached, on top left of figure, large number appears related label on y-axis. @ it. enter image description here if rescale data, still number appears there. not want it. please can suggest me howto sort out issue? thank much..

this happening because data small value offset large one. that's - sign means @ front of number, "take plotted y-values , subtract number actual values". can remove plotting mean subtracted. here's example:

import numpy np import matplotlib.pyplot plt  y = -1.5*1e7 + np.random.random(100)  plt.plot(y) plt.ylabel("units") 

gives form don't like: enter image description here

but subtracting mean (or other number close that, min or max, etc) remove large offset:

plt.figure() plt.plot(y - np.mean(y)) plt.ylabel("offset units") plt.show() 

enter image description here


Comments

Popular posts from this blog

java - Static nested class instance -

c# - Bluetooth LE CanUpdate Characteristic property -

JavaScript - Replace variable from string in all occurrences -