I jumped in feet first in the pool of data science and am treading water. It may not look pretty, but I’m getting the job done.
I have been enrolled in the Thinkful Data Science bootcamp for almost two months. I have been oscillating daily between excited and frustrated depending on the success of my Python code and Postgresql queries. I have become quite cozy with Stackoverflow, Postgresql Tutorial, and Kaggle datasets and underwhelmed with the Python, Seaborn, and Matplotlib documentation, the latter likely because of my urgency to begin my new career. It is difficult to find thorough explanations of all components of a plot that make sense to a newbie like me. Like Frankenstein I piece together snippets of code from the documentations and throughout the internet, including Thinkful’s mentors, which takes forever.
Here is an example. I obtained rain data for Australia from Kaggle to complete a bootcamp assignment on Exploring Data with Seaborn Plots. To start, I wanted to plot the maximum temperature for Sydney, Australia.
# Plot MaxTemp by date sns.set_palette("husl") #Choose color palette. plt.figure(figsize=(18,6)) #Set figure size. g = sns.lineplot(x="Date_f", y="MaxTemp", data=sub_weather) plt.ylabel('Maximum Daily Temperature (Celsius)') plt.xlabel('Date') plt.title('Daily Maximum Temperature in Sydney, Australia')
I chose the color palette from Pydata.org’s Choosing Color Palettes documentation.

# Plot MaxTemp by date sns.set_palette("husl") #Choose color palette. plt.figure(figsize=(18,6)) #Set figure size. g = sns.lineplot(x="Date_f", y="MaxTemp", data=sub_weather) plt.ylabel('Maximum Daily Temperature (Celsius)') plt.xlabel('Date') plt.title('Daily Maximum Temperature in Sydney, Australia')
If you don’t set the figure size as I have done on line 4, the graph will be horizontally compressed, making it difficult to view the data. Below is the graph with the default width.

I chose the figure size based on trial-and-error. Note that this line (#4) didn’t work when placed below the lineplot code (#5 & 6).

# Plot MaxTemp by date sns.set_palette("husl") #Choose color palette. plt.figure(figsize=(18,6)) #Set figure size. g = sns.lineplot(x="Date_f", y="MaxTemp", data=sub_weather) plt.ylabel('Maximum Daily Temperature (Celsius)') plt.xlabel('Date') plt.title('Daily Maximum Temperature in Sydney, Australia')
This is the actual line of the plot. Sns is for Seaborn. In parentheses we set our desired x-axis variable (in this case “Date_f”) and y-axis variable (in this case “MaxTemp”) and the data set from which we are getting the data (in this case sub_weather). I believe the ‘g’ in line 5 is arbitrary.
# Plot MaxTemp by date sns.set_palette("husl") #Choose color palette. plt.figure(figsize=(18,6)) #Set figure size. g = sns.lineplot(x="Date_f", y="MaxTemp", data=sub_weather) plt.ylabel('Maximum Daily Temperature (Celsius)') plt.xlabel('Date') plt.title('Daily Maximum Temperature in Sydney, Australia')
On lines 7 and 8 I changed the labels of the axes to make them more explanatory, including the unit of measurement for the temperature.
# Plot MaxTemp by date sns.set_palette("husl") #Choose color palette. plt.figure(figsize=(18,6)) #Set figure size. g = sns.lineplot(x="Date_f", y="MaxTemp", data=sub_weather) plt.ylabel('Maximum Daily Temperature (Celsius)') plt.xlabel('Date') plt.title('Daily Maximum Temperature in Sydney, Australia')
And, finally, I set the title for the plot on line 9.
This plot isn’t presentation-ready yet. The titles and axis labels are tiny and there are no annotations to point out any important aspects of the plot. But I’ll cover those tweaks on another day.