I'm trying to use matplotlib to plot 3D heatmap with results of my simulations. I've read this topic and tried to use imshow. Unfortunately, when I save the figure in SVG or EPS formats, it converts heatmat to picture (which isn't acceptable for journal). So, I've tried hexbin also - but image is so weird. I'm not sure it will be accepted by journal. Do we have something else, or I have to fill heatmat by rectangles?
For example, if one runs this code:
import numpy as np
import numpy.random
import matplotlib.pyplot as plt
# Generate some test data
x = np.random.randn(8873)
y = np.random.randn(8873)
heatmap, xedges, yedges = np.histogram2d(x, y, bins=50)
extent = [xedges[0], xedges[-1], yedges[0], yedges[-1]]
print extent
print heatmap
plt.clf()
surf = plt.imshow(heatmap, extent=extent)
plt.colorbar(surf, shrink=0.75, aspect=5)
plt.show()
and save SVG file, it will containe PNG image:
<g clip-path="url(#p6def4f5150)">
<image height="347" width="315" x="115.127800906" xlink:href="data:image/png;base64,
I use matplotlib, version 1.1.1 under OpenSUSE and Ubuntu OS.