Franck Dernoncourt
Franck Dernoncourt

Reputation: 83177

Forcing Matlab to not overlap XTickLabels with YTickLabels

Is there any way to prevent XTickLabels from overlapping with YTickLabels in a figure in Matlab?

Good:

enter image description here

Bad (-2 and -5 are overlapping):

enter image description here


Code (I would prefer a solution that is not customized to this particular piece of code):

Good:

wavelet_name = 'coif1';
[~,psi,xval] = wavefun(wavelet_name,10);
scale = 1;
shift = 1;
x_min = -1;
x_max = 8;
plot([x_min, shift+xval.*scale, x_max],[0, psi, 0]);
axis([x_min x_max -2 3]);
set(gca,'FontSize',50)
save_figure( [wavelet_name '_scale' num2str(scale) '_shift' num2str(shift)] )

Bad: (I only changed x_min = -1; to x_min = -5;)

wavelet_name = 'coif1';
[~,psi,xval] = wavefun(wavelet_name,10);
scale = 1;
shift = 1;
x_min = -5;
x_max = 8;
plot([x_min, shift+xval.*scale, x_max],[0, psi, 0]);
axis([x_min x_max -2 2]);
%title('Sym2 Wavelet');
set(gca,'FontSize',50)
save_figure( [wavelet_name '_scale' num2str(scale) '_shift' num2str(shift)] )

I use Matlab R2014a with Windows 7 SP1 x64 Ultimate.

Upvotes: 1

Views: 148

Answers (1)

Jommy
Jommy

Reputation: 1105

It seems that this problem has been fixed in Matlab R2014b. The execution of your code privides the following figure.

wavefun

Upvotes: 1

Related Questions