How to decrease plot size?

I set my web app to Wide Mode. As a result, the plotted graph fills the entire page, making it very large. Is there any way to plot it as if it were out of Wide Mode, or any way to decrease it? I would like it to be in a size that looks good on both the computer and mobile.

            fig1 = plt.figure()
            plt.subplot(1, 1, 1)
            plt.axhline(0, linewidth=0.3, color='white')
            plt.plot(1.477*r, v(u, l), color="white")
            plt.plot([1.477/umin,1.477/umax],[vmin,vmax],'bo', color="gold")
            plt.xlabel("r [km]")
            plt.axis([0, 1.477*rmax, -0.5, vlim + 0.1])
            ax = plt.gca()
            ax.spines['bottom'].set_color('white')
            ax.tick_params(axis='x', colors='white')
            ax.tick_params(axis='y', colors='white')
            ax.spines['top'].set_color('white') 
            ax.spines['right'].set_color('white')
            ax.spines['left'].set_color('white')
            ax.xaxis.label.set_color('white')
            ax.yaxis.label.set_color('white')
            fig1.patch.set_facecolor('#0E1117')
            ax.set_facecolor("black")
            plt.show()
            st.pyplot(fig1)

I’m still having a problem with this issue. Does anyone know hot to fiz the size of this plot? Thanks for any help

I have used Plotly before and it tends to work well when changing to Wide Mode.

import plotly.graph_objects as go
fig=go.Figure()
fig.add_scatter(
name=β€˜Example’,
x=[1,2,3],
y=[1,2,4],
showlegend=True
)

fig.update_layout(
autosize=True,
width=400,
height=400)
st.plotly_chart(fig)

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