0

可能重复:
imshow 中的对数 yscale

在我的 imshow 视图中,我想要y. 喜欢的答案yscale('log')不是我的答案。请问有什么建议吗?

4

1 回答 1

2

Do you mean you want the yaxis to be the "log scale" of the data your are plotting in the plot? The difficulty of doing this with imshow() is that the structure in y is fundamentally linear, that is, imshow just shows everything as it's structured in the dataset.

A hack would be to simply copy more data into the plot in such a way that the data reflects a log distribution, so the "lower values" are weighted within the set.

Another track to take would be to try a meshgrid approach, this answer for a different question may help there:

Python matplotlib - formatting with meshgrid for user-defined function

于 2012-11-23T16:58:46.177 回答