I am just starting to make the shift from gnuplot to python myself. Here is an example using matplotlib/numpy:
#!/usr/bin/env python
import matplotlib.pyplot as plt
import numpy as np
Z = np.arange(100).reshape(10,10)
plt.imshow(Z, interpolation='none')
plt.show()
You can create the Z matrix any way you like, but it should be a numpy array. The commands imshow
and matshow
are about the same in matplotlib, but matshow
shows the data with the y-axis reversed and without interpolation by default.
I recommend looking at the options for imshow
, especially extent
which defines the x and y ranges.
This answer is also a good option, if you want to automatically define your extent.