Archive for the ‘Gnuplot’ Category

Rotating axis labels in Gnuplot

Posted: 27th October 2015 by Tim in Gnuplot
Tags: , , , , , , , ,

In gnuplot, labels on the X and Y axes are aligned horizontally by default, and written over the top of each other if the labels are too long. To fix this, you can rotate the labels using the set xtics rotate [by <angle>] [left|right] command. For example, you can rotate x-axis labels by 60 degrees […]

Creating bar charts with gnuplot

Posted: 11th August 2014 by Tim in Gnuplot
Tags: , , , , ,

Bar charts are very easy to create with gnuplot. Very little setup is required; just a data file with labels in one column and data in another. From here, the graph can be drawn with the following line: plot <data_file> using <label_column>:xtic(<value_column>) with boxes For example, the following two files: barchart.gnuplot set terminal pngcairo font […]

Gnuplot can create candlestick charts out of the box. These charts are often used for graphing financial data, with the middle block representing the difference between the open and close, and the high and low represented with lines protruding from the top and bottom of this box. The bars are colored differently depending on if […]

Adding gridlines to GNUPlot

Posted: 27th July 2012 by Tim in Gnuplot
Tags: , , , , , , ,

Some graphs are easier to read when they have gridlines. These are very easy to add in gnuplot by defining something like this: set grid ytics lt 0 lw 1 lc rgb “#bbbbbb” set grid xtics lt 0 lw 1 lc rgb “#bbbbbb” Where: lt means line type (0 for dashed line, 1 for solid […]

Gnuplot is a great tool for creating plots. LaTeX is a great tool for creating documents. Both are (or at least can be) created using a text editor and compiling the source. Both work with Windows, linux/unix and Mac. Wouldn’t it be great if you could include a gnuplot plot in a LaTeX document without […]