Gnuplot remains the fastest way to plot a function or a quick dataset, and many groups have decades of plot scripts in it. This tutorial plots two functions with print-ready styling.
Step 1 — Open the Gnuplot mode
In Figure Studio, open the Code tab and pick Gnuplot. Write the script on the left, press Run, and the plot renders in the preview.
Step 2 — Plot a function
The one-liner everyone starts with:
plot sin(x)
Run it and you have axes, a curve, and a legend entry. Everything after this is refinement.
Step 3 — Label the axes and clean up
Set labels, a grid, and smoother sampling before the plot line:
set xlabel "x"
set ylabel "amplitude"
set grid
set samples 400
plot sin(x) linewidth 2 title "sin x"
samples controls how many points the curve is evaluated at — raise it if a fast-oscillating function looks jagged.
Step 4 — Add a second curve
Separate curves with a comma; each takes its own style and legend title:
set xlabel "x"
set ylabel "amplitude"
set grid
set samples 400
set key top right
plot sin(x) linewidth 2 title "sin x", \
cos(x) linewidth 2 dashtype 2 title "cos x"
A dashed second curve (dashtype 2) keeps the two distinguishable in black-and-white print — worth doing even if the journal prints in colour.
Step 5 — Export or insert
When the preview looks right, Export / Insert: a vector PDF for LaTeX, or straight into the current paper with a \label. The script is what gets saved — reopen the figure and you are back in this editor, editing the source.
Tip: Set the axis ranges explicitly (
set xrange [0:6.3]) once the plot is final, so a data tweak later can’t silently rescale the figure between drafts.