Your streamlit charts are cool but I prefer Matplotlib. Does Streamlit allow charting from other libraries?
I’m glad you like our native chart commands . 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)
Any plans to add HighCharts?
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.
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!
FYI: I just created an issue for this and added it to our task board
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!
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)
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?