# Combine two box plots and a line plot in one figure

20 views (last 30 days)

Show older comments

### Answers (2)

Lukas Öhlund
on 6 Sep 2023

Edited: DGM
on 6 Sep 2023

All the x-vectors needs to be categorical. I have not tried creating two boxplots in the same graph, but I have combined a boxchart and line-plots.

What i do is:

figure()

boxchart(my_array_containing_data)

hold on

categorical_x_vect = categorical(my_real_x_vect);

plot(categorical_x_vect, my_y_data)

hold off

I know this is an old question, but maybe it helps someone.

Cheers!

##### 0 Comments

### See Also

### Categories

### Community Treasure Hunt

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

Start Hunting!