Ich möchte mit xfpoly
Begrenzungen erzeugen und sie unter Verwendung von xs2pdf
speichern. Dann möchte ich ein Diagramm von 2 Funktionen in diesen Grenzen anzeigen, eine Legende zu diesen Funktionen hinzufügen und das Bild erneut speichern.Scilab - Legend NUR für einen bestimmten Satz von Funktionen
Mein Code folgt ...
clear; clc; xdel(winsid());
t = -2:0.01:2;
x_1 = t.^2; x_2 = t.^4;
xfpoly([-3 -2 -2 -3], [0 0 16 16], color('grey'));
ax = gca();
ax.auto_clear = 'off'; ax.data_bounds = [-3, 0; 3, 3];
ax.box = 'on';
ax.axes_visible = ['on','on','off']; ax.tight_limits = ['on','on','off'];
xfpoly([2 3 3 2], [0 0 16 16], color('grey'));
xfpoly([-1 1 1 -1], [1 1 16 16], color('grey'));
xs2pdf(gcf(), 'fig_1');
plot2d(t, [x_1', x_2'], [color('green'), color('red')]);
legend(['t^2'; 't^4']);
leg_ent = gce();
leg_ent.text = ['';'';'';'t^2'; 't^4']
xs2pdf(gcf(), 'fig_2');
Wenn meine Antwort Ihnen geholfen hat, können Sie sie upvoten. Ich bin froh, dass ich helfen konnte. – Attila
Ich würde gerne upvote. Aber mein Ruf ist zu gering, um das zu tun ... – ska109