Other things on this site...


Radar chart in Gnuplot

Gnuplot's documentation is downright baffling so it took me ages to work out if it was even possible to do a radar chart (aka spider chart, star plot, polar chart). Here's how I managed it in the end.

  set angles degrees
  set polar
  set grid polar 120.
  unset border
  unset param

  set style data filledcurves 
  set style fill solid 0.5

  set datafile separator ","

  set xtics axis nomirror
  set ytics axis nomirror
  set yrange [-45:45]
  set xrange [-45:45]
  set size square
  set title "Radar chart"

  plot '~/docs/mydata.csv' using 1:2 notitle, '' using 1:3 notitle, '' using 1:14 notitle, '' using 1:25 notitle

My datafile was a CSV file where the first column gave the angle in degrees (as you can see in the plot, I've only used three angles: 0, 120, 240). You can see in the last line of that code that I've separately chosen to plot polygons for columns 2, 3, 14, 25 from my data.

| linux | Permalink