The matplotlib plot does not display in full screen after clicking the full-screen button

The matplotlib plot does not display in full screen after clicking the full-screen button.

Steps to reproduce

Code snippet:

import streamlit as st
import matplotlib.pyplot as plt
import random

randomlist = random.sample(range(1, 30000), 1000)

_c1, _c2 = st.columns(2)
with _c1:
    fig, ax = plt.subplots(figsize=(16, 9))
    ax.plot(randomlist)
    st.write(fig)

Expected behavior:

Debug info

  • Streamlit version: 1.25
  • Python version: 3.10
  • OS version: window 11
  • Browser version: Edge, Firefox, Chrome

you can set the use the in build plotly features in streamlit also
considering your issue suggestion would be to use the below way supported by streamlit

st.plotly_chart(fig, use_container_width=True)

check out more in this docs streamlit

if not you can use custom CSS for hope the example below help

st.markdown('''
            <style>
            .fullHeight {height : 80vh;
                  width : 100%}
            </style>''', unsafe_allow_html = True)

container = st.container()

container.markdown("<iframe scr='linke', class = 'fullHeight'></iframe>", unsafe_allow_html = True)

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.