plplot.org

Tool

Plot Rosetta

One figure, several plotting libraries. Pick a chart and up to three libraries to compare the code line by line. Every snippet uses the same data and was run before it was published; the image is what it produced.

Last run 2026-11-28 on Ubuntu 24.04.5 LTS: matplotlib 3.11.2, Plotly 7.2.0, gnuplot 6.0 patchlevel 0, ggplot2 3.4.4 (R 4.3.3), PLplot 5.15.0. Run log.

Chart

Libraries (up to 3)

Error bars

matplotlib Python

Error bars drawn with matplotlib
import matplotlib
matplotlib.use("Agg")
import matplotlib.pyplot as plt

x = [1, 2, 3, 4, 5]
y = [2.1, 3.9, 6.2, 7.8, 10.1]
err = [0.3, 0.4, 0.5, 0.4, 0.6]

fig, ax = plt.subplots(figsize=(4, 3))
ax.errorbar(x, y, yerr=err, fmt="o", capsize=3)
ax.set_xlabel("Dose (mg)")
ax.set_ylabel("Response")
fig.tight_layout()
fig.savefig("errorbars-matplotlib.png", dpi=150)

matplotlib 3.11.2

ggplot2 R

Error bars drawn with ggplot2
library(ggplot2)

d <- data.frame(x = 1:5,
                y = c(2.1, 3.9, 6.2, 7.8, 10.1),
                err = c(0.3, 0.4, 0.5, 0.4, 0.6))

p <- ggplot(d, aes(x, y)) +
  geom_errorbar(aes(ymin = y - err, ymax = y + err), width = 0.15) +
  geom_point(size = 2) +
  labs(x = "Dose (mg)", y = "Response") +
  theme_classic()
ggsave("errorbars-ggplot2.png", p, width = 4, height = 3, dpi = 150)

ggplot2 3.4.4

PLplot Python

Error bars drawn with PLplot
import numpy as np
import plplot as pl

x = np.array([1.0, 2, 3, 4, 5])
y = np.array([2.1, 3.9, 6.2, 7.8, 10.1])
err = np.array([0.3, 0.4, 0.5, 0.4, 0.6])

pl.plsdev("pngcairo")
pl.plsfnam("errorbars-plplot.png")
pl.plspage(0, 0, 600, 450, 0, 0)
pl.plscolbg(255, 255, 255)        # white background
pl.plscol0(1, 0, 0, 0)            # colour 1 (axes, text) black
pl.plscol0(2, 31, 119, 180)       # colour 2 (data) blue
pl.plinit()
pl.plcol0(1)
pl.plenv(0.5, 5.5, 0.0, 11.0, 0, 0)
pl.pllab("Dose (mg)", "Response", "")
pl.plcol0(2)
pl.plerry(x, y - err, y + err)
pl.plpoin(x, y, 4)                # 4 = circle
pl.plend()

PLplot 5.15.0

Where each library does it

TaskmatplotlibPlotlygnuplotggplot2PLplot
Figure sizeplt.subplots(figsize=(w, h)) # inchesfig.update_layout(width=w, height=h) # pixelsset terminal pngcairo size w,hggsave(..., width = w, height = h)plspage(0, 0, w, h, 0, 0)
Axis labelsax.set_xlabel("x")fig.update_layout(xaxis_title="x")set xlabel "x"labs(x = "x")pllab("x", "y", "title")
Log axesax.loglog(x, y)xaxis=dict(type="log")set logscale xyscale_x_log10() + scale_y_log10()plenv(..., axis=30) and plot log10 values
Colour mapcmap="viridis"colorscale="Viridis"set palette defined (0 "#440154", ...)scale_fill_viridis_c()plscmap1l(1, pos, r, g, b, alt_hue_path)
Colour barfig.colorbar(mappable, label="z")colorbar=dict(title="z") on the tracedrawn with pm3d and image; set cblabel "z"legend added for the fill scaleplcolorbar() (not used in these examples)
Error barsax.errorbar(x, y, yerr=err)error_y=dict(type="data", array=err)plot ... using 1:2:3 with yerrorbarsgeom_errorbar(aes(ymin = y - err, ymax = y + err))plerry(x, y - err, y + err)
Save to filefig.savefig("f.png", dpi=150)fig.write_image("f.png") # needs kaleidoset output "f.png"ggsave("f.png", p, dpi = 150)plsdev("pngcairo"); plsfnam("f.png")

How the snippets are made

Each snippet is a complete program with its data written inline, so you can paste it and run it. They live in one folder per chart and are run together on Ubuntu by an automated job that fails if any of them errors or does not write its image. The versions above come from that run. Styling is kept close to each library's defaults, so the figures differ slightly in fonts and margins; the data, labels and colour map are the same.

Official documentation: matplotlib, Plotly, gnuplot, ggplot2 and PLplot.