help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Caption - Legend


From: Brett Green
Subject: Re: Caption - Legend
Date: Thu, 16 Apr 2020 12:27:02 -0400


On Thu, Apr 16, 2020 at 11:49 AM Renato S. Yamane <address@hidden> wrote:
Hello,

Maybe this is a stupid question, but I didn't found an answer in https://octave.sourceforge.io/octave/function/legend.html

I have 2 arrays:

X_axis = 1 line x 11 columns;
Y_axis = 7 lines x 11 columns;

I generate a graph with:

figure(1);
loglog(X_axis,abs(Y_axis));
grid minor;
legend show

But the legend show me:
data1
data2
data3
data4
data5
data6
data7

How may I change the caption of each data? :-)

Many thanks,
Renato


Try something like this:

plot(rand(3))

legtxt{1,1} = "abcd";
legtxt{2,1} = "wxyz";
legtxt{3,1} = "Line 3";
legend(legtxt);

See the documentation here for much more you can do to customize the legend.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]