Getting plot axis to show all tick values

I'm trying messing around with a bit of musical analysis (with the help of the MIR toolbox). I've got a pseudocolor plot showing the relative strengths of each possible chord (A, A#, B.....G# each being either major, minor or seven chord).
Once I have the plot though, it only shows every 5th or 6th value. If I zoom in, it will show up. But I would like to be able to see the entire plot with all values.
I tried changing the fontsize to smaller, but it made no difference.
Any help would be very much appreciated.

답변 (1개)

BF83
BF83 2011년 8월 18일

3 개 추천

Are you using a simple plot-command?
Then you can set your Y-Ticks manually by:
set(gca, 'YTick', [Vector of your custom y-Ticks])
Hope this helps.

댓글 수: 6

Scott
Scott 2011년 8월 19일
I'm using the pcolor command. The setting of axis details is still the same though, the current command looks like this:
yAxis = {'G#7';'G7';'F#7';'F7';'E7';'D#7';'D7';'C#7';'C7';'B7';'A#7';'A7';'G#m';'Gm';'F#m';'Fm';'Em';'D#m';'Dm';'C#m';'Cm';'Bm';'A#m';'Am';'G#M';'GM';'F#M';'FM';'EM';'D#M';'DM';'C#M';'CM';'BM';'A#M';'AM';};
pcolor(out)
set(gca,'YTickLabel', yAxis, 'FontSize', 6);
If I change the YTickLabel command to simply YTick, then I get the following error:
??? Error using ==> set
Conversion to double from cell is not possible.
BF83
BF83 2011년 8월 19일
Ah, okay.
Try this:
yAxis = {'G#7';'G7';'F#7';'F7';'E7';'D#7';'D7';'C#7';'C7';'B7';'A#7';'A7';'G#m';'Gm';'F#m';'Fm';'Em';'D#m';'Dm';'C#m';'Cm';'Bm';'A#m';'Am';'G#M';'GM';'F#M';'FM';'EM';'D#M';'DM';'C#M';'CM';'BM';'A#M';'AM';};
x = 1:10;
plot(x,x+1);
set(gca, 'YLim', [1 length(yAxis)]);
set(gca, 'YTick', [1:length(yAxis)]);
set(gca, 'YTickLabel', yAxis);
Scott
Scott 2011년 8월 22일
That works :) I get all my values on the yaxis this time.
so do you think it's a problem with the pcolor command?
BF83
BF83 2011년 8월 23일
In your first comment you assigned a cell instead of a vector to the 'YTick' and that's the reason for the error message, so there is no problem with the 'pcolor' command.
You can use the lines from above using the 'pcolor' command as well.
Is your problem solved, then?
Scott
Scott 2011년 8월 23일
Worked perfectly. Thanks very much!!
Oleg Komarov
Oleg Komarov 2011년 8월 23일
Please accept this answer if it solved your problem.

댓글을 달려면 로그인하십시오.

카테고리

질문:

2011년 8월 18일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by