【问题标题】:Show only predefined value in axes MATLAB仅在坐标区中显示预定义值 MATLAB
【发布时间】:2014-07-20 20:59:43
【问题描述】:

我只想在x-axes 上显示这些x-values

 xx=[0.0005 0.005 0.05 0.1 0.25 0.5 0.75 1 1.25 1.5];

有可能吗?

【问题讨论】:

标签: matlab plot axes subplot


【解决方案1】:

您可以使用XtTickLabel 属性修改轴标签。例如:

set(gca,'XTickLabel',[0.0005 0.005 0.05 0.1 0.25 0.5 0.75 1 1.25 1.5])

这只会更改标签,而不是绘图上的实际值。要检查值,您可以使用:

set(gca,'XTick',[0.0005 0.005 0.05 0.1 0.25 0.5 0.75 1 1.25 1.5]);
set(gca,'XScale','log');  % Your xx values seem to be logarithmic, so this can help.

【讨论】:

  • 运行多个数字时出现问题。假设它适用于 figure, set(gca,'XTickLabel',[64 128 256 512]) plot([64 128 256 512],[ber_LPC_SVD(1) ber_LPC_SVD(2) ber_LPC_SVD(3) ber_LPC_SVD(4)] ,'r') 但它不适用于 xx=[64 128 256 512];图,设置(gca,'XTickLabel',[64 128 256 512])保持情节(xx,ber_LPC_SVD(:),'r')情节(xx,ber_LWT_SVD(:),'b')情节(xx,ber_DWT_SVD (:),'k') plot(xx,ber_QIM_SVD(:),'y') plot(xx,ber_LPC_DCT(:),'g') xlabel('帧长(样本)'),ylabel('BER ( %)') 推迟为什么?
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-11-14
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多