TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Recently I have been using gnuplot to plot position data over time. In my datafile, I have time,positional (2D) information, and directional information (in the form of degrees, 0-360). I have nice plots of position wrt to time, however, I was wondering if it's possible to plot degrees as a rotation of individual plot characters. Does anyone have any suggestions for a way to do this?

here is the example script that I am plotting. In this plot there are three files, and 3 data sets. Each containing position and time information, and representing data from a different antenna type. columns 3 and 2 contain position information, and column 1 contains time information.

gnuplot> plot 'gpsfile1.txt' using 3:2:1 ls 1 lc palette title 'smallant', 'gpsfile2.txt' using 6:5:4 ls 5 lc palette title 'FullWave', 'ant_lady_dog_clouds.txt' using 9:8:7 ls 7 lc palette title 'control'

plotted, this data looks like this

2d position data over time time

I have a 4th column that represents orientation from magnetic north. I would like to know if there is a good way to display this 4th dimension, preferably by rotating the markers. Any thoughts?

share|improve this question
Welcome to TeX.SE! Please add a minimal working example (MWE) or a screenshot that illustrates your problem. As new user without image posting privileges simply include the image as normal and remove the ! in front of it to turn it into a link. A moderator or another user with edit privileges can then reinsert the ! to turn it into an image again until you get more rep points. – percusse Feb 12 '13 at 0:44


I'm not sure if I got you right. If you want to annotate your points with an additional orientation use the using vectors style.


Because this is TeX.SX, the solution incorporates the epslatex terminal :-).

#!/usr/bin/env gnuplot

set terminal epslatex color standalone
set output 'gnuplot.tex'

set angles degrees
set xrange [0:3]
set yrange [0:4]

plot '-' using 1:2:(0.2*cos($4)):(0.2*sin($4)):3 with vectors linecolor palette notitle
# x y color angle
  1 1 5     30
  2 1 4     40
  2 3 3     45
  1 2 3     60
  2 2 4     160
  1 3 3     80


enter image description here

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.