Visualization in Python

What’s one of the most important part of analyzing financial markets, or data science in general? There are several answers. If you don’t have any data to start with, there’s not really going to be more to analyze. Once you get the data, it needs to be cleaned, before the analysis etc. Once all the number crunching is done, visualization is key to explain the results. 

 

There are many commercial tools you can use for visualization. Excel is probably the most popular, as well as more specialized visualisation tools, like Tableau. If you’re using Python, there are many libraries to do data visualisations, which can range from simple line charts to much more complex ones, where you can control all sorts of properties. Here I’m going to go through a few of these visualization libraries. It’s not an exhaustive list, just a few that I’ve used (and some that I’d hope to use in future).

 

Matplotlib – is probably one of the most well known of Python’s visualization libraries, and is pretty comprehensive in terms of the types of chats available

 

Seaborn – is a wrapper on top of Matplotlib, which makes it a lot easier to use. It has many built in chart types that makes it quick to explore data in one line of code, such as violin plots.

 

Plotly – is a JavaScript based charting library (although we don’t need to know any JavaScript to use it), and we can generate nice interactive charts using it in HTML format, that can be shared. It’s probably one of my favourite chart libraries. It’s also available for many other languages other than Python, including R. It was largely developed by the firm Plotly, but is open source. Plotly Express is like the equivalent of Seaborn for Plotly.

 

Bokeh – is also another JavaScript based charting library. I tended to use this more in the past, but I’ve now largely switched to Plotly.

 

Chartpy – is my own visualization library. It doesn’t actually render the charts itself, but instead acts as unified wrapper for other underlying chart libraries like Plotly and Matplotlib. You just need to change one keyword to switch between them.

 

bqplot – is a charting library open sourced by Bloomberg designed for Jupyter notebooks, which can be coded using a Matplotlib style API or its own API (which I think is easier to use)

 

VisPy – is a newer visualisation library which is GPU accelerated, so is suited to much more complicated graphics and very large datasets, which would be difficult to plot using tools like Matplotlib.

 

Dash – allows you to create web based dashboards in Python, without the need to use lots of JavaScript (some examples here). You can use it to display Plotly based charts. I’ve used it extensively and really like it. Whilst it is an open source library, there is a commercial version Dash Enterprise which makes it easier to host Dash websites and also design them (although it should be noted, it’s perfectly possible to host Dash websites, in the open source, just takes a bit more work – see my tcapy library for an example).

 

H2O Wave – is a newer web based dashboard Python tool, which like Dash doesn’t need for you to have JavaScript skills. It works with many different visualization libraries including Plotly and Matplotlib.

 

Whilst I’m sure that some of the these visualization libraries are very well known, such as Matplotlib or Plotly, quite a few of them are perhaps less well known such as VisPy. If there are any visualization libraries that you use and I haven’t included please do drop me a message! There are quite a few which I haven’t included here such as Altair.