Guided project: Visualizing earnings based on college majors. Feedback please!


I would love some feedback on this project where I was exploring some data visualization techniques. In particular I would like to know if it possible to somehow assign the Axes object returned when using the various pandas.DataFrame.plot methods to a specific matplotlib.figure object? To put it another way: can I create a figure object with subplots using:

fig, axarr = matplotlib.pyplot.subplots(3, 1)

and then assign my Axes object returned from say pandas.DataFrame.plot.hexbin() to one of the axes in axarr above?



Link to guided project

Notebook file attached.Visualizing earnings based on college majors.ipynb (616.9 KB)

Click here to view the jupyter notebook file in a new tab

1 Like

hey @thaysom22

Your project is a great read. The sections and sub-sections provide a good workflow. :slight_smile: The plot sizing is really cool :ok_hand:

A summary or conclusion section at the end would help in making the project a complete analysis, though.

I didn’t quite get your question. Are you looking for something like this?

import matplotlib.pyplot as plt

y = [10, 20, 30, 15, 25, 5]
x = [1, 2, 3, 4, 5, 6]

fig, axarr = matplotlib.pyplot.subplots(3, 1, figsize=(10,5))
axarr[0].plot(x, y)
axarr[1].scatter(x, y)

If yes, this is one of the methods, there are other ways too. such as:

df = pd.DataFrame({"x":[1, 2, 3, 4, 5, 6], "y":[10, 20, 30, 15, 25, 5]})
df.plot(kind="bar", x="x", y ="y", ax = axarr[2]) 

You may go through the matplotlib documentation, projects from other students, or stack overflow posts as well to understand further.

Hope that helps.

Thanks Rucha.

I am realizing that it helps to include results in the introduction really helps readability.

I think the ax parameter is what I was looking for!

Thanks alot


1 Like