Skip to content

Conversation

@anjaninandan001
Copy link

@anjaninandan001 anjaninandan001 commented Feb 3, 2026

While testing anova1, I found that the boxplot does not appear if another figure window is already open. This occurs on the Qt graphics toolkit (WSL2, Linux, Windows).


How to reproduce

plot(1:10);          % keep this window open
anova1(rand(10,3));  % boxplot does not appear in a new window

Observed behavior

  • plot(1:10) creates a figure normally.
  • If that figure remains open, the anova1 figure does not appear in new window, not matching with matlab behaviour.

Expected behavior

anova1 should always open a new figure window and draw its boxplot there, regardless of how many other figure windows are already open, matching MATLAB’s behavior.


Fix

Explicitly select the new figure and create a new axes object as the active context before calling boxplot:

f  = figure ();
set (0, "currentfigure", f);
ax = axes ("parent", f);
set (f, "currentaxes", ax);
boxplot (x, group_id, "Notch", "on", "Labels", group_names);

This ensures that anova1 always draws its plot in a new and correct figure, regardless of how many figure windows are open.


Notes

  • Savannah is currently down. A corresponding bug report will be opened and linked here once it becomes available.

@pr0m1th3as
Copy link
Member

  • Savannah is currently down. A corresponding bug report will be opened and linked here once it becomes available.

Do not use savannah for bug reports concerning the statistics package. Just create an issue in this repository instead.

@anjaninandan001
Copy link
Author

I’ve opened issue #386 . Kindly review it and let me know if any additional details are needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants