Change curve colour interactionplot

1 visualización (últimos 30 días)
Marco
Marco el 29 de Abr. de 2022
Respondida: Abhishek Chakram el 28 de Sept. de 2023
Hello,
I would like to change the colours of the curves in an interaction plot. Is there a way to do that?
Regards
Marco

Respuestas (1)

Abhishek Chakram
Abhishek Chakram el 28 de Sept. de 2023
Hi Marco,
It is my understanding that you are facing difficulty in changing the colors of the curves in an interaction plot. Here is a sample code for the same:
% Sample data for interactionplot
rng default; % For reproducibility
y = randn(1000,1);
group = ceil(3*rand(1000,4));
y = interactionplot(y,group,'varnames',{'A','B','C','D'})
% Change the curve color
y.Children(3).Children(1).Color = [0 0 0]
Here the variable y contains a property ‘children’ through which you can access any of the axes in the interaction plot. Use the second ‘children’ property to access the line/curve. Lastly use the ‘Color’ property to set the desired color.
Best Regards,
Abhishek Chakram

Categorías

Más información sobre 2-D and 3-D Plots en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by