6
votes

Possible Duplicate:
Plot logarithmic axes with matplotlib in python

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:

http://ge.tt/26MVT0S/v/0?c

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?

1
@djechlin there are already answers to this question in SO. You only need to google matplotlib + log + scale - joaquin
ax.set_yscale('log') doesn't help me. it just make the y scale logarithmic. Look at this, when i use you command : ge.tt/5cAJX0S/v/0?c - Mojtaba
The links you are reffering me two, doesn't answer my question. the nearest question is this stackoverflow.com/questions/1679126/… - Mojtaba
I think we are missing something essential here - you have a matrix of data A[i,j], where the i-index is time, j-index is frequency, but what are the units of A[i,j]? Or do you have 50 different plots versus time and you want to highlight some logarithmic difference in their z-values? - Hooked
@joaquin This is falsely marked as duplicate.The OP's question does not refer to xy-plots, but to plotting a function z=f(x,y) with a logarithmic axis in z. - roadrunner66

1 Answers

0
votes

Update the axis:

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