Courses / Physics I
Computer Science

Visualising scientific computation

Physics I 201 words Free to read

Visualisation turns raw numbers into physical insight. A well-chosen plot can reveal patterns that spreadsheets hide.

Matplotlib basics

import matplotlib.pyplot as plt
import numpy as np

t = np.linspace(0, 2 * np.pi, 200)
plt.plot(t, np.sin(t), label="sin(t)")
plt.plot(t, np.cos(t), label="cos(t)")
plt.xlabel("Time (s)")
plt.ylabel("Amplitude")
plt.title("Simple Harmonic Motion")
plt.legend()
plt.grid(True)
plt.show()

Essential plot types for physics

PlotUse case
Line plotTime series, trajectories
Scatter plotExperimental data points
HistogramDistribution of measurements
Contour / heatmap2D scalar fields (temperature, potential)
Vector fieldForce or velocity fields

Good visualisation practices

Tip: Save figures in vector format (plt.savefig("plot.pdf")) for publications. PNG is fine for quick inspection but loses quality when scaled.
Common pitfall: Axis choices can manufacture or hide stories: truncated y-axes exaggerate trends, log scales linearize exponentials. Read (and label) the axes before believing any plot — including your own.

Practise this lesson

The explanation above is free to read. The graded practice for this lesson lives in the Tryals app.

14practice questions
2interactive scenes
Start Physics I free

Computer Science