save numpy array
np.save("sim1.npy", sim)
save matplotlib figure as array
fig = plt.figure()
ax= fig.add_subplot(111)
plt.plot(your_data)
# turn antialiasing off for lines
plt.setp([ax.get_xticklines() + ax.get_yticklines() + ax.get_xgridlines() + ax.get_ygridlines()],antialiased=False)
# turn antialiasing off for text
mpl.rcParams['text.antialiased']=False
fig.canvas.draw()
array = np.frombuffer(fig.canvas.tostring_rgb(), dtype=np.uint8)
array = data.reshape(fig.canvas.get_width_height()[::-1] + (3,))
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us