Theory

Plotting

Here you will find commonly used plotting programs and how to use them.

Matplotlib

http://matplotlib.org/

Matplotlib is a very extensive plotting library available in the python script language.

It is especially powerful when combined with other python libraries, for example SciPy libraries like NumPy and the interactive IPython.

A basic python plotting script would look something like this:

	import matplotlib.pyplot as plt
	import numpy as np
	x=np.linspace(1,10,100)
	y=np.sin(x)
	plt.figure(figsize=(12,8))
	plt.plot(x,y)
	plt.xlabel('x-axis',fontsize=20)
	plt.ylabel('y-axis',fontsize=20)
	plt.show()

Note that you have to include the last line in order to show your plot. Note that the default settings (e.g. regarding line widths, colours, text fonts, ...) won't give you nice publication-quality plots, but there are plenty of ways to improve the quality (for some inspiration see for example over here).

XMGrace

http://plasma-gate.weizmann.ac.il/Grace/

An xmgrace tutorial to get started with scientific plotting is here. XMGRACE is a 2d plotting code, which is automatically loaded on glenn and hebbe, and is useful for producing publication quality plots.

Open simply with:

	xmgrace 

Or load a 2d data file called “file.dat” with column 1 along the x, and column 2 along the y axes.

	xmgrace –block file.dat –bxy 1:2

Gnuplot

http://www.gnuplot.info/

Gnuplot is another plotting software available on the c3se computers, and is accessed simply with

	gnuplot 

Once the program is loaded, settings may either be input one at a time, or a script file may be loaded, which contains the settings you want. An example is given below. For help with more sophisticated plots, some examples are given here.

General

Experiment

Theory

PmWiki

pmwiki.org

edit SideBar

Blix theme adapted by David Gilbert, powered by PmWiki