DEV Community

Durga Pokharel
Durga Pokharel

Posted on

3 2

Day 64 Of 100DayOfCode: Data Visualization Using Matplotlib

Today is my 64th day of #100DayOfcode and #python. Like yesterday today also learned more from Datacamp. Completed some chapter related to matplotlib. Here is one code to visualize data with the help of histogram.

Code

# Scatter plot
plt.scatter(gdp_cap, life_exp)

# Previous customizations
plt.xscale('log') 
plt.xlabel('GDP per Capita [in USD]')
plt.ylabel('Life Expectancy [in years]')
plt.title('World Development in 2007')

# Definition of tick_val and tick_lab
tick_val = [1000, 10000, 100000]
tick_lab = ['1k', '10k', '100k']

# Adapt the ticks on the x-axis
plt.xticks(tick_val, tick_lab)

# After customizing, display the plot
plt.show()
Enter fullscreen mode Exit fullscreen mode

Day 64 Of #100DaysOfCode and #Python
Pandas, Matplotlib From https://t.co/AuqgT6yZkYDatacamp#womenintech #100DaysOfCode #CodeNewbies #DEVCommunity pic.twitter.com/O4ZtdmgUPN

— Durga Pokharel (@mathdurga) March 2, 2021

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay