python_and_data_vis

After collecting your data as part of a V&V effort, it helps to be able to visualize it to help determine a PASS or a FAIL. This post will walk you through a couple setups.

The Data Files

For the purposes of this example, you will find a couple of CSV files on my GitHub that are simple trig functions to give us something to plot. Sine, Cosine, Sinc, etc.

The Basic Plot

You will find the code below on my Python Examples project on GitHub.

Walking through the script below:

  1. Initialize our arrays
  2. Retrieve example data from data file and append to our null arrays
  3. Format our plot
  4. Apply our data
  5. Show our plot

This produces the plot below.

basic_plot

Multiple Lines on One Plot

Taking the above example a step farther, it’s often useful to plot multiple lines on a single plot.

This produces the plot below.

multiplot1

Working with Subplots

Finally, for more complicated data sets you can split the graphs onto multiple subplots using the subplot definition.

This produces the plot below.

multiplot2

Leave a Reply

Your email address will not be published. Required fields are marked *