RustGnuplot icon indicating copy to clipboard operation
RustGnuplot copied to clipboard

Plot disappearing after replot

Open carlonluca opened this issue 3 years ago • 2 comments

Hello, I noticed that, when creating a Figure with two plots (2 rows, 1 colum), the first cell (index 0) seems to disappear during a replot. It is sufficient to trigger a replot either with the proper button or by resizing the window and the plot in the first cell disappears.

I tried to plot with the same exact code both in cell 0 and cell 1, and I can reproduce the issue: cell 0 disappears on the first replot, while the second is properly replotted.

Is this only happening to me? Any idea what may be wrong? Thanks!

carlonluca avatar Jan 04 '22 13:01 carlonluca

On the surface, this is a limitation of gnuplot, e.g. see https://sourceforge.net/p/gnuplot/feature-requests/505/. But perhaps we can do something about on Rust's side of things, since, after all, we do store all the state necessary to redraw the plots. The main question will be to somehow route the resize or replot button event back to Rust so we can redraw things.

SiegeLord avatar Jan 05 '22 01:01 SiegeLord

I have to say I wrote here because I could not reproduce this with Octave. Then, I found out Octave uses gnuplot only if instructed to do so, and in that case I could reproduce the same issue. So, I guess this should probably be solved in gnuplot, shouldn't it?

carlonluca avatar Jan 05 '22 13:01 carlonluca

As of 0.0.40, we switched to using temporary files to pass data to gnuplot, which bypasses this limitation.

SiegeLord avatar Jan 16 '24 05:01 SiegeLord