File: color_cycling.rs

package info (click to toggle)
rust-gnuplot 0.0.39-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 532 kB
  • sloc: makefile: 2
file content (31 lines) | stat: -rw-r--r-- 494 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// This file is released into Public Domain.
use crate::common::*;
use gnuplot::*;

mod common;

fn example(c: Common)
{
	let x = 0..10;

	let mut fg = Figure::new();

	let ax = fg.axes2d();
	ax.set_title("Color cycling", &[]);
	ax.set_legend(Graph(0.2), Graph(0.9), &[], &[]);
	for i in 0..10
	{
		ax.lines_points(
			x.clone(),
			x.clone().map(|v| v * 2 + i),
			&[Caption(&format!("{}", i))],
		);
	}

	c.show(&mut fg, "color_cycling");
}

fn main()
{
	Common::new().map(|c| example(c));
}