Plotly for Data Visualization Amateur Data Science, Course, General Leave a Comment

If you have been interested in or dabbling with learning data science, you no doubt have come across charts and graphs on the web. Many articles on Medium and kernels on Kaggle use plotly to visualize data that you can interact with.  You can see by the live plot below that you can mouse over data points and you will be shown the actual numbers. 

The interactive chart below is actually a Dash application hosted on AWS/EC2 in an iFrame. The underlying charting is provided by plotly python api calls.



This is not all you will see.  Notice the controls in the upper right hand corner when you hover over that area of the chart.  

These controls signify that you are looking at a plotly chart which has a signature control set that you can suppress or enable in your code.  In this case, we have not suppressed it.

This next interactive graph allows you to select a number of stocks by ticker and after pressing ‘select’ it will go get the data for those stocks in the time frame you specified and plot them in a comparison chart just as Yahoo/finance allows you to do.

This chart is completely styled by CSS and organized in Div’s using inline HTML inside the python code.  Underlying the charting is the python library which has an extensive API of charting and graphing that surpasses Matplotlib and in many ways, Seaborn.  Alongside the charting functions is plotly.js which provides the live interaction you see in the static graphs. Dash takes this to another level by adding a Flask web server and react.js bindings to provide very fast and efficient callback capability for interactive controls which are completely customizable.

The reason for discussing Dash when I am outlining the framework is that you can learn’s API and essentially stop there. But if you plan to host interactive charts in the cloud , you will want to add Dash concepts to your path. It will not be a large lift to go from to Dash.


Leave a Reply

Your email address will not be published. Required fields are marked *