Legend giving different colour
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Saurabh Sakpal
le 30 Août 2015
Commenté : Saurabh Sakpal
le 30 Août 2015
I have attached pictures of my problem, as you can see i am plotting 4 lines (which are cells) of colour, yellow, red, green and black. The plotting isnt the issue, but the legend gives all the same colour (yellow)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/148573/image.png)
which makes it hard to distinguish. Can someone help me?
3 commentaires
Walter Roberson
le 30 Août 2015
Are you using R2014b or later, or are you using R2014a or earlier? The behavior of "hold on" changed in R2014b so we need to know which of the two situations we are dealing with.
Réponse acceptée
Geoff Hayes
le 30 Août 2015
Saurabh - what can you tell us about the dimensions of t_cell{i} and Act_6{i}? Are both arrays, or are one or both matrices?
Or, even better, if you do the following
h = plot(t_cell{i}, Act_6{i}, 'y');
what is h? Typically, the behaviour you describe above is due to the fact that more than one graphics object has been plotted with your single call to plot (which usually happens when one or both of your inputs to plot is a matrix). In your case, at least four may have been plotted. As h will contain all of the handles to the graphics objects called by plot, then if the dimension of this array is greater than one then that will explain the problem.
9 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Title 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!