Insert a table in a figure with the colour specifications of the lines!

3 vues (au cours des 30 derniers jours)
Panos Ale
Panos Ale le 19 Mai 2017
Commenté : Star Strider le 19 Mai 2017
Hallo! I have plot plotted three differet lines in a figure and I want to insert a table(box) to specify each of them based on their colour!
for example. 'blue line' controls 'green line' relatives 'red line' patients

Réponse acceptée

Star Strider
Star Strider le 19 Mai 2017
Use the legend function.
figure(1)
plot(x1, control, '-b', x2, relatives, '-g', x3, patients, '-r')
grid
legend('Controls', 'Relatives', 'Patients')
You can control where the legend appears in the plot with the 'Location' name-value oair. See the documentation for details.
  2 commentaires
Panos Ale
Panos Ale le 19 Mai 2017
Thank you very much!!!!
Star Strider
Star Strider le 19 Mai 2017
As always, my pleasure!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Line Plots dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by