Reputation: 5045
I have a table which looks like this
I have the highlighted part as a matrix of which I want to do an imshow
. I want to have the x-scale of the plot logarithmic, as one can understand by looking at the parameter values in the topmost row. How to do this is matplotlib?
Upvotes: 6
Views: 7960
Reputation: 68156
You want to use pcolor
, not imshow
. Here's an example:
import numpy as np
import matplotlib.pyplot as plt
fig, ax = plt.subplots()
Z = np.random.random(size=(7,7))
x = 10.0 ** np.arange(-2, 5)
y = 10.0 ** np.arange(-4, 3)
ax.set_yscale('log')
ax.set_xscale('log')
ax.pcolor(x, y, Z)
Which give me:
Upvotes: 16