View on

Example: other/demo

Output File:

Source File:

width: 1439px;
height: 980px;

margin: 2pt;
margin-top: 1em;

box {
  height: 260px;

  position: top;
  margin-top: 1em;
  margin-bottom: 1em;

  plot {
    width: 490px;
    position: left;

    margin-right: 2em;

    scale-y-min: 0;
    scale-y-max: 55;
    scale-x-min: -3.5;
    scale-x-max: 3.5;

    bars {
      xs: -3, -2, -1, 0, 1, 2, 3;
      ys: 10, 28, 20, 26, 41, 44, 37;
      size: .6em;
      offset: .45em;
      color: #4572a7;
    }

    bars {
      xs: -3, -2, -1, 0, 1, 2, 3;
      ys: 12, 19, 23, 30, 35, 43, 33;
      size: .6em;
      offset: -.45em;
      color: #aa4643;
    }

    legend {
      position: top left inside;
      items: A, B;
      colors: #4572a7, #aa4643;
    }

    axis {
      position: bottom;
      layout: linear(1, align -3);
    }

    axis {
      position: top;
    }

    axis {
      position: left;
      width: 60px;
      layout: linear(10);
    }
  }

  plot {
    width: 430px;
    position: left;

    margin-left: 1em;
    margin-right: 1em;

    scale-x-padding: 0.5;
    scale-y-min: 5;
    scale-y-max: 60;

    areas {
      xs: 0, 1, 2, 3, 4, 5, 6;
      ys: 10, 28, 20, 26, 41, 44, 37;
      size: .6em;
      offset: .45em;
      color: #4572a7;
    }

    areas {
      xs: 0, 1, 2, 3, 4, 5, 6;
      ys: 8, 19, 16, 23, 35, 29, 33;
      size: .6em;
      offset: -.45em;
      color: #aa4643;
    }

    legend {
      position: top left inside;
      items: A, B;
      colors: #4572a7, #aa4643;
    }

    axis {
      position: bottom;
      layout: discrete;
      labels: A, B, C, D, E, F, G;
    }

    axis {
      position: top;
    }
  }

  plot {
    width: 490px;
    position: left;

    margin-left: 2em;

    scale-x-padding: 0.5;

    scale-x-min: 0;
    scale-x-max: 200;
    scale-y-min: 0;
    scale-y-max: 280;

    points {
      xs: 10, 60, 160, 130, 150, 30, 115;
      ys: 80, 150, 180, 50, 80, 100, 190;
      sizes: 2pt, 9pt, 3pt, 6pt, 4pt, 3pt;
      colors: #4572a7, #aa4643;
    }

    legend {
      position: top left inside;
      items: A, B;
      colors: #4572a7, #aa4643;
    }

    axis {
      position: bottom;
      layout: linear(40);
    }

    axis {
      position: right;
      width: 60px;
      layout: linear(50);
    }

    axis {
      position: top;
    }
  }
}

box {
  position: top;
  margin-top: 2em;
  height: 420px;

  plot {
    width: 490px;
    position: right;
    margin-right: .5em;
    height: 340px;

    scale-y-min: 0;
    scale-y-max: 55;
    scale-x-min: -3.5;
    scale-x-max: 3.5;

    bars {
      xs: -3, -2, -1, 0, 1, 2, 3;
      ys: 10, 28, 20, 26, 41, 44, 37;
      size: .6em;
      offset: .45em;
      color: #4572a7;
    }

    bars {
      xs: -3, -2, -1, 0, 1, 2, 3;
      ys: 12, 19, 23, 30, 35, 43, 33;
      size: .6em;
      offset: -.45em;
      color: #aa4643;
    }

    legend {
      position: top left inside;
      items: A, B;
      colors: #4572a7, #aa4643;
    }

    axis {
      position: bottom;
      layout: linear(1, align -3);
    }

    axis {
      position: top;
    }

    axis {
      position: right;
      width: 60px;
      layout: linear(10);
    }

  }

  plot {
    position: top;
    width: 900px;
    height: 130px;
    margin-bottom: 1em;
    scale-y-min: -4;
    scale-y-max: 8;

    lines {
      xs: csv('tests/testdata/measurement2.csv', time);
      ys: csv('tests/testdata/measurement2.csv', value1);
      colors: #4572a7;
      stroke: 2pt;
    }

    axis {
      position: top;
      format: datetime("%H:%M:%S");
      height: 30px;
    }

    axis {
      position: left;
      width: 60px;
      layout: linear(4, align -2);
      labels: "-1.0", "0", "1.0";
    }

    legend {
      position: top left inside;
      items: "Channel 1";
      colors: #4572a7;
    }

  }

  plot {
    position: top;
    width: 900px;
    height: 100px;
    margin-bottom: 1em;
    scale-y-min: -4;
    scale-y-max: 8;

    lines {
      xs: csv('tests/testdata/measurement2.csv', time);
      ys: csv('tests/testdata/measurement2.csv', value2);
      colors: #aa4643;
      stroke: 2pt;
    }

    axis {
      position: left;
      width: 60px;
      layout: linear(4, align -2);
      labels: "-1.0", "0", "1.0";
    }

    legend {
      position: top left inside;
      items: "Channel 2";
      colors: #aa4643;
    }
  }

  plot{
    position: top;
    width: 900px;
    height: 130px;
    margin-bottom: 1em;
    scale-y-min: -4;
    scale-y-max: 8;

    lines {
      xs: csv('tests/testdata/measurement2.csv', time);
      ys: csv('tests/testdata/measurement2.csv', value3);
      colors: #89a54e;
      stroke: 2pt;
    }

    axis {
      position: bottom;
      format: datetime("%H:%M:%S");
      height: 30px;
    }

    axis {
      position: left;
      width: 60px;
      layout: linear(4, align -2);
      labels: "-1.0", "0", "1.0";
    }

    legend {
      position: top left inside;
      items: "Channel 3";
      colors: #89a54e;
    }
  }


}

box {
  height: 260px;

  position: top;
  margin-top: 1em;
  margin-bottom: 1em;

  plot {
    width: 490px;
    position: left;

    margin-right: 2em;

    scale-y-min: 0;
    scale-y-max: 55;
    scale-x-min: -3.5;
    scale-x-max: 3.5;

    bars {
      xs: -3, -2, -1, 0, 1, 2, 3;
      ys: 10, 28, 20, 26, 41, 44, 37;
      size: .6em;
      offset: .45em;
      color: #4572a7;
    }

    bars {
      xs: -3, -2, -1, 0, 1, 2, 3;
      ys: 12, 19, 23, 30, 35, 43, 33;
      size: .6em;
      offset: -.45em;
      color: #aa4643;
    }

    legend {
      position: top left inside;
      items: A, B;
      colors: #4572a7, #aa4643;
    }

    axis {
      position: bottom;
      layout: linear(1, align -3);
    }

    axis {
      position: top;
    }

    axis {
      position: left;
      width: 60px;
      layout: linear(10);
    }
  }

  plot {
    width: 430px;
    position: left;

    margin-left: 1em;
    margin-right: 1em;

    scale-x-padding: 0.5;
    scale-y-min: 5;
    scale-y-max: 60;

    lines {
      xs: 0, 1, 2, 3, 4, 5, 6;
      ys: 32, 28, 20, 26, 41, 44, 37;
      color: #4572a7;
    }

    points {
      xs: 0, 1, 2, 3, 4, 5, 6;
      ys: 32, 28, 20, 26, 41, 44, 37;
      size: 3pt;
      color: #4572a7;
    }

    lines {
      xs: 0, 1, 2, 3, 4, 5, 6;
      ys: 24, 19, 16, 23, 35, 29, 24;
      color: #aa4643;
    }

    points {
      xs: 0, 1, 2, 3, 4, 5, 6;
      ys: 24, 19, 16, 23, 35, 29, 24;
      size: 3pt;
      color: #aa4643;
    }

    legend {
      position: top left inside;
      items: A, B;
      colors: #4572a7, #aa4643;
    }

    axis {
      position: bottom;
      layout: discrete;
      labels: A, B, C, D, E, F, G;
    }

    axis {
      position: top;
    }
  }

  plot {
    width: 490px;
    position: left;

    margin-left: 2em;

    scale-y-min: 0;
    scale-y-max: 30;
    scale-x-padding: 0.6;

    bars {
      xs: csv(tests/testdata/city_temperatures_london.csv, month);
      ys: csv(tests/testdata/city_temperatures_london.csv, temperature);
      size: 2em;
      color: #4572a7;
    }

    axis {
      position: right;
      layout: linear(5);
    }

    axis {
      position: top;
      layout: linear(1, align 1);
      labels: csv(tests/testdata/city_temperatures_london.csv, month_name);
    }

    axis {
      position: bottom;
      layout: linear(1, align 1);
      labels: csv(tests/testdata/city_temperatures_london.csv, month_name);
    }

  }
}

Run this example:

$ plotfx --in examples/other/demo.ptx --out output.svg
Edit this page on GitHub