Skip to content

Couldn't spawn gnuplot. Make sure it is installed and available in PATH #49

Open
@hasanAjsf

Description

@hasanAjsf

While running the example:

// This file is released into Public Domain.
use gnuplot::*;
use std::f32;

fn main()
{
	let mut fg = Figure::new();
	let mut x = vec![];
	for i in 0..100i32
	{
		x.push(i as f32 * 0.1 - 5.0);
	}

	let mut t = 0.0;
	fg.set_terminal("gif animate optimize delay 2 size 480,360", "fg.gif.gif");
	for i in 0..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 as f32 * 0.1 * 2. * f32::consts::PI).sin()),
			&[Color("blue")],
		);
		ax.lines(
			x.iter(),
			x.iter()
				.map(|&x| (x + t as f32 * 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:5
note: 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:

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions