Skip to main content

Section 13.2 Producing Line Plots

Once data is accessible in Python, data analysis and visualization can be performed. As an example, let’s assume that we’ve conducted an experiment on the circuit shown in Figure 13.2.1.
Figure 13.2.1.
Here, \(R_\text{pot}\) is a potentiometer (or variable resistor) that the experimenter controls. In this experiment, \(V_\text{in}=5.0\text{V}\text{,}\) \(R_\text{fixed}=5\text{k}\Omega\text{,}\) and we measured \(V_\text{out}\) as the potentiometer resistance \(R_\text{pot}\) was varied between \(0-10\text{k}\Omega\text{.}\) The code below produces a plot in which the data are represented as closed circles. A solid line represents the theoretical prediction
\begin{equation*} V_\text{out} = \frac{R_\text{pot}}{R_\text{fixed}+R_\text{pot}}V_\text{in}, \end{equation*}
which can be derived using content from Chapter 2.