Data Visualization using Plotly (Code)

Karan Jagota
Jun 10 · 2 min read
source : https://plot.ly/d3-js-for-python-and-pandas-charts/

Plotly is a great visualization library . It’s opensource and free to some extent and can be used in your next analytical project . The best thing about it is that it has wrappers around it in many language ( JS , GO, Python , R etc .. ) and It can also be used offline in a jupyter notebook . I am going to develop graphs using python but you can develop it any language of your choice. So without wasting time lets get started …

# Installation 
pip install plotly
  1. Most of the plots in plotly are supported by plotly’s graph_objs module Example : plotly.graph_objs.Scatter , plotly.graph_objs.Bar etc …..
  2. Every plot will basically have minimum two properties — data (which will be a list of plots/trace with containing x and y values ) and layout (which will contain the styling properties of graph like xlabel, ylabel, title, name etc … ) that will be pass as an argument to plotly.graph_objs.Figure function
  3. Rendering will be done as per the platform here i am using plotly.offilne module to render plots in an offline mode.
source : https://gist.github.com/karanjagota/e29a72713e201b5f84de562ffb5b32c1
source : https://gist.github.com/karanjagota/c667a0291ddefe83431a374eb6b10e88
source : https://gist.github.com/karanjagota/e9c00352ba56b8a3771e0428f97e5de6

csv link: https://github.com/karanjagota/Medium-Blogs/blob/master/lf.csv

source : https://gist.github.com/karanjagota/18db9d644a2c1c417a82d2a90a9acabf

Plotly as a library has a lot to offer and support many different chart types including 3-d and network charts , subplots , animations and more . I hope you have got the idea of creating plots in plotly by now but if not, you can always view the official documentation for reference .

and Don’t forget to Clap , Share and Follow ..

Karan Jagota

Written by

| Software Engineer | Python | Javascript | Auto-ML Enthusiast |

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade