Libraries that are currently supported

Your streamlit charts are cool but I prefer Matplotlib. Does Streamlit allow charting from other libraries?

Hey BisbeeBC,

I’m glad you like our native chart commands :wink: . We actually spent some time trying to find the right combination of “useful” and “it just works”, but definitely erred on the side of “it just works” as opposed to supporting a ton of features. Thankfully, you can use several different charting libraries with Streamlit, including Altair, Bokeh, Plotly, and — yes — also Matplotlib!

Using Matplotlib with Streamlit is easy: just write st.pyplot() at the end of your code. For example:


import streamlit as st

import matplotlib.pyplot as plt

import numpy as np

arr = np.random.normal(1, 1, size=100)

plt.hist(arr, bins=20)

st.pyplot()

As a bonus, if you want to make your Matplotlib plot interactive, you can pass the pyplot figure object to Plotly:


import streamlit as st

import matplotlib.pyplot as plt

import numpy as np

arr = np.random.normal(1, 1, size=100)

fig = plt.figure()

plt.hist(arr, bins=20)

st.plotly_chart(fig)

2 Likes

Any plans to add HighCharts?

1 Like

Not at the moment, but everything is open source, so you’re welcome to contribute it!

Can I ask what you like about HighCharts as opposed to other charting libraries?

Also, I’m going to change this thread name to reflect the different library questions being asked.

3 Likes

It’s what our product team prefers for presentations, so they ask us to use that.

Gotcha. It’s a really beautiful charting language and we’ve looked into some of the more 3D stuff they do. I’m personally a big fan of Altair and use that for most of my work. I know Plotly has some good 3D charts if you’re interested in that, but I also know that you have to use what the team wants to use!

2 Likes

FYI: I just created an issue for this and added it to our task board :smiley:

I don’t know when we’ll be able to get to it, but if enough people star this on Github we could bump it up the priority list.

Thanks for reporting this!

5 Likes

Thank you so much for having these popular charting libraries supported on Streamlit. Probably another good reason to add HighCharts support is for more interactive map functions! HighCharts has the last piece of the puzzles when developing a BI dashboard with actions on map. (check out [here]!(https://www.highcharts.com/maps/demo/marker-clusters)

1 Like

pyechart is easy-to-use, highly interactive and highly performant javascript visualization library under Apache license. Do you have the plan to add this library. This library has already got enough star.

3 Likes

This is good but I can’t get latex x,y labels to render in the plotly figure - works in the flat Matplotlib plot. Any ideas?