How can I get the output of a matplotlib plot as an SVG?

You will most probably want to fix the image size and get rid of all sorts of backgrounds and axis markers: import matplotlib.pyplot as plt import numpy as np plt.figure(figsize=[6, 6]) x = np.arange(0, 100, 0.00001) y = x*np.sin(2* np.pi * x) plt.plot(y) plt.axis(‘off’) plt.gca().set_position([0, 0, 1, 1]) plt.savefig(“test.svg”) The resulting SVG file contains only … Read more

How can I perform two-dimensional interpolation using scipy?

Disclaimer: I’m mostly writing this post with syntactical considerations and general behaviour in mind. I’m not familiar with the memory and CPU aspect of the methods described, and I aim this answer at those who have reasonably small sets of data, such that the quality of the interpolation can be the main aspect to consider. … Read more