Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Subplot disappears upon resizing of figure #348

Open
2 of 8 tasks
mhered opened this issue Jun 1, 2023 · 2 comments
Open
2 of 8 tasks

Subplot disappears upon resizing of figure #348

mhered opened this issue Jun 1, 2023 · 2 comments
Labels
bug - runtime error cross-platform issue - linux Help wanted - Good for contributing if you are on linux

Comments

@mhered
Copy link

mhered commented Jun 1, 2023

Bug category

  • bug - compilation error
  • bug - compilation warning
  • bug - runtime error
  • bug - runtime warning
  • bug - logic error

Describe the bug

  • I plot a set of two 2D plots using subplot (similar behaviour occurs also when using tiledlayout)
  • it renders ok-ish with some overlap in the text because the starting size of the figure is too small
  • however when I resize the figure with the mouse and it redraws the figure, one of the subplots disappears

Steps to Reproduce

Code:

auto ax1 = matplot::subplot(2, 1, 1);
matplot::plot(ax1, x, y1);
matplot::title(ax1, "Subplot 1");

auto ax2 = matplot::subplot(2, 1, 2);
matplot::plot(ax2, x, y2);
matplot::title(ax2, "Subplot 2");

matplot::show();

Output
Console output as expected

Press ENTER to continue...

Platform

  • cross-platform issue - linux
  • cross-platform issue - windows
  • cross-platform issue - macos

Environment Details:

  • OS: ubuntu
  • OS Version: 20.04
  • Compiler: g++
  • Compiler version: 9.4.0

Additional context

@github-actions github-actions bot added bug - runtime error cross-platform issue - linux Help wanted - Good for contributing if you are on linux labels Jun 1, 2023
@j0hnnybash
Copy link
Contributor

This sounds like an issue I have also encountered.

In my case this was an issue with gnuplot multiplots and the "replotonresize" functionality (which is broken for multiplots and only replots one plot [1]). This option has to be disabled per terminal, usually in the terminals UI e.g. for the QT terminal click on the "wrench" icon and ensure "replot on resize" is unchecked (this setting will be remembered so you only have to do this once).

With the unreleased gnuplot 5.5 the CLI option -noreplotonresize works for both the "qt"[2] and "x11" terminals, unfortunately as of gnuplot 5.4 this option only affects the "x11" terminal [2], this could option could be set by the gnuplot backend.

[1]: http://www.gnuplot.info/faq/faq.html section 8.5
[2]: http://gnuplot.info/docs_5.5/loc21633.html
[3]: https://sourceforge.net/p/gnuplot/bugs/2200/

@Zacrain
Copy link

Zacrain commented Jul 20, 2023

In my case this was an issue with gnuplot multiplots and the "replotonresize" functionality (which is broken for multiplots and only replots one plot [1]). This option has to be disabled per terminal, usually in the terminals UI e.g. for the QT terminal click on the "wrench" icon and ensure "replot on resize" is unchecked (this setting will be remembered so you only have to do this once).

This alleviates the issue on resizing. But that does not help when toggling the grid on / off. In that case one of the subplots still disappears. Also zooming in doesn't seem to work for both subplots.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug - runtime error cross-platform issue - linux Help wanted - Good for contributing if you are on linux
Projects
None yet
Development

No branches or pull requests

3 participants