Set default height and width for st.write for magic?

Is there a way to set this globally or for a current run?

Hi @Danny_Nguyen,
thanks for your question. Could you provide some additional context? Maybe a piece of code will help clarifying a bit. Are you asking about setting the width of a dataframe when displayed using st.write as in st.write(dataframe)? If so, we don’t support setting a custom width and height for st.write and also we don’t for magic. These methods are meant to be used for quick display. You can set width and height on st.dataframe. For example:

import streamlit as st
import numpy as np

data = np.random.randn(5, 100)


st.dataframe(data, width=300, height=900)


Hi Matteo,
With streamlit. dataframe ( data=None , width=None , height=None ), we can specify width and height. Can we modify the height and width values if we are using magic? In that case we are no longer explicitly calling st.dataframe and I would set all magic calls to a custom height and width.

Thanks @Danny_Nguyen. We cannot do that at the moment. The thought behind magic is something for quick prototyping. Still, I think it could be interesting to explore global defaults as a future feature. Feel free to open a feature request on our github repo. This link should take you to a pre-populated feature request form that you can submit: