You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// This file is released into Public Domain.use gnuplot::*;use std::f32;fnmain(){letmut fg = Figure::new();letmut x = vec![];for i in0..100i32{
x.push(i asf32*0.1 - 5.0);}letmut t = 0.0;
fg.set_terminal("gif animate optimize delay 2 size 480,360","fg.gif.gif");for i in0..100{if i > 0{
fg.new_page();}let ax = fg.axes2d().set_y_range(Fix(-1.0),Fix(1.0));
ax.lines(
x.iter(),
x.iter().map(|&x| (x + t asf32*0.1*2.* f32::consts::PI).sin()),&[Color("blue")],);
ax.lines(
x.iter(),
x.iter().map(|&x| (x + t asf32*0.1*2.* f32::consts::PI).cos()),&[Color("red")],);
t += 0.1;}
fg.echo_to_file("fg.gif.gnuplot");
fg.show();}
I got the error:
Finished dev [unoptimized + debuginfo] target(s) in 0.20s
Running `target\debug\rust.exe`
thread 'main' panicked at 'Couldn't spawn gnuplot. Make sure it is installed and available in PATH.: Os { code: 2, kind: NotFound, message: "The system cannot find the file specified." }', src\libcore\result.rs:1165:5note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.error: process didn't exit successfully: `target\debug\rust.exe` (exit code: 101)
Knowing that I've gnuplot and it is installed in my Win 10 machine, and added to the path:
The text was updated successfully, but these errors were encountered:
It failed because it tries to execute the command gnuplot --version, and could not find gnuplot in your path.
Can you please try to execute that same command by hand ?
You also need to make sure the rust process (and the library) have the updated PATH environment when trying to call gnuplot. Restarting the computer would do the trick. (I guess it has been been done long ago already, so if gnuplot is still installed, it should just work.)
While running the example:
I got the error:
Knowing that I've
gnuplot
and it is installed in my Win 10 machine, and added to the path:The text was updated successfully, but these errors were encountered: