Boxplot with double y-axis
Mostrar comentarios más antiguos
Hello All, I want to plot a boxplot with a double y-axis (reference figure is attached). Actually, I have two sets of variables. One variable value will display on the left side and another variable value will display on the right of the y-axis.
Respuesta aceptada
Más respuestas (4)
Hi,
The key idea is to activate the axis that you want to plot. Suppose I have two ys : y1 and y2, I want to plot y1 on the left side and y2 on the right side, I can do as shown here:
yyaxis left
plot(x,y1);
yyaxis right
plot(x,y2);
You can read more about it at the example shown here.
sunny kant
el 24 de Ag. de 2022
0 votos
1 comentario
I think it is working as intended, as there are two boxplots at the same 'x'.
A simple example is here
load carsmall
yyaxis left
boxplot(Acceleration)
yyaxis right
boxplot(Horsepower)
What you are looking for is a no superposition.
sunny kant
el 24 de Ag. de 2022
0 votos
sunny kant
el 24 de Ag. de 2022
0 votos
Categorías
Más información sobre Exploration and Visualization en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!