Giter Site home page Giter Site logo

Interactive gnuplot window about rustgnuplot HOT 10 CLOSED

birktj avatar birktj commented on August 15, 2024
Interactive gnuplot window

from rustgnuplot.

Comments (10)

SiegeLord avatar SiegeLord commented on August 15, 2024

I tried this out here and there and my conclusion is that it's not quite true universally. Some terminals definitely support interactivity without pause mouse close. I wanted to add it by default, but it breaks two features:

  • Ability to save a figure using multiple formats
  • The 'animation' feature where you plot multiple times to the same gnuplot window.

There's probably a way to get it working (perhaps as an option?), but for now I'll not add this in.

To make your life easier, however, I added a method on Figure struct: set_post_commands, so you can do:

fig.set_post_commands("pause mouse close");
fig.show();

from rustgnuplot.

birktj avatar birktj commented on August 15, 2024

That's perfectly fine. Thank you for looking into it and with the new method this almost becomes a non-issue.

from rustgnuplot.

gdesmott avatar gdesmott commented on August 15, 2024

Hi there,

I've tried your workaround as I'm facing the same issue but get this error message:

gnuplot> pause mouse clone
                     ^
         line 0: expecting string

Am I missing something? I'm using gnuplot 5.0 and version 0.0.30 of the crate.

thanks!

from rustgnuplot.

birktj avatar birktj commented on August 15, 2024

I think that your problem is that it should be pause mouse close, not pause mouse clone

from rustgnuplot.

gdesmott avatar gdesmott commented on August 15, 2024

Oh indeed, no idea how I screwed that, thanks! :)

I no longer get the error but controls from the gnuplot_qt window are still not working.

from rustgnuplot.

wucke13 avatar wucke13 commented on August 15, 2024

Controls stall working if gnuplot is closed. Try adding loop{} to the end of the scop which calls fig.show().

from rustgnuplot.

gdesmott avatar gdesmott commented on August 15, 2024

Doesn't seem to help, controls are still not working.

from rustgnuplot.

SiegeLord avatar SiegeLord commented on August 15, 2024

Hmm, I can't seem to reproduce this. I added fg.set_post_commands("pause mouse close"); and with the qt terminal, I could toggle the grid without issue. I'm using gnuplot 5.2 patchlevel 8.

from rustgnuplot.

gdesmott avatar gdesmott commented on August 15, 2024

Strange, I'm using the same gnuplot version.

Could you please provide the test case you are using (or even add it as an examples to the repo) so we are sure to try running the same code?

from rustgnuplot.

SiegeLord avatar SiegeLord commented on August 15, 2024

With 52016af, calling show issues pause mouse close internally, so by default the plots remain interactive. You can test this out with most of the examples, e.g. cargo run --example lines_points_3d

from rustgnuplot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.