|
From: Gunter K. <gu...@pe...> - 2018-07-14 20:41:19
|
Dear all, wxMaxima allows to automatically embed gnuplot plots into a maths worksheet: The plot is generated with the png (or pngcairo) terminal and the bitmap is embedded. Tomorrow's nightly build also on right-clicking a plot allows to start a separate gnuplot process - which popups a window in which the user can interactively turn a 3d plot, zoom in and out or measure coordinates with the cursor. There is a problem left, though: - If I start gnuplot as "gnuplot -p /tmp/maxoutXXX.gnuplot" gnuplot closes when the user closes gnuplot's plot window. But the displayed graphics is is not interactive (for example a 3d image cannot be turned using the mouse) - and if /tmp/maxoutXXX.gnuplot ends with a "pause -1" the image can be turned with the mouse. But in this case gnuplot doesn't close when the user dismisses the interactive gnuplot window, which makes gnuplot act like a big memory leak. In the internet I find many related questions like https://groups.google.com/forum/#!topic/comp.graphics.apps.gnuplot/bE0RHH_l7aI ...but until now I didn't find a real solution to my question (most of the questions were from the gnuplot 4.0 times, though) so I'm asking here. Thanks in advance, and kind regards, Gunter. |
|
From: Ethan A M. <eam...@gm...> - 2018-07-14 20:57:00
|
On Saturday, 14 July 2018 22:41:09 Gunter Königsmann wrote: > Dear all, > > wxMaxima allows to automatically embed gnuplot plots into a maths > worksheet: The plot is generated with the png (or pngcairo) terminal and > the bitmap is embedded. Tomorrow's nightly build also on right-clicking > a plot allows to start a separate gnuplot process - which popups a > window in which the user can interactively turn a 3d plot, zoom in and > out or measure coordinates with the cursor. There is a problem left, though: > > - If I start gnuplot as "gnuplot -p /tmp/maxoutXXX.gnuplot" gnuplot > closes when the user closes gnuplot's plot window. But the displayed > graphics is is not interactive (for example a 3d image cannot be turned > using the mouse) > - and if /tmp/maxoutXXX.gnuplot ends with a "pause -1" the image can be > turned with the mouse. But in this case gnuplot doesn't close when the > user dismisses the interactive gnuplot window, which makes gnuplot act > like a big memory leak. > > In the internet I find many related questions like > https://groups.google.com/forum/#!topic/comp.graphics.apps.gnuplot/bE0RHH_l7aI That's from 10 years ago, but the answer is correct. Instead of "pause -1" you want some variant of "pause mouse", possibly "pause mouse close" . See the documentation for the pause command or "help pause". Ethan > ...but until now I didn't find a real solution to my question (most of > the questions were from the gnuplot 4.0 times, though) so I'm asking here. > > Thanks in advance, > and kind regards, > > Gunter. |
|
From: Gunter K. <gu...@pe...> - 2018-07-15 13:16:49
|
> > That's from 10 years ago, but the answer is correct. > Instead of "pause -1" you want some variant of "pause mouse", > possibly "pause mouse close" > . That was exactly what I was searching for. On my gnuplot 5.2 patchlevel 2 it only nearly does what I want, though: It waits until I first close the window and then press <enter> in the terminal I opened gnuplot from. If I first press <enter> in the terminal and then close the gnuplot window or fail to press <enter> gnuplot won't close. I'll attach a simple testfile to this mail. gnuplot wait.gnuplot doesn't work as expected but echo |gnuplot wait.gnuplot does. If I did the Right Thing perhaps I can mimic the latter command somehow... Kind regards, Gunter. |
|
From: Ethan A M. <EAM...@gm...> - 2018-07-15 22:15:00
|
On Sunday, 15 July 2018 15:16:35 Gunter Königsmann wrote:
> >
> > That's from 10 years ago, but the answer is correct.
> > Instead of "pause -1" you want some variant of "pause mouse",
> > possibly "pause mouse close"
> > .
>
> That was exactly what I was searching for.
>
> On my gnuplot 5.2 patchlevel 2 it only nearly does what I want, though:
>
> It waits until I first close the window and then press <enter> in the
> terminal I opened gnuplot from. If I first press <enter> in the terminal
> and then close the gnuplot window or fail to press <enter> gnuplot won't
> close.
>
> I'll attach a simple testfile to this mail.
>
> gnuplot wait.gnuplot
>
> doesn't work as expected but
>
> echo |gnuplot wait.gnuplot
>
> does.
>
> If I did the Right Thing perhaps I can mimic the latter command somehow...
I think you are running into idiosyncracies of the particular
desktop manager or environment. The issue is due partly to what
signal is sent when the plot window is closed, and which process that
signal is delivered to. There may also be a difference depending on
which interactive gnuplot terminal is being used.
For my desktop (KDE 5) and the qt terminal, I get the behavior you
want if I close the plot window with "q" or "cntrl-q" but not if I
close it with "alt-F4" or the window border decoration "x".
Both qt and x11 work as desired if I add the command
bind "Close" "exit gnuplot"
before the pause command.
Ethan
>
> Kind regards,
>
> Gunter.
|
|
From: Gunter K. <gu...@pe...> - 2018-07-16 16:20:10
|
Encountered another proble, this time on Ms Windows: the file I've sent with my first mail if gnuplot is started from the console opens a plot window. If started from wxMaxima, though, gnuplot 5.2 pl 4 uses 100% of one CPU and never opens the plot window. What might have gone wrong? Kind regards, Gunter. Am 15. Juli 2018 23:31:27 MESZ schrieb Ethan A Merritt <EAM...@gm...>: >On Sunday, 15 July 2018 15:16:35 Gunter Königsmann wrote: >> > >> > That's from 10 years ago, but the answer is correct. >> > Instead of "pause -1" you want some variant of "pause mouse", >> > possibly "pause mouse close" >> > . >> >> That was exactly what I was searching for. >> >> On my gnuplot 5.2 patchlevel 2 it only nearly does what I want, >though: >> >> It waits until I first close the window and then press <enter> in the >> terminal I opened gnuplot from. If I first press <enter> in the >terminal >> and then close the gnuplot window or fail to press <enter> gnuplot >won't >> close. >> >> I'll attach a simple testfile to this mail. >> >> gnuplot wait.gnuplot >> >> doesn't work as expected but >> >> echo |gnuplot wait.gnuplot >> >> does. >> >> If I did the Right Thing perhaps I can mimic the latter command >somehow... > >I think you are running into idiosyncracies of the particular >desktop manager or environment. The issue is due partly to what >signal is sent when the plot window is closed, and which process that >signal is delivered to. There may also be a difference depending on >which interactive gnuplot terminal is being used. > >For my desktop (KDE 5) and the qt terminal, I get the behavior you >want if I close the plot window with "q" or "cntrl-q" but not if I >close it with "alt-F4" or the window border decoration "x". >Both qt and x11 work as desired if I add the command > > bind "Close" "exit gnuplot" > >before the pause command. > > > Ethan > >> >> Kind regards, >> >> Gunter. -- Diese Nachricht wurde von meinem Android-Gerät mit K-9 Mail gesendet. |
|
From: Gunter K. <gu...@pe...> - 2018-07-17 10:23:37
|
On 17.07.2018 01:49, Ethan A Merritt wrote: > On Monday, 16 July 2018 18:19:56 you wrote: >> Encountered another proble, this time on Ms Windows: the file I've sent with my first mail if gnuplot is started from the console opens a plot window. >> If started from wxMaxima, though, gnuplot 5.2 pl 4 uses 100% of one CPU and never opens the plot window. >> >> What might have gone wrong? > > Sorry, I can't help with Windows questions. > Did the bind command fix your original problem? It did. Thanks a lot! ...and I have found out that if you open gnuplot as a console app it doesn't need 100% of one CPU - even if it still refuses to open a plot window in that case. No idea why. But - I don't even own an own windows installation... Kind regards, Gunter. |
|
From: Tatsuro M. <tma...@ya...> - 2018-07-18 23:05:58
|
> ...and I have found out that if you open gnuplot as a console app it > doesn't need 100% of one CPU - even if it still refuses to open a plot > window in that case. No idea why. But - I don't even own an own windows > installation... > > - Windows allows to open applications with and without a console. > Opening gnuplot (or wgnuplot) causes 100% of one CPU to be consumed. > - Windows allows to hide the console. If the console of gnuplot or > wgnuplot is hidden the plot window is hidden, too. I think that this mailing list is not suitable to discuss what you wrote. Please post your issues to the bug ticket on gnuplot sourceforge site. https://sourceforge.net/p/gnuplot/bugs/ Bastian has been working extensively for gnuplot on native windows. I think that you should raise his attention on this matter. Tatsuro |
|
From: Gunter K. <gu...@pe...> - 2018-07-18 17:10:17
|
I hate finding threads in the internet that don't contain a solution =>
writing how far I got:
- Windows allows to open applications with and without a console.
Opening gnuplot (or wgnuplot) causes 100% of one CPU to be consumed.
- Windows allows to hide the console. If the console of gnuplot or
wgnuplot is hidden the plot window is hidden, too.
=> I can open gnuplot with a console and show the console and will get a
plot - and a superfluous window. But I guess I can live with that.
And I have to add a 3-line construct to my file in order to make the
console window autoclose whilst keeping the window live (aka reacting to
the mouse):
bind "Close" "exit gnuplot"
pause mouse close
exit
Kind regards,
Gunter.
|
|
From: Kevin O. <rko...@gm...> - 2018-07-18 20:27:53
|
On Wed, Jul 18, 2018 at 10:10 AM, Gunter Königsmann <gu...@pe...> wrote: > I hate finding threads in the internet that don't contain a solution => > writing how far I got: > > - Windows allows to open applications with and without a console. > Opening gnuplot (or wgnuplot) causes 100% of one CPU to be consumed. > - Windows allows to hide the console. If the console of gnuplot or > wgnuplot is hidden the plot window is hidden, too. > > => I can open gnuplot with a console and show the console and will get a > plot - and a superfluous window. But I guess I can live with that. > > And I have to add a 3-line construct to my file in order to make the > console window autoclose whilst keeping the window live (aka reacting to > the mouse): > > > bind "Close" "exit gnuplot" > pause mouse close > exit > > Kind regards, > > Gunter. > > ------------------------------------------------------------ > ------------------ > I had that issue about 14 years ago and put in a signal handler that killed gnuplot on a SIGTERM or other terminating signals. (I was forking gnuplot off of a parent that used chat to communicate with gnuplot.) That is another approach that worked well before pause came on the scene. -- Kevin Oberman, Part time kid herder and retired Network Engineer E-mail: rko...@gm... PGP Fingerprint: D03FB98AFA78E3B78C1694B318AB39EF1B055683 |