Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

New to MATLAB?

Are multcompare plots compatible with subplots?

Asked by Rainer

Rainer (view profile)

on 14 May 2013

Does anyone know if it is possible to have the graphs from multcompare be plotted in subplots?

  • load carsmall
  • [p,t,st] = anova1(MPG,Origin,'off');
  • [p,t,st2] = anova1(Displacement,Origin,'off');
  • figure
  • [c,m,h,nms] = multcompare(st);
  • figure
  • [c,m,h,nms] = multcompare(st2);

The script above generates 2 graphs. I have tried every which way to get the graphs to be in a 2,1 subplot but can't do it.

0 Comments

Rainer

Rainer (view profile)

Products

No products are associated with this question.

2 Answers

Answer by Tom Lane

Tom Lane (view profile)

on 15 May 2013
Accepted answer

You are right that the code clears the current figure before plotting, so setting up a subplot won't help.

I just tried deleting the "clf" line from meansgraph.m, and it seemed to work okay. It looks a little funny since the function puts up a graph title instructing you to click on a group, and this instruction then appears over each graph, but the mouse operations work as they should.

You could try deleting this line.

1 Comment

Rainer

Rainer (view profile)

on 15 May 2013

Thanks a lot Tom. That worked.

Tom Lane

Tom Lane (view profile)

Answer by Sergio

Sergio (view profile)

on 24 Jul 2013

But meansgraph.m is a Read Only file. How can I delet that line?

1 Comment

Tom Lane

Tom Lane (view profile)

on 25 Jul 2013

If you control the disk where it is stored, you may just be able to overwrite the old file. Otherwise you may have to make your own copies of multcompare, meansgraph, and perhaps some others, and place them in your own area.

Sergio

Sergio (view profile)

Contact us