【问题标题】:Plot only the data points in the x axes仅绘制 x 轴上的数据点
【发布时间】:2014-10-11 21:26:20
【问题描述】:

它应该有一个简单的答案,我不知何故错过了。

我只想绘制 x 轴上的数据点。其他点让事情变得更加混乱。

这是我的代码:

figure(6);
grid on;
hold on;

colorVec = hsv(length(crl));

for i = 1:(length(crl)-1)
    plot(dc,pathLoadMatrix(i,:),'Color',colorVec(i,:),'linewidth',2, 'marker','o');

end

legend('Crl 10%', 'Crl 20%', 'Crl 30%', 'Crl 40%', 'Crl 50%');
xlabel('No of DC');
ylabel('Primary Path Load');
hold off;

【问题讨论】:

    标签: matlab plot axes


    【解决方案1】:

    试试这个:set( gca(), 'xtick', [2:6] )

    答案必须至少为 30 个字符,因此这是填充文本。

    【讨论】:

    • 我知道它必须是简单的!谢谢!
    • 为了确保它与他的数据点匹配,set( gca(), 'xtick', dc ) 会更通用(它会适应任何x 向量)
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-01-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多