【问题标题】:Matlab: How to plot without color graduation?Matlab:如何在没有颜色分级的情况下绘图?
【发布时间】:2016-08-08 19:19:22
【问题描述】:

我的朋友制作了一个脚本来处理大量数据并绘制各种图,但是当他运行脚本时,根据图例,图形具有不同的颜色,而当我这样做时,所有图形都相似,并带有颜色渐变从黑色到红色! (见图)为什么会有所不同?如何获得不同颜色的图表?

带有彩色渐变图的二维图:-

figure
hold on
plot(sentar_7.created_at, sentar_7.acc_diff, '-');
plot(sentar_7.created_at, sentar_7.stand_toggle, '-');
plot(sentar_7.created_at, sentar_7.state, '-');
title('Sentar 7 acc')
xlabel('tid')
ylabel('dist [cm]')
legend('acc diff','stand toggle', 'state')
hold off

【问题讨论】:

    标签: matlab plot colors


    【解决方案1】:

    is a known issue 带有某些英特尔显卡驱动程序。一种可能的解决方法是使用基本的硬件渲染:

    opengl hardwarebasic
    

    您也可以禁用线对象的AlignVertexCenters 属性:

    h = findall(gca, 'type', 'line')
    set(h, 'AlignVertexCenters', 'off')
    

    最好的解决方案可能是将显卡驱动程序更新到 4380 版本。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-04-07
      • 1970-01-01
      • 1970-01-01
      • 2018-05-15
      • 1970-01-01
      • 2014-04-28
      • 2014-08-19
      • 1970-01-01
      相关资源
      最近更新 更多