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

fg.show() doesn't do anything #29

Closed
ManifoldFR opened this issue Jun 9, 2018 · 5 comments
Closed

fg.show() doesn't do anything #29

ManifoldFR opened this issue Jun 9, 2018 · 5 comments

Comments

@ManifoldFR
Copy link

I have the following code:

// myexample.rs
let mut fg = Figure::new();
    
fg.set_terminal("qt", "");

fg.axes2d()
        .lines(&times, &lambda_values,
            &[
                Caption("λ(t)"),
                Color("#1E90FF"),
            ])
        .points(&event_times, &event_intens, 
            &[
                Caption("Events"),
                Color("black"),
                PointSymbol('O'),
                PointSize(0.8)])
        .set_x_label("Temps t", &[])
        .set_y_label("Intensité", &[]);
    
fg.show();

But when I run cargo run --example myexample, the gnuplot window doesn't show up (not even for a split second). When I choose a different backend such as pngcairo and an output file, it won't create the file either. I have to echo to a .gnuplot file and run gnuplot manually.

I'm running Windows 10 64-bit, with Rust 1.26.2 and gnuplot 5.3.

@SiegeLord
Copy link
Owner

SiegeLord commented Jun 10, 2018

To be clear, when you say echo you mean fg.echo_to_file? If so, then that's very strange, as fg.show uses the same output to interact with gnuplot. Does this happen only for this code or everything? Have you tried running one of RustGnuplot's examples (I'm guessing the easiest way is to clone the repository and then do cargo run --example box_and_whisker).

@ManifoldFR
Copy link
Author

ManifoldFR commented Jun 10, 2018

Yes, I do fg.echo_to_file to get the gnuplot file. Running the example as you said gives me

$ cargo run --example box_and_whisker -- --terminal wxt
warning: unused manifest key: package.autobenches
warning: unused manifest key: package.autobins
warning: unused manifest key: package.autoexamples
warning: unused manifest key: package.autotests
    Finished dev [unoptimized + debuginfo] target(s) in 0.0 secs
     Running `target\debug\examples\box_and_whisker.exe --terminal wxt`
help:Some("false")
no-show:Some("false")
terminal:Some("wxt")

but no window shows up. Same with using qt and windows.

@SiegeLord
Copy link
Owner

I think we are hitting rust-lang/cargo#5598. If you launch your program directly via target/debug/your_binary.exe, it should work (at least it worked for me).

@ManifoldFR
Copy link
Author

Thanks, that worked. That is quite surprising behaviour!

@SiegeLord
Copy link
Owner

Should be fixed, as the associated cargo bug is fixed.

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

No branches or pull requests

2 participants