help-octave
[Top][All Lists]
Advanced

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

Re: Caption - Legend


From: Renato S. Yamane
Subject: Re: Caption - Legend
Date: Mon, 20 Apr 2020 15:45:19 +0100

Em qui., 16 de abr. de 2020 às 17:27, Brett Green <address@hidden> escreveu:

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? :-)


Try something like this:

plot(rand(3))

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


 Thanks Brett,

I forgot to tell that the amount of graphs is not fixed.
The amount of graphs is a variable in the code.

There is an way to "legtxt" (in your example) keep increasing until reach the number of graphs?

Example, if I have 10 graphs, the legtxt should be from {1,1} til {10,1}

Many thanks,
Renato 

reply via email to

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