Plotly graphs don't stretch to 100%

I am serving Plotly plots with Django. They used to stretch to 100% of the surrounding div, but now they have a fixed size 400x400 which is nowhere set. First, I am creating the plot and then create the div with

opy.plot(fig, auto_open=False, output_type='div')

The figure is created with:

def lines_plot(rawtools_matrix, cols, colors=colors, title=None, **kwargs):
    fig = go.Figure()
    for i, col in enumerate( cols ):
        fig.add_trace(
            go.Scatter(
                x=rawtools_matrix.index,
                y=rawtools_matrix[col], 
                name=col,
                mode='lines',
                line=dict(width=0.5, color=colors[i]),  
                **kwargs),
               )
               
    fig.update_layout(
        legend_title_text='',
        autosize=True,
        title=title, 
        legend=dict( orientation="h" )
        )

    fig.update_xaxes(title_text=rawtools_matrix.index.name)
    fig.update_yaxes(automargin=True)
    fig.update_xaxes(automargin=True)

    return fig

How can I get the old behavior back where the plots stretched to 100% of the container and not have a fixed size set?

1 Like

This is the generated code and as you can see the main-svg class has width and height set:

<svg class="main-svg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="400" height="400" style="background: rgb(255, 255, 255);"><defs id="defs-290fee"><g class="clips"><clipPath id="clip290feexyplot" class="plotclip"><rect width="350" height="200"></rect></clipPath><clipPath class="axesclip" id="clip290feex"><rect x="50" y="0" width="350" height="400"></rect></clipPath><clipPath class="axesclip" id="clip290feey"><rect x="0" y="100" width="400" height="200"></rect></clipPath><clipPath class="axesclip" id="clip290feexy"><rect x="50" y="100" width="350" height="200"></rect></clipPath></g><g class="gradients"></g></defs><g class="bglayer"></g><g class="draglayer cursor-crosshair"><g class="xy"><rect class="nsewdrag drag" data-subplot="xy" x="50" y="100" width="350" height="200" style="fill: transparent; stroke-width: 0; pointer-events: all;"></rect><rect class="nwdrag drag cursor-nw-resize" data-subplot="xy" x="30" y="80" width="20" height="20" style="fill: transparent; stroke-width: 0; pointer-events: all;"></rect><rect class="nedrag drag cursor-ne-resize" data-subplot="xy" x="400" y="80" width="20" height="20" style="fill: transparent; stroke-width: 0; pointer-events: all;"></rect><rect class="swdrag drag cursor-sw-resize" data-subplot="xy" x="30" y="300" width="20" height="20" style="fill: transparent; stroke-width: 0; pointer-events: all;"></rect><rect class="sedrag drag cursor-se-resize" data-subplot="xy" x="400" y="300" width="20" height="20" style="fill: transparent; stroke-width: 0; pointer-events: all;"></rect><rect class="ewdrag drag cursor-ew-resize" data-subplot="xy" x="85" y="300.5" width="280" height="20" style="fill: transparent; stroke-width: 0; pointer-events: all;"></rect><rect class="wdrag drag cursor-w-resize" data-subplot="xy" x="50" y="300.5" width="35" height="20" style="fill: transparent; stroke-width: 0; pointer-events: all;"></rect><rect class="edrag drag cursor-e-resize" data-subplot="xy" x="365" y="300.5" width="35" height="20" style="fill: transparent; stroke-width: 0; pointer-events: all;"></rect><rect class="nsdrag drag cursor-ns-resize" data-subplot="xy" x="29.5" y="120" width="20" height="160" style="fill: transparent; stroke-width: 0; pointer-events: all;"></rect><rect class="sdrag drag cursor-s-resize" data-subplot="xy" x="29.5" y="280" width="20" height="20" style="fill: transparent; stroke-width: 0; pointer-events: all;"></rect><rect class="ndrag drag cursor-n-resize" data-subplot="xy" x="29.5" y="100" width="20" height="20" style="fill: transparent; stroke-width: 0; pointer-events: all;"></rect></g></g><g class="layer-below"><g class="imagelayer"></g><g class="shapelayer"></g></g><g class="cartesianlayer"><g class="subplot xy"><g class="layer-subplot"><g class="shapelayer"></g><g class="imagelayer"></g></g><g class="gridlayer"><g class="x"><path class="xgrid crisp" transform="translate(55.91,0)" d="M0,100v200" style="stroke: rgb(238, 238, 238); stroke-opacity: 1; stroke-width: 1px;"></path><path class="xgrid crisp" transform="translate(164.61,0)" d="M0,100v200" style="stroke: rgb(238, 238, 238); stroke-opacity: 1; stroke-width: 1px;"></path><path class="xgrid crisp" transform="translate(273.31,0)" d="M0,100v200" style="stroke: rgb(238, 238, 238); stroke-opacity: 1; stroke-width: 1px;"></path><path class="xgrid crisp" transform="translate(382,0)" d="M0,100v200" style="stroke: rgb(238, 238, 238); stroke-opacity: 1; stroke-width: 1px;"></path></g><g class="y"><path class="ygrid crisp" transform="translate(0,272)" d="M50,0h350" style="stroke: rgb(238, 238, 238); stroke-opacity: 1; stroke-width: 1px;"></path><path class="ygrid crisp" transform="translate(0,212)" d="M50,0h350" style="stroke: rgb(238, 238, 238); stroke-opacity: 1; stroke-width: 1px;"></path><path class="ygrid crisp" transform="translate(0,152)" d="M50,0h350" style="stroke: rgb(238, 238, 238); stroke-opacity: 1; stroke-width: 1px;"></path></g></g><g class="zerolinelayer"></g><path class="xlines-below"></path><path class="ylines-below"></path><g class="overlines-below"></g><g class="xaxislayer-below"></g><g class="yaxislayer-below"></g><g class="overaxes-below"></g><g class="plot" transform="translate(50, 100)" clip-path="url('#clip290feexyplot')"><g class="scatterlayer mlayer"><g class="trace scatter trace6c99e9" style="stroke-miterlimit: 2; opacity: 1;"><g class="fills"></g><g class="errorbars"></g><g class="lines"><path class="js-line" d="M0,154L0.67,148L1.15,178L1.84,154L2.1,184L2.68,178L2.68,184L2.94,154L3.97,190L4.49,190L4.93,160L5.04,190L5.42,184L5.42,190L5.92,178L6.22,190L6.48,190L6.73,172L7.24,166L7.82,190L7.82,178L8.57,190L8.79,160L8.83,154L8.83,190L9.2,178L9.63,190L10.37,178L10.37,184L10.37,190L10.64,178L10.9,178L11.17,190L11.91,160L11.94,190L12.41,118L12.69,184L12.92,184L13.4,154L13.4,190L13.4,178L13.63,166L14.16,160L14.16,190L14.16,184L14.42,184L14.42,190L14.67,160L15.13,184L15.2,190L15.26,148L15.83,190L15.96,184L15.97,118L16.11,190L16.67,172L16.75,130L17.56,190L17.58,184L17.63,160L18.04,190L18.26,184L18.65,172L19.06,190L19.19,154L19.21,184L19.31,142L19.88,190L20.14,178L20.3,190L21.02,142L21.03,190L21.08,190L21.34,166L21.84,172L21.91,184L21.97,154L22.01,190L22.66,154L22.73,160L23.47,190L23.61,190L23.91,154L24,184L24.38,172L24.4,190L25.09,160L25.16,190L25.9,160L25.97,178L26.02,190L26.21,76L26.23,172L26.49,178L26.9,172L26.9,190L26.9,178L27.1,166L27.74,190L27.81,184L27.96,190L28.54,166L28.9,166L29.15,190L29.25,118L29.65,190L29.78,178L29.81,142L29.88,190L30.42,190L30.51,178L31.1,160L31.1,190L31.29,178L31.37,190L31.38,160L32.04,166L32.08,178L32.08,190L32.77,154L32.81,166L32.94,178L33.38,190L33.38,154L33.48,178L33.73,112L34.42,190L34.6,136L34.64,190L35.31,178L35.36,184L35.57,172L35.73,190L35.73,184L35.75,154L36.44,136L36.51,190L36.51,184L36.62,178L37,190L37.1,124L37.23,184L37.39,184L37.54,190L38.07,160L38.13,190L38.16,154L38.47,142L38.64,190L38.91,166L38.94,166L39.42,190L39.66,166L39.89,178L40.04,190L40.04,154L40.06,184L40.06,106L40.08,190L40.66,148L40.84,190L41.41,118L41.63,160L41.68,190L42.19,118L42.43,178L42.57,166L42.77,190L42.85,178L43.03,166L43.14,160L43.22,184L43.23,112L43.37,190L43.97,124L44.01,172L44.16,190L44.18,148L44.76,190L44.81,166L44.87,148L45.26,190L45.53,184L45.57,178L45.88,190L46.21,142L46.29,190L46.45,154L46.79,190L47.19,184L47.27,190L48.13,130L48.16,136L48.89,190L48.93,178L49.2,190L49.2,142L49.27,148L49.31,118L49.31,190L49.61,106L50.06,184L50.07,178L50.43,100L50.63,190L50.76,178L50.82,160L51.37,148L51.52,190L51.53,184L51.62,160L51.84,118L51.94,190L52.32,154L52.34,142L53,190L53,118L53.08,178L53.21,190L53.92,130L54,178L54.21,190L54.62,154L54.74,166L54.75,184L54.81,148L55.48,190L55.49,166L55.6,190L55.67,88L56.27,184L56.27,166L56.93,130L56.99,190L57.04,148L57.3,130L57.71,190L57.75,136L57.81,154L58.56,190L58.61,184L58.61,172L58.68,112L59.18,190L59.35,172L59.46,172L59.62,190L59.99,136L60.15,172L60.2,184L60.37,184L60.4,172L60.51,130L60.62,190L61.09,178L61.14,190L61.43,112L61.88,172L61.94,184L61.94,190L62.19,118L62.66,190L62.78,190L63.12,148L63.52,178L63.61,178L63.68,112L63.92,190L64.34,190L64.37,190L65.08,106L65.09,166L65.1,190L65.11,106L65.8,178L65.86,112L65.88,190L66.61,178L66.68,178L66.96,148L67.13,190L67.38,178L67.45,184L67.63,190L67.9,124L68.2,148L68.28,184L68.39,190L69.02,112L69.18,190L69.95,94L70.01,172L70.09,190L70.79,136L70.79,154L70.8,160L71,100L71.14,184L71.39,166L71.45,190L71.51,106L72.02,166L72.09,190L72.36,136L72.7,154L72.91,190L73,112L73.65,172L73.71,172L73.78,118L74.12,190L74.46,172L74.47,172L75.06,118L75.13,190L75.2,184L75.56,142L75.69,160L75.75,190L76.08,136L76.49,166L76.55,190L76.98,172L76.98,130L77.54,124L77.69,190L77.76,178L78.26,154L78.52,190L78.55,124L79.28,190L79.29,184L79.34,160L79.34,118L79.37,190L80.08,178L80.13,190L80.69,142L80.73,148L80.81,190L81.44,82L81.48,160L81.59,160L81.66,190L81.96,58L82.36,82L82.37,166L82.45,106L82.98,190L83.06,148L83.26,118L83.73,190L83.81,160L83.88,190L84.1,142L84.1,160L84.18,190L84.95,64L84.96,178L85.01,190L85.5,118L85.71,178L85.76,172L85.89,190L86.5,82L86.51,160L86.73,190L87.31,88L87.45,172L87.52,184L87.64,190L88.09,112L88.23,190L88.26,190L88.79,124L88.89,148L89.1,178L89.26,166L89.45,190L89.47,112L90.07,190L90.25,184L90.3,154L90.32,136L90.37,190L91.01,142L91.08,178L91.23,190L91.66,100L91.75,166L91.8,178L92.35,190L92.5,118L92.55,130L92.57,160L93.1,112L93.23,190L93.32,184L93.44,172L93.49,130L93.67,190L93.92,136L93.93,190L94.41,106L94.69,166L94.83,184L95.19,46L95.34,190L95.58,172L95.63,172L95.7,100L96.07,190L96.34,136L96.4,166L96.44,106L96.96,190L97.01,178L97.04,112L97.3,106L97.65,190L97.86,178L97.92,112L97.92,184L98.62,130L98.71,190L98.97,118L99.48,160L99.5,190L99.71,100L100.16,190L100.37,172L100.49,190L100.99,100L101.17,130L101.19,166L101.31,190L101.36,142L101.85,172L101.85,124L102.44,190L102.63,178L102.67,160L103.05,106L103.23,190L103.35,178L103.51,172L103.72,160L103.89,184L104.01,166L104.11,154L104.11,94L104.27,190L104.83,160L104.89,160L104.97,142L105.53,190L105.58,154L105.64,148L105.85,190L105.85,112L106.2,124L106.27,124L106.33,190L106.91,106L107.01,130L107.04,184L107.06,106L107.41,190L107.7,190L107.82,160L108.28,190L108.35,118L108.55,160L108.63,124L108.76,190L108.8,106L109.33,178L109.36,94L109.71,184L110.16,172L110.17,130L110.17,190L110.18,100L110.91,172L110.94,166L111.3,142L111.44,184L111.49,112L111.5,190L112.2,64L112.2,160L112.28,178L112.74,190L113.06,118L113.09,124L113.13,142L113.36,190L113.84,130L113.97,94L114.37,190L114.75,178L114.77,142L115.03,184L115.03,106L115.53,166L115.59,166L115.71,190L116.2,118L116.32,118L116.82,190L117.06,112L117.09,130L117.34,190L117.71,100L117.84,112L117.88,154L118.01,184L118.62,118L118.63,130L118.63,166L118.66,58L119.12,190L119.32,130L119.37,154L119.45,94L119.66,172L119.82,142L119.83,106L120.09,70L120.45,190L120.6,166L120.62,88L121.38,190L121.53,190L122.01,118L122.11,160L122.17,184L122.28,190L122.73,88L122.9,154L122.95,106L123.18,100L123.56,190L123.66,172L123.68,124L123.69,190L123.75,100L124.43,190L124.44,166L124.44,190L125.04,82L125.19,136L125.21,178L125.82,118L125.98,154L126.03,172L126.22,184L126.36,100L126.75,172L126.78,184L127.15,94L127.59,148L127.65,166L127.69,190L127.92,100L128.42,112L128.43,184L128.57,190L129.02,82L129.15,172L129.2,178L129.36,190L129.86,100L129.99,160L130.04,160L130.5,190L130.78,94L130.8,124L131.05,106L131.06,190L131.53,148L131.57,154L131.74,130L131.78,178L132.14,148L132.15,142L132.31,76L132.74,190L132.79,160L132.82,88L132.96,190L133.56,178L133.6,160L133.75,190L133.86,106L134.2,148L134.21,100L134.22,178L134.48,34L134.91,46L134.97,172L135.61,106L135.7,154L135.73,178L136.22,190L136.49,130L136.54,184L137.06,40L137.2,190L137.3,172L137.34,172L137.68,190L137.77,94L138.06,178L138.13,154L138.18,184L138.5,76L138.86,160L138.93,172L138.99,190L139.32,76L139.67,160L139.8,136L139.82,178L139.96,94L140.52,160L140.6,166L140.61,94L140.69,172L141.34,106L141.41,154L141.63,112L141.75,190L142.1,172L142.12,178L142.17,64L142.25,184L142.86,118L142.9,142L142.95,184L143.38,94L143.6,172L143.6,112L143.8,184L144.06,70L144.08,178L144.11,58L144.16,178L144.85,154L144.94,190L145.3,106L145.7,160L145.78,106L145.83,88L145.84,184L146.45,130L146.63,154L146.86,76L147.19,190L147.32,154L147.39,112L147.79,190L147.81,100L148.12,166L148.22,100L148.63,184L148.91,64L148.93,178L148.99,166L149.53,184L149.53,100L149.69,184L149.79,100L149.87,178L150.43,136L150.6,100L151.2,190L151.29,64L151.29,160L151.35,130L151.58,178L151.64,94L152.08,172L152.14,124L152.46,94L152.89,178L152.9,124L152.93,190L153,112L153.6,136L153.68,154L153.8,124L153.86,184L153.9,94L154.27,172L154.46,34L154.66,154L154.68,118L154.68,100L154.94,178L155.43,172L155.44,142L155.56,178L156.2,88L156.2,142L156.21,190L156.29,82L156.95,160L156.96,118L157.35,64L157.52,190L157.66,154L157.81,160L157.96,172L157.98,70L158.13,160L158.22,190L158.82,64L158.99,118L159.01,118L159.08,112L159.44,190L159.74,124L159.78,100L159.83,190L160.55,154L160.56,154L160.69,82L161.16,190L161.26,184L161.33,70L161.56,190L162.05,166L162.1,148L162.55,184L162.8,88L162.8,124L162.89,178L163.09,100L163.18,184L163.53,166L163.55,172L163.66,148L163.67,172L163.67,106L164.16,64L164.18,184L164.36,148L164.48,124L164.71,100L164.91,190L165.11,154L165.16,106L165.16,178L165.62,70L165.9,112L165.95,154L165.97,172L166.33,100L166.65,130L166.7,166L166.98,178L167.36,82L167.45,100L167.49,160L167.76,94L168.16,184L168.28,106L168.3,160L168.51,178L168.55,142L168.57,148L168.63,106L168.73,100L168.74,190L169.4,142L169.43,88L169.72,70L170.18,184L170.3,82L170.68,184L170.79,70L171.1,160L171.1,124L171.3,64L171.78,190L171.79,40L172.46,172L172.46,82L172.59,166L172.7,172L172.71,94L173.32,100L173.39,160L173.48,166L173.5,118L173.52,118L174.11,166L174.16,88L174.18,160L174.5,184L174.88,70L174.92,172L174.97,160L175.18,178L175.41,64L175.63,148L175.76,166L175.93,46L176.05,178L176.51,160L176.52,118L176.89,112L177.03,184L177.2,160L177.43,160L177.74,106L178.02,166L178.02,100L178.18,178L178.76,154L178.78,142L178.97,100L179.38,178L179.4,130L179.47,172L179.86,70L180.22,124L180.23,166L180.96,94L181.01,136L181.18,190L181.45,76L181.76,124L181.84,154L182.08,64L182.16,190L182.51,148L182.54,130L183.02,100L183.17,160L183.18,76L183.62,190L183.94,178L183.98,172L184.42,76L184.49,178L184.53,160L184.76,160L184.92,160L184.97,118L185.03,190L185.39,70L185.69,106L185.83,166L186.14,178L186.22,82L186.58,142L186.61,178L186.87,46L187.36,100L187.39,58L187.41,46L187.61,172L187.95,124L188.07,124L188.19,112L188.21,166L188.73,154L188.88,124L189.21,88L189.49,178L189.5,154L189.52,88L189.91,166L190.26,148L190.29,154L190.7,52L190.84,178L191.03,70L191.09,178L191.27,82L191.77,172L191.78,172L191.8,88L192.46,136L192.55,106L192.89,178L193.02,148L193.02,76L193.83,178L193.84,148L194.07,172L194.08,112L194.28,118L194.3,94L194.84,34L194.85,178L195.04,154L195.07,118L195.23,166L195.6,94L195.78,112L195.9,154L195.96,166L196.15,82L196.61,130L196.69,76L196.99,160L197.44,142L197.51,160L197.63,100L197.96,178L198.26,154L198.31,136L198.38,178L198.52,52L199,130L199.09,142L199.17,172L199.6,70L199.66,76L199.81,118L199.86,178L200.39,34L200.57,166L200.66,172L201.14,28L201.36,136L201.53,154L201.57,82L202.06,178L202.15,106L202.26,112L202.39,172L202.79,94L203.01,166L203.07,178L203.13,34L203.82,166L203.83,166L204.18,76L204.56,118L204.59,166L204.78,172L204.84,52L205.33,100L205.35,142L205.36,22L205.45,172L205.95,166L206.12,154L206.23,166L206.75,46L206.9,58L207.05,130L207.38,76L207.44,190L207.72,154L207.82,124L208.26,190L208.5,82L208.5,94L208.59,136L208.81,160L209.02,76L209.31,160L209.42,112L209.53,166L209.53,88L210.21,136L210.28,160L210.29,100L210.83,172L211.04,88L211.83,172L211.85,118L212.04,64L212.51,172L212.57,112L212.63,112L212.75,94L212.97,160L213.27,124L213.39,118L213.81,88L213.97,154L214.02,106L214.16,124L214.26,130L214.32,118L214.45,94L214.88,124L214.91,148L215,172L215.29,88L215.48,118L215.85,112L215.97,76L216.65,160L216.67,130L217.04,172L217.04,100L217.44,118L217.46,118L217.58,172L218.12,82L218.21,130L218.39,94L218.84,178L218.89,118L218.91,94L219.19,70L219.64,178L219.89,82L220.11,142L220.14,58L220.19,112L220.21,154L220.34,88L220.37,160L220.41,136L220.51,28L220.57,160L221.23,100L221.33,130L221.38,172L222.14,76L222.15,100L222.16,160L222.46,46L222.79,118L222.93,130L223.06,160L223.14,40L223.46,82L223.7,124L223.96,160L224.25,82L224.57,160L224.94,112L225.09,100L225.24,166L225.3,34L225.59,112L225.67,166L226.39,172L226.4,82L226.44,136L226.67,166L226.7,28L227.05,112L227.12,88L227.14,70L227.59,160L227.67,136L227.88,82L228.31,178L228.47,142L228.77,160L229.31,64L229.43,112L229.68,112L229.99,76L230.24,166L230.26,94L230.42,124L230.47,82L230.94,166L231.12,142L231.18,88L231.84,172L231.89,130L232.08,46L232.45,34L232.61,160L232.7,106L232.85,100L233.41,70L233.53,160L233.56,100L233.63,106L233.75,34L233.97,160L234.03,70L234.47,100L234.61,64L235.21,160L235.21,118L235.38,160L235.76,58L235.92,124L236.01,136L236.28,172L236.42,88L236.43,160L237.2,46L237.25,106L237.55,130L238.07,40L238.24,94L238.52,124L238.69,118L239.46,154L239.63,106L239.95,82L240.14,142L240.3,142L240.31,112L240.33,160L240.65,88L241.03,154L241.12,172L241.24,100L241.95,118L242.08,94L242.23,58L242.48,136L242.82,106L242.86,76L243.36,160L243.4,142L243.57,46L244.24,172L244.44,94L244.51,10L244.84,160L245.17,94L245.37,130L245.41,136L245.64,58L245.67,22L246.31,136L246.45,166L246.63,76L247.19,106L247.67,148L247.68,76L247.82,160L248.36,112L248.48,94L248.63,148L248.74,88L249.1,100L249.12,70L249.67,124L249.75,70L249.91,106L249.99,76L250.73,154L250.78,100L251.05,154L251.19,100L251.35,58L251.57,118L251.96,76L252.13,148L252.4,112L252.57,82L252.65,142L252.68,28L253.24,124L253.46,100L253.94,88L254.16,154L254.18,52L254.24,130L254.79,100L255.02,106L255.32,136L255.65,10L255.67,88L256.25,160L256.42,160L256.46,94L256.54,88L256.78,124L256.94,118L257.06,166L257.65,28L257.69,100L257.71,28L258.27,172L258.5,118L258.53,88L258.58,136L258.67,82L259.31,106L259.45,142L259.5,40L259.71,46L259.73,118L260.12,154L260.34,94L260.43,100L260.6,118L260.73,82L261.2,154L261.56,106L261.61,100L261.9,160L261.92,64L262.55,106L262.67,82L263.35,154L263.94,100L263.98,160L264.31,94L264.63,142L264.74,88L264.96,58L265.19,106L265.41,100L265.49,76L265.63,172L266.02,82L266.19,124L266.21,82L266.87,106L266.99,88L267.16,94L267.37,136L267.55,106L267.64,148L267.86,88L268.61,166L268.65,136L268.67,40L269.54,124L269.64,64L270.04,34L270.29,118L270.33,46L270.91,124L271.15,88L271.87,118L272.35,88L272.58,160L272.79,76L272.83,136L273.5,94L273.59,124L273.82,106L274.6,154L274.71,70L274.94,124L275.45,130L276.46,34L276.6,154L277.04,70L277.23,106L277.81,100L277.97,28L278.42,82L278.85,124L279.13,70L279.17,148L280.47,106L280.55,64L280.82,142L281.23,94L281.41,82L282.14,112L282.54,40L282.55,136L283.23,40L283.32,34L283.39,112L284.22,118L284.56,154L284.6,94L285.47,94L285.56,40L285.91,82L286.41,106L286.63,106L287.05,124L287.17,130L287.28,52L287.68,94L287.79,124L287.8,82L287.82,88L288.68,112L288.93,154L289,106L289.53,124L289.74,106L290.39,118L291.74,160L291.92,118L293.23,130L293.76,94L294.22,88L294.84,154L295.61,124L295.88,100L296.15,82L296.48,154L297.3,100L297.36,106L297.81,70L298.67,118L299.08,40L300.62,118L300.91,154L302.57,40L304.36,160L304.39,76L304.95,124L305.35,112L305.91,154L305.97,94L306.1,88L306.15,178L306.73,94L309.12,106L309.79,124L309.94,148L310.98,100L311.33,40L311.43,112L311.69,106L312.16,100L312.66,88L313.03,130L315.18,130L315.27,118L315.5,58L316.42,106L319.72,124L320.06,106L321.14,76L321.9,112L327.91,94L330.21,82L330.43,154L332.59,124L333.68,112L335,118L336.4,88L336.78,124L336.82,106L338.5,112L339.94,124L345.51,100L349.15,154L349.18,46L349.23,178L349.84,112L350,130L350,118" style="vector-effect: non-scaling-stroke; fill: none; stroke: rgb(100, 0, 0); stroke-opacity: 0.5; stroke-width: 0.5px; opacity: 1;"></path></g><g class="points"></g><g class="text"></g></g></g></g><g class="overplot"></g><path class="xlines-above crisp" d="M0,0" style="fill: none;"></path><path class="ylines-above crisp" d="M0,0" style="fill: none;"></path><g class="overlines-above"></g><g class="xaxislayer-above"><g class="xtick"><text text-anchor="middle" x="0" y="311" data-unformatted="20" data-math="N" transform="translate(55.91,0)" style="font-family: &quot;Open Sans&quot;, verdana, arial, sans-serif; font-size: 10px; fill: rgb(68, 68, 68); fill-opacity: 1; white-space: pre;">20</text></g><g class="xtick"><text text-anchor="middle" x="0" y="311" data-unformatted="40" data-math="N" transform="translate(164.61,0)" style="font-family: &quot;Open Sans&quot;, verdana, arial, sans-serif; font-size: 10px; fill: rgb(68, 68, 68); fill-opacity: 1; white-space: pre;">40</text></g><g class="xtick"><text text-anchor="middle" x="0" y="311" data-unformatted="60" data-math="N" transform="translate(273.31,0)" style="font-family: &quot;Open Sans&quot;, verdana, arial, sans-serif; font-size: 10px; fill: rgb(68, 68, 68); fill-opacity: 1; white-space: pre;">60</text></g><g class="xtick"><text text-anchor="middle" x="0" y="311" data-unformatted="80" data-math="N" transform="translate(382,0)" style="font-family: &quot;Open Sans&quot;, verdana, arial, sans-serif; font-size: 10px; fill: rgb(68, 68, 68); fill-opacity: 1; white-space: pre;">80</text></g></g><g class="yaxislayer-above"><g class="ytick"><text text-anchor="end" x="49" y="3.5" data-unformatted="10" data-math="N" transform="translate(0,272)" style="font-family: &quot;Open Sans&quot;, verdana, arial, sans-serif; font-size: 10px; fill: rgb(68, 68, 68); fill-opacity: 1; white-space: pre;">10</text></g><g class="ytick"><text text-anchor="end" x="49" y="3.5" data-unformatted="20" data-math="N" transform="translate(0,212)" style="font-family: &quot;Open Sans&quot;, verdana, arial, sans-serif; font-size: 10px; fill: rgb(68, 68, 68); fill-opacity: 1; white-space: pre;">20</text></g><g class="ytick"><text text-anchor="end" x="49" y="3.5" data-unformatted="30" data-math="N" transform="translate(0,152)" style="font-family: &quot;Open Sans&quot;, verdana, arial, sans-serif; font-size: 10px; fill: rgb(68, 68, 68); fill-opacity: 1; white-space: pre;">30</text></g></g><g class="overaxes-above"></g></g></g><g class="polarlayer"></g><g class="ternarylayer"></g><g class="geolayer"></g><g class="funnelarealayer"></g><g class="pielayer"></g><g class="treemaplayer"></g><g class="sunburstlayer"></g><g class="glimages"></g></svg>

Hi, had the same issue.

Setting a fixed value for the graph left margin (e.g. margin={ā€˜lā€™: 0} in update_layout) solved my issue.

1 Like

It actually was not a Plotly issue. The template that I used had image dimensions set. Now it works as expected.