Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
2列のデータがあり、オクターブを使用してプロットしたいと思います。私は次のことをしました:
f = load('rate.txt','r') plot(f(:,1) ,f(:,2)); plot(f(:,1)); hold on; plot(f(:,2));
それぞれのグラフを取得しました。しかし、両方とも同じ色です。この色付きのグラフがこれであり、この色付きのグラフがこれであるように、異なるグラフに異なる色を割り当て、それらに名前を付けたいと思います。どうすればいいですか?
線のプロパティを使用して裾を描くことができます。そしてlegend、どちらが何であるかを述べるためのものです。Octave は MATLAB と同じ構文を使用していると思います。コード スニペットの例を次に示します。
legend
x = 0:0.01:5; %# An example x grid plot(x,sin(x),'r-'); hold on; plot(x,cos(x),'b--'); legend('sin', 'cos')