问题描述
如果我缩放几个时间图,则X轴上的所有标签都会消失(消失),并且没有可见的X轴标签,因此无法了解图形中我所在的部分.
如何强制matlab始终在X轴上显示标签,并在缩放时自动更新标签并显示足够的数字,因此邻居"标签必须不同.
即使在新版本的MATLAB(r2014)上,我也遇到了相同的问题.放大时,MATLAB没有显示足够的x轴刻度标签.经过几次实验,我发现以下解决方法.以下是实施解决方案之前的图表.即使有足够的空间可以容纳更多的空间,MATLAB在x轴上也仅显示三个XTick标签(放大时,标签的数量通常更少).
怀疑MATLAB认为它没有足够的空间来显示更多标签,一种解决方法是旋转标签.为此,请在发出绘图命令后,例如
plot(tsX);坚持,稍等;图(tsY);情节(tsZ);
添加以下命令
set(gca,'XTickLabelRotation',90);
现在MATLAB图形带有更多标签
我将向MATLAB人员报告此错误.
If I zoom several time graph all labels from axis X disapear (go away) and there are no visible axis X labels so it is not possible to understand the part of graph where am I.
How can I force matlab to always display labels on axis X and to update them automatically while zooming and to display enough digits so "neighboor" labels must be different.
I run into the same problem even on the new version of MATLAB (r2014). MATLAB does not display sufficient x-axis tick labels as you zoom-in. After several experiments I found the following workaround. Following is a plot before implementing the solution. MATLAB displays only three XTick labels on the x-axis even though there is sufficient space for more (there are often even less labels as you zoom in more).
Suspecting that MATLAB thinks that it does not have sufficient space to display more labels, a workaround can be to rotate the labels. To do that, after you issue the plot commands, e.g.
plot(tsX);
hold on;
plot(tsY);
plot(tsZ);
add the following command
set(gca,'XTickLabelRotation',90);
Now MATLAB plots with more labels
I am going to report this as a bug to the MATLAB guys.
这篇关于如何始终显示& quot;标签& quot;在X轴上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!