Wikipedia:How to create charts for Wikipedia articles
Graphs and other pictures can contribute substantially to an article. Here are some hints on how to create a graph.
- Use any software to create the plot but make it very large, for instance 6000 x 4500 pixel size with Postscript Times or Symbol font size 48 and a line thickness of 17 pixels. (In GIMP, select Resolution:500 or so in the Load PostScript dialog. Make sure Ghostscript is installed! Windows instructions) Then use Photoshop or GIMP to Gaussian blur it at 2 pixels. (In GIMP, Filters → Blur → Gaussian Blur...) Then reduce it down to about 1000 pixels on a side (e.g. 1300 x 975) using bicubic interpolation. (In GIMP, Image → Scale Image..., set size, Interpolation:Cubic.) This gives a plot with no jagged lines. It is, however, big enough so that someone could download it and use it for projection purposes without pixellation. Use a width of about 325 pixels for the Wikipedia article (using the |thumb|325px option in the image tag). Save as PNG.
- Plots should be as language-free as possible, and uploaded to Wikimedia commons, so that they may be used in any language version of Wikipedia.
- The descriptive text should be confined to the caption as much as possible. (Try to put as little text as possible in the image itself.) You can also put additional text on the image description page.
- Include the commands by which you created the plot on the image description page so others can replicate your work to make additions, fixes, translations, and so on. Ideally someone else can copy and paste the commands and obtain the same result. One way to test that is to write a script and execute the script (instead of interactively typing the commands). Then just copy and paste the script into the image description page.
- Be sure to include a licensing tag (GFDL, CC, public domain, etc.) on the image description page.
See also the graphics tutorials on how to create pictures, and the picture tutorial on how to include them in articles. There is additional discussion of plotting on Template_talk:Probability_distribution#Standard_Plots.
gnuplot

Many of the graphs on Wikipedia were made with the free software program gnuplot. For the best results, a PostScript file should be generated and converted into PNG in an external program, like the GIMP. PostScript is generated with the line set terminal postscript enhanced:
set terminal postscript enhanced color solid lw 2 "Times-Roman" 20 set output "filename.ps"
- color
- Make a color plot instead of black-and-white
- solid
- Make all lines solid instead of dashed. You may want to remove this to make dashed lines and such.
- lw 2
- Sets the linewidth of all the lines at once.
- "Times-Roman" 20
- Sets the font and font size
- set output
- Sets the filename for saving the Postscript information
You should use a large number of samples for high-quality plots:
set samples 1001
This is important to prevent aliasing or jagged linear interpolation (see Image:Exponentialchirp.png and its history for an example of aliasing). Labels are helpful, but remember to keep language-specific information in the caption if it's not too inconvenient. Including the source code and/or an image without text helps other users create versions in their own language if text is included in the image.
set xlabel "Time (s)" set ylabel "Amplitude"
The legend or key is positioned according to the coordinate system you used for the graph itself:
set key 4,0
Most other options are not Wikipedia-graph-specific, and should be gleaned from documentation or the source code included with other plots. An example of a plot generated with gnuplot is shown on the right, with source code on the image description page.
Maxima

Maxima is a computer algebra system licensed under the GPL, similar to Mathematica or Maple. It uses gnuplot as its default plotter, though others are available, such as openmath. Plotting directly to PostScript from Maxima is supported, but gnuplot's PostScript output is more powerful.
The most-used commands are plot2d and plot3d:
plot2d (sin(x), [x, 0, 2*%pi], [nticks, 500]); plot3d (x^2-y^2, [x, -2, 2], [y, -2, 2], [grid, 12, 12]);
Since the plot is sent to gnuplot as a series of samples, not as a function, the Maxima nticks option is used to set the number of sampling points instead of gnuplot's set samples. Additional plot options are included in brackets inside the plot command. To use the same options as in the above gnuplot example, add these lines to the end of the plot command:
PostScript output:
[gnuplot_term, ps] [gnuplot_ps_term_command, "set term postscript enhanced color solid lw 2 'Times-Roman' 20"]
Output filename:
[gnuplot_out_file, "filename.ps"]
Additional gnuplot commands:
[gnuplot_preamble, "set xlabel 'Time (s)'; set ylabel 'Amplitude'; set key 4,0"]
Like so:
plot2d (sin(x), [x, 0, 2*%pi], [nticks, 500], [gnuplot_term, ps], [gnuplot_ps_term_command, "set term postscript enhanced color solid lw 2 'Times-Roman' 20"], [gnuplot_out_file, "filename.ps"], [gnuplot_preamble, "set xlabel 'Time (s)'; set ylabel 'Amplitude'; set key 4,0"]);
Note that the font and labels are in single quotes now, nested inside double quotes. Multiple commands are separated by semicolons.
An example of a plot generated with gnuplot in Maxima is shown on the right, with source code on the image description page.
GNU Octave

GNU Octave is a numerical computation program; effectively a MATLAB clone. It uses gnuplot exclusively.
The commands are plot (2D) and splot (surface plot), or gplot and gsplot ("almost exactly" the same).
gnuplot settings are accessed with the gset command:
t = [0 : .01 : 1]; y = sin (2*pi*t);
gset terminal postscript enhanced color solid lw 2 "Times-Roman" 20 gset output "filename.ps" gset xlabel "Time (s)" gset ylabel "Amplitude" gset key 4,0 plot (t,y)
If x functions are plotted, separated by commas, they will all appear on page x of the resulting .ps file.
R
The statistical package R (see R programming language) can make a wide variety of nice-looking graphics. It is especially effective to display statistical data.
Image:1969 draft lottery scatterplot.png is an example of a scatterplot created by R.