[Scilab-users] Plot2d and legends

James Holland j_holland at msn.com
Tue May 22 12:28:40 CEST 2018


I am plotting three columns of data using plot2d and I'm adding a legend box
using legends. I have declared the line colours for each plot to make the
graph easier to view. The problem that I have is that the legends box shows
all three of the lines in the same colour (blue). Is this an issue with the
way my code is written?
TIA James

<code>
// plot data 

// the third column: -->m(:,3)
x1 = M1(:,1);   // frequency
y1 = M1(:,2);   // M1 Average
y2 = M2(:,2);   // M2 Average
x2 = M3(:,1);   // Limits frequency
y3 = M3(:,2);   // Limits - average


plot2d(x1, y1, style= color('orange'), logflag = "ln");
plot2d(x1, y2, style= color('blue'), logflag = "ln");
plot2d(x2, y3, style= color('red'), logflag = "ln");
f = gca();                     // get the current axes
bg_color = color('lightgray');              
f.background= bg_color;        //RGB
xtitle("EN55022 Conducted Emissions", "Frequency (MHz)", "dBuV");
legends(['uA7805';'7805SR'; 'EN55022B'],[2,2,2],opt="ur");
xgrid;
</code>



--
Sent from: http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html



More information about the users mailing list