Effacer les filtres
Effacer les filtres

Set color property for hggroup objects

2 vues (au cours des 30 derniers jours)
Erik de Boer
Erik de Boer le 27 Jan 2011
Hello
In a plot containing 6 line object with different colors I've created 2 hggroups to use in the legend. The 2 colors legend subsequently shows belong to the last 2 line objects. Nothing new there, but I would like legend to show for a given hggroup a color that corresponds to one of its child lines.
This image illustrates the problem: http://img203.imageshack.us/f/latconstraint.png/
Thanks for any help.

Réponse acceptée

Seth DeLand
Seth DeLand le 27 Jan 2011
Erik,
You need to set the handle visibility of certain lines to off:
set(line_handle,'HandleVisibility','off')
When you set the handle visibility of a line to off, the legend command will not use that line when creating the legend. So if you set the handle visibility of 2 of your red lines and 2 of your green lines to 'off', legend will only use the handles for the remaining red and green line to draw the legend.
  1 commentaire
Erik de Boer
Erik de Boer le 27 Jan 2011
Works, Thank you!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Graphics Object Properties 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