[英]Cannot change line color in MATLAB plot
無論我在此 MATLAB 繪圖上指定的線條顏色是什么,生成的繪圖都會顯示以下自動着色:
這是我使用的代碼:
figure
plot(cumsum(sign([y_pred]).*tst_y)/std(sign([y_pred]).*tst_y), 'g')
xlabel('Time');
ylabel('Cumulative Returns (%)');
title('Neural Network Model Returns')
hold on
plot(cumsum(tst_y)/std(tst_y),'r')
hold off
我嘗試了不同的指定顏色的方法,甚至嘗試在圖形編輯器中編輯線條顏色。 知道如何使這些線條具有不同的顏色嗎? 我使用的是 Matlab 2016a 試用版
我也不能復制你的問題。 也許 y_pred 或 tst_y 中的數據不是簡單的雙類(也許是神經網絡工具箱特有的東西?),因此在 matlab 中具有不同定義的繪圖函數。
否則你應該可以嘗試
figure
pl=plot(cumsum(sign([y_pred]).*tst_y)/std(sign([y_pred]).*tst_y));
pl.Color='g';
xlabel('Time');
ylabel('Cumulative Returns (%)');
title('Neural Network Model Returns')
hold on
pl=plot(cumsum(tst_y)/std(tst_y));
pl.Color='r';
hold off
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.