Visualizing Apple Price Trends with Scatter Plots in Python

Visualize highest and lowest Apple prices with scatter plot markers using matplotlib and API data.

Enhance data visualization by integrating scatter plots to highlight critical data points clearly and effectively. Learn how to customize markers, colors, and sizes to make financial data insights more visible.

Key Insights

  • Utilize scatter plots within pyplot to visually represent critical data points such as highest and lowest Apple stock prices.
  • Customize visual attributes by using distinct features like green star markers for highs and red star markers for lows, enhancing clarity and readability.
  • Access and visualize accurate financial data clearly and quickly through APIs, improving the overall effectiveness of data-driven visualizations.

This lesson is a preview from our Data Science & AI Certificate Online (includes software) and Python Certification Online (includes software & exam). Enroll in a course for detailed lessons, live instructor support, and project-based training.

Let's add scatter plots for the high and the low. All right, we'll say pyplot.scatter. There it is. We give an X and a Y point—where X is the date and Y is the price.

highest_apple_price. And then we can add some things to make it look better. Make the marker a little star.

Set the color to green—since it's the high, green feels appropriate. And make the size large so this is very visible. And there we go.

Big green star up there. Let's do the same thing. I’ll copy and paste this for the low.

low_date, lowest_apple_price. Let's change the color to red. And there it is.

There’s our low, right there. Okay, so what's the takeaway here? We've explored a great way to use APIs to get our data. Let's sum that up in a little more detail in the next video.

How to Learn Data Science

Build practical, career-focused machine learning skills through hands-on training designed for beginners and professionals alike. Learn fundamental tools and workflows that prepare you for real-world projects or industry certification.