Congratulations and getting your first plots with data! Now that you have mastered plotting, you may be wondering how to handle additional information. As you can imagine, It can be very powerful to look at a graph with multiple variables to evaluate trends between variables. (For example if you wanted to look at both the power output compared to windspeed and compared to wind direction).
In this next video, you will build upon the matplotlib & pyplot commands to learn how to overlay multiple plots on the same graph.
Use the trinket below to test things out while you follow along with the above video!
In this next example, see if you can add the code to overlay multiple plots on the same graph.
In this example, you will learn how to add multiple lines on one graph!
Step 1. Look at the code and make sure you understand it all! Run the cell and observe the output.
Step 2. Go to the comment labeled "TODO 1". Follow the instructions to uncomment the following two lines of code and rerun the code cell to observe the output.
Step 3. Under the comment labeled "TODO 2" create another list of data points and graph it on the same graph by following the format we used to add y2.
Make sure to add the correct amount of data points in your y3 list & to add a label that will appear on the legend!
Step 4. Customize each line so that:
y1 is green with a dashed line and triangle left markers
y2 is magenta with a dashed-dotted line and diamond markers
y3 is cyan with a solid line and square markers
See if you can make it look like something similar to the version to the right.