On your plot, you have 3 polylines with different renderings:
--> gca().children(2)
ans =
Handle of type "Compound" with properties:
==========================================
parent: Axes
children: ["Polyline";"Polyline";"Polyline"]
visible = "on"
user_data = []
tag = ""
The legend() function list them and displays each rendered line, one at a time. To only have a single listed item, either create a single line or use the compound containing the 3 lines as “legend link”.
Note: I never used the compound as legend link so it might not work.
Hello, at certain circumstances, I would like to disable the legend in the plot.
I tried following:
if condition then
legend('off');
else
legend(['Sinus', 'Kosinus']);
end
--> legend();
at line 4 of function legend ( /home/smartie/Tools/scilab-2024.0.0/share/scilab/modules/graphics/macros/legend.sci line 17 )
legend: Wrong number of input argument(s): At least 1 expected.
--> h = gca();
--> h.legends = [];
Submatrix incorrectly defined.