Reference  computes the three components of the magnetic field, , , and , for a cuboidal permanent magnet. This Demonstration shows the level surfaces colored red, blue, green for , , , respectively, and starting at the mid-plane for each component.
The controls available are:
, , change the magnet dimensions
cut the graph at a value
, , toggle to display , , and components
high double the graphics calculation grid
 G. Akoun and J.-P. Yonnet, "3D Analytical Calculation of the Forces Exerted between Two Cuboidal Magnets," IEEE Transactions on Magnetics, 20(5), 1984 pp. 1962–1964.