Plotting a function with minimal axes

We plot a sine function with PGFplots, similar to:

While a grid and a lot of ticks can be useful to inspect specific values of a function, an overall view onto a function can be nicer with reduced axes, maybe even shifted away a bit.

There’s a style which you can use. If you download the file at, and put it into your document folder, you can load this style in your preamble, as written below.

Then, just change the axis option grid to shift.

The code, and more, is explained in the LaTeX Cookbook, Chapter 10, Advanced Mathematics, Plotting functions in two dimensions.

Minimal plot

Edit and compile if you like:
% Plotting a function with minimal axes
% Author: Stefan Kottwitz
  \begin{axis} [shift, xtick = {-360,-270,...,360}]
    \addplot [domain=-360:360, samples=100, thick] { sin(x) };
Click to download: minimal-plot.texminimal-plot.pdf
Open in Overleaf: minimal-plot.tex