Solution 1:

Perhaps just clear the axis, for example:

fig= plt.figure()
plt.plot(range(10))
fig.savefig("save_file_name.pdf")
plt.close()

will not plot the output in inline mode. I can't work out if is really clearing the data though.

Solution 2:

I was able to prevent my figures from displaying by turning interactive mode off using the function

plt.ioff()

Solution 3:

To prevent any output from a jupyter notebook cell you may start the cell with

%%capture

This might be usefull in cases all other methods shown here fail.