You can calculate density by dividing the mass of a substance by the volume. In a mass versus volume graph, mass is on the y-axis, and volume is on the x-axis.