You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: plot.rs
    path of file: ./repos/diem/language/move-prover/lab/src
    
    the code of the file until where you have to start completion: // Copyright (c) The Diem Core Contributors
// SPDX-License-Identifier: Apache-2.0

// Functions for reading benchmark data and converting them to graphics.
// those results and plotting them.

use crate::{
    benchmark,
    benchmark::{Benchmark, BenchmarkData},
};
use anyhow::Context;
use clap::{App, Arg};
use itertools::Itertools;
use plotters::{
    coord::types::RangedCoordu32,
    prelude::{
        Cartesian2d, IntoDrawingArea, IntoFont, RGBColor, Rectangle, SVGBackend, ShapeStyle, Text,
        BLACK, BLUE, CYAN, GREEN, MAGENTA, RED, WHITE, YELLOW,
    },
};
use std::collections::BTreeMap;

// =====================================================================================
// Command line interface

pub fn plot_svg(args: &[String]) -> anyhow::Result<()> {
    let is_number = |s: String| {
        s.pa
    
pub fn plot_svg(args: &[String]) -> anyhow::Result<()> {
    let is_number = |s: String| {
        s.parse::<usize>()
            .map(|_| ())
            .map_err(|_| "expected number".to_string())
    };
    let cmd_line_parser = App::new("plot")
        .version("0.1.0")
        .about("Benchmark plotter for the Move Prover")
        .author("The Diem Core Contributors")
        .arg(
            Arg::with_name("out")
                .long("out")
                .takes_value(true)
                .value_name("FILE")
                .help("file where output will be written too"),
        )
        .arg(
            Arg::with_name("sort")
                .long("sort")
                .help("whether to sort the benchmark data based on the first data file"),
        )
        .arg(
            Arg::with_name("top")
                .long("top")
                .takes_value(true)
                .value_name("NUMBER")
                .validator(is_number)
                .help("plot only the top N entries"),
        )
        .arg(
            Arg::with_name("data-files")
                .multiple(true)
                .value_name("PATH_TO_BENCHMARK_DATA")
                .min_values(1)
                .default_value("")
                .empty_values(false)
                .help("the benchmark data files to plot"),
        );
    let matches = cmd_line_parser.get_matches_from_safe(args)?;
    let get_vec = |s: &str| -> Vec<String> {
        match matches.values_of(s) {
            Some(vs) => vs.map(|v| v.to_string()).collect(),
            _ => vec![],
        }
    };
    let out_file = if matches.is_present("out") {
        matches.value_of("out").unwrap().to_string()
    } else {
        "plot.svg".to_owned()
    };
    let sort = matches.is_present("sort");
    let top = if matches.is_present("top") {
        Some(matches.value_of("top").unwrap().parse::<usize>()?)
    } else {
        None
    };
    let data_files = get_vec("data-files");
    let mut data = vec![];
    for file in data_files {
        data.push(benchmark::read_benchmark(&file).context(format!("cannot open `{}`", file))?);
    }

    if sort {
        data[0].sort();
    }

    if let Some(n) = top {
        data[0].take(n)
    }

    println!("plotting to `{}`", out_file);
    plot_benchmarks_to_file(&out_file, data.as_slice())
}