# Remove spacing between subplots in PlotlyJS

**URL:** <https://discourse.julialang.org/t/remove-spacing-between-subplots-in-plotlyjs/109878>\
**Category:** Visualization\
**Created:** [February 7, 2024, 2:45pm UTC](https://discourse.julialang.org/t/remove-spacing-between-subplots-in-plotlyjs/109878 "2024-02-07T14:45:56Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jabru](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jabru/32/205670_2.png) [@jabru](https://discourse.julialang.org/u/jabru)\
**Post date:** [February 7, 2024, 2:45pm UTC](https://discourse.julialang.org/t/remove-spacing-between-subplots-in-plotlyjs/109878/1 "2024-02-07T14:45:56Z")

</div>

Hi there,

So I am currently trying to use PlotlyJS for my plots.

I am running the following code

```julia
using PlotlyJS

np = pyimport("numpy")

function main()
    trace1 = scatter(; x = rand(100), y = rand(100),
                        mode="markers", 
                        name="linear")

    trace2 = scatter(;#x = height_potential_fluorescence[:, 2],
                    x = rand(100), y = rand(100),
                    mode="markers", 
                    name="linear",
                    textposition="top center")

    trace3 = scatter(
                    y = rand(100), x = rand(100),
                    mode="markers", 
                    name="linear",
                    textposition="top center",
    )

    trace4 = scatter3d(
                    z = rand(100), x = rand(100), y = rand(100),
                    mode="markers", 
                    name="linear",
                    textposition="top center",
    )

    p=make_subplots(
        rows=2, cols=2,
        row_heights=[0.5, 0.5],
        specs=[
        Spec(kind="xy") Spec(kind="xy")
        Spec(kind="xy") Spec(kind="scene")
    ]
    )

    add_trace!(p, trace1, row=1, col=1)
    add_trace!(p, trace2, row=1, col=2)
    add_trace!(p, trace3, row=2, col=1)
    add_trace!(p, trace4, row=2, col=2)

    relayout!(p, height=1300, width=1500, title_text="specs examples", showlegend=false,vertical_spacing=0., horizontal_spacing=0. )

    p
    
end

GC.gc()

@time height_potential_fluorescence = main()

```

 ![coolplot](https://global.discourse-cdn.com/julialang/original/3X/f/b/fb557fb236ac269eb92e139d9c004dddd01fbfb6.png).

Even though I set both vertical\_spacing=0. and horizontal\_spacing=0. the spaces between the plots is still quite large. Does anyone now how to reduce this spacing?

All help appreciated!

The output is somthing like this
