Search…
Create a Simple Chart
In this section, we will see how you can visualize the yearly dry bulb temperature data from an EPW as a Plotly chart in a Pollination app. We're using the ladybug-charts library of Ladybug Tools to to create this chart here. This library can help you create, ladybug monthly charts, daily charts, sun path, wind rose, pyschrometric chart, and more.
Install the following libraries first
1
pip install ladybug-charts streamlit
Copied!
Start by importing the libraries
1
import streamlit as st
2
from ladybug.epw import EPW
Copied!
Set the title of the page and layout
1
st.set_page_config(
2
page_title='Dry bulb temperature', layout='wide'
3
)
Copied!
Create an EPW object from an EPW file and then get the heatmap figure. This method returns a Plotly figure with the dry bulb temperature data.
1
epw = EPW("file path to epw file")
2
figure = epw.dry_bulb_temperature.heat_map()
Copied!
Finally, add the title to the page and visualize dry bulb temperature as a Plotly chart.
1
st.plotly_chart(figure, use_container_width=True)
Copied!
You should see an annual heatmap appear in the Streamlit app.
Copy link