GnuPlot Diagram Editor
Create professional plots using Gnuplot scripts in your browser. Live preview, multiple plot types, and export to SVG/PNG. Privacy-first, no data leaves your device.
Create publication-ready plots using Gnuplot script syntax with real-time preview. Perfect for math, science, and documentation.
Features
Real-time Gnuplot Preview
Instantly visualize your Gnuplot scripts with live SVG preview
Extensive Plot Types (2D/3D)
Functions, parametric/polar plots, histograms, scatter with error bars, dual axes
3D Surfaces, Contours & PM3D Heatmaps
Support for splot 3D surfaces, contour maps, and pm3d heatmap rendering
Curated Sample Templates
Start quickly with working examples for functions, data, 3D, and heatmaps
Zoom, Fullscreen & Theme-aware Preview
Comfortable viewing with zoom controls, fullscreen mode, and dark-theme support
Import, Export & Clipboard Copy
Open .gp/.gnuplot files, export SVG/PNG, and copy PNG/SVG to clipboard
Privacy‑First, Client‑Side
All scripts render in your browser. Share via URL without uploading data
Frequently Asked Questions
What is Gnuplot?
Gnuplot is a portable, command‑line graphing utility for plotting mathematical functions and data. It supports 2D/3D plots, parametric/polar modes, histograms, scatter with error bars, contours, multiplot layouts, and more. See the official site.
How do I use this tool?
Type or paste your Gnuplot script into the editor. The SVG preview updates live. Use Samples to insert working examples, Open to load .gp/.gnuplot files, Export to download PNG/SVG, and Share to copy a privacy‑preserving URL containing your script.
How do I plot data from a file or inline data?
For inline data, use a dash data block and end with 'e' (or 'end'): e.g., plot '-' using 1:2 with boxes; 1 4 2 7 3 1 4 6 5 3 e
. For files, reference the file path or column selectors like plot 'data.dat' using 1:2 with lines
.
Does this support 3D surfaces and PM3D heatmaps?
Yes. Use splot
for 3D surfaces, e.g., splot sin(x)*cos(y) with lines
. For heatmaps: set pm3d map
then splot f(x,y)
or a matrix file. You can also generate contour maps with set contour
and set view map
. See the official documentation for details.
How do I export PNG/SVG or copy to clipboard?
Use the Export menu to download SVG or PNG, or copy the diagram as PNG/SVG to the clipboard. The Share button copies a URL‑encoded version of your script so you can reopen the same plot later without uploading data.
Common errors and how to fix them
• Use plot
for 2D and splot
for 3D.
• End inline data blocks with e
/end
.
• For parametric plots, add set parametric
and set ranges with set trange
.
• For polar plots, use set polar
and set angles radians
.
• Log scales require positive data on that axis (set logscale y
).
Do I need to install Gnuplot? Is it free?
You don’t need to install anything to use this browser‑based tool. Gnuplot itself is free and open‑source; if you want a native install, see Gnuplot Downloads. On macOS, you can also use Homebrew Formula (gnuplot).
Where can I learn more?
See the Gnuplot Documentation, the Gnuplot Demo Gallery, and the Gnuplot FAQ.
Gnuplot Script Reference
Quick reference for common Gnuplot commands, styles, and plot types.
Basics & Plotting Functions (2D)
set title 'My Plot' set xlabel 'x' set ylabel 'y' plot sin(x) title 'sin(x)' with lines
Basic 2D function plot with title, axis labels, and legend entry
plot cos(x), sin(x) lw 2, tan(x) with linespoints
Multiple functions, thicker lines (lw), and line+point style
set grid set key bottom right plot exp(-x**2) title 'Gaussian'
Enable grid, move legend (key), and plot a function
set xrange [-5:5] set yrange [-2:2] plot sin(x)
Set axis ranges explicitly
Parametric & Polar
set parametric set trange [0:2*pi] plot cos(t), sin(t)
Parametric circle using t parameter
set polar set angles radians set trange [0:2*pi] plot cos(5*t)
Polar plot (rose curve) with 5 petals
Data Files & Inline Data
plot 'data.dat' using 1:2 with lines title 'series'
Plot from a data file: column 1 on x, column 2 on y
plot '-' using 1:2 with points pt 7 ps 1.4 title 'inline' 0 0 1 1 2 4 3 9 e
Inline data block terminated by e/end
set boxwidth 0.5 set style fill solid plot '-' using 1:2 with boxes notitle 1 4 2 7 3 1 4 6 5 3 e
Histogram-style boxes from inline data
Styles, Colors & Error Bars
plot f(x) with lines lw 2 lc rgb '#1f77b4'
Set line width (lw) and color (lc rgb)
plot sin(x) lw 2 lc rgb 'red'
plot '-' using 1:2:3 with yerrorbars title 'measurements' 1 1.1 0.1 2 1.9 0.15 3 3.2 0.2 4 3.9 0.1 5 5.1 0.25 e
Y-error bars with third column as error
set style line 1 lc rgb '#d62728' lw 2 dt 2 plot sin(x) with lines ls 1
Reusable line style with color, width, and dash type
Axes, Scales & Dual Axes
set logscale y plot x**2
Enable logarithmic scaling for y-axis
set ytics nomirror set y2tics plot sin(x) axes x1y1, cos(x) axes x1y2
Dual y-axes with separate scales
set multiplot layout 1,2 title 'Sine & Cosine' plot sin(x) plot cos(x) unset multiplot
Multiple plots in a single figure
3D Plots, Contours & PM3D
splot sin(x)*cos(y) with lines
3D surface plot
set pm3d map splot sin(x*y)
PM3D heatmap rendering of a function
set contour base set view map unset surface splot x**2 + y**2
Contour map with base contours and 2D view
Output & Export
set terminal svg size 800,600 set output 'plot.svg' plot sin(x) set output
Export to SVG (native gnuplot workflow)
set term pngcairo size 1200,800 enhanced set output 'plot.png' replot set output
Export to PNG with Cairo terminal
Resources
Official manual and command reference
Extensive gallery of example plots with scripts
Native installers and source code
Related GnuPlot Diagram Editor Articles
Discover more insights about gnuplot diagram editor and related development topics