Margin issues in Panel Plotly visualizations

Hello! I am creating a multi-page dashboard (via widgets on sidebar) application, but am having an issue where the right margins of Plotly visualizations create extra unnecessary space and cause the margins to expand. I have two pn.Column side by side, represented by a single pn.Row, which is passed to main when calling pn.template.BootstrapTemplate(...). Each column has rows inside, which represent the individual or grouped plots. The one on the right is the second column in the row. Ultimately, I am looking to have all the plot groupings evenly spaced. In the following image, you can see the large gap down the middle and right sides generated from the margins (image generated via

I’ve replicated the issue across different browsers and when resizing the window. I’ve tried several things to troubleshoot this issue. I’ve just about bruteforced manipulation of the Plotly figure’s sizing modes, margins (l, r, b, t), height, width, and more. I’ve played with the various Panel row and column configurations, and their respective sizing modes, height, width, and more. I’ve experimented with different variations of these things. I’m all tapped out at this point. Is this a css problem? I have no css experience, but if someone could point me in the right direction I’m eager to learn. Has anyone else experienced something like this before? Please let me know if additional context is needed, thank you very much for any insight!

Edit: Panel visualizations created via pn.pane.Plotly(...) … I’m not sure whether I should be looking to display the Plotly visualizations using another way

Hi @mulryan

Welcome to the community.

Have you tried adjusting the margin on your Plotly pane or Column layout? For example like below.

import as px

import panel as pn


def get_plot(template="plotly_dark"):
    fig =["a", "b", "c"], y=[1, 3, 2], template=template)
    return fig

settings = pn.Column(
    "## Dashboards",
        name="Update", sizing_mode="stretch_width", button_type="primary"
    "## Actions",
        name="Download", sizing_mode="stretch_width", button_type="primary"

def get_component():
    return pn.Column(
            pn.widgets.DatePicker(name="Start Date", sizing_mode="stretch_width"),
            pn.widgets.DatePicker(name="End Date", sizing_mode="stretch_width"),
        pn.panel(get_plot(), margin=(10, 0, 10, 10)),

layout = pn.FlexBox(

    title="Panel Dashboard",

Sorry for the late reply @Marc – utilizing pn.FlexBox() was exactly what I needed. Thank you very much for the guidance. Absolutely love the platform.