imshow中的对数yscale [英] Logarithmic yscale in imshow

查看:131
本文介绍了imshow中的对数yscale的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能重复:
在python中使用matplotlib绘制对数轴

Possible Duplicate:
Plot logarithmic axes with matplotlib in python

我有一个50 * 1050的矩阵,其中维度50代表频率,而维度1050则代表时间.我尝试使用imshow对其进行绘制,得到以下图像:

I have a 50*1050 matrix in which the dimension 50 represents the frequency and 1050 the time. I tried to plot it using imshow and I get this image:

但是我想突出显示较低的频率,这意味着我需要将对数刻度用于y刻度.我进行了很多搜索,但没有找到有效的解决方案.

But i want to highlight the lower frequencies, which means I need to use the logarithmic scale for the y scale. I searched a lot but I didn't find any effective solution yet.

我确切需要的是矩阵的第一行应占据图像的最大百分比,并且随着行数的增加,如果它们在图像中所占的行数减少,则宽度应减小.有什么建议吗?

What I need exactly is that the first row of the matrix should occupy the biggest percentage of the image and as the rows increase, the width if the row they occupy in the image should decrease. Any suggestion?

推荐答案

更新轴:

a = list(axis())
a[3] = 10
axis(a)
yscale('log')

这篇关于imshow中的对数yscale的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆