View on

Example: barcharts/bars_with_labels

Output File:

Source File:

width: 1200px;
height: 480px;

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);
  labels: csv(tests/testdata/city_temperatures_london.csv, temperature_str);
  size: 2.6em;
  color: #4572a7;
}

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

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);
}

legend {
  position: top left inside;
  items: "London";
  colors: #4572a7, #aa4643, #89a54e, #80699b;
}

Run this example:

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