Seplot : a simple command line (and python) plotting tool

Welcome seplot, a plotting tool to be used from the command line, or from a python script. It is a front-end for my favorite plotting program, PyX.

To install it, just use :

$ pip3 install seplot

Then you can use it to plot data stored in a text file or in a csv file ; for instance :

$ seplot data.txt

will plot the second column of file data.txt as a function of the first column.

That is equivalent to (using Python’s indexing convention starting at 0)

$ seplot data.txt x=0 y=1 out=plot.pdf

By default, seplot exports to plot.pdf, but any .pdf, .eps, or .svg filename can be specified.

But one might want to do more, for example plot a function of the input data, and plot error bars :

$ seplot data.txt x='sqrt(A[:,0])/2' dy='sqrt(y)'

You can also plot according to a condition, e.g. y>0 :

$ seplot data.txt if='y>0'

And to do a bit more, specify a style according to y values :

$ seplot data.txt if='y>0' color=red andif='y<=0' color=blue

Also, seplot supports LaTeX so you can label plots like :

$ seplot data.txt y='sin(A[:,0])' title='$\sin{x}$' xlabel='$v$ in $\mu m / s$'

You can also plot an arbitrary function y(x). For instance, to get the image above, the command was :

$ seplot data.txt y='abs(y)' title='$\sqrt{x^2}$' style=o color=blue dy=2 function='y(x)=x' ylabel='velocity $v$ (m s$^-1$)' xlabel='time $t$ (s)'

You can also use seplot from Python :

import seplot

For all the possibilities, see the README.

This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *