Multi lines scatter plot in subplots

Hi,
I have trouble producing a plot with several lines (such as comparing a GDP between different countries over the years) which is part of a number of graphs using a subplot.
To produce such a scatter plot, I am required to do:
fig = go.Figure() and fig.add_trace(plot1) and fig.add_trace(plot2)
while make_subplots function can’t get go.Figure function.
Would appreciate help, thanks in advance, Roei

    fig = go.Figure()
    trace1 = go.Scatter(
        x=,
        y=,
      
        name="
    )
     trace2 = go.Scatter(
        x=,
        y=,
      
        name="
    )
      trace3 = go.Scatter(
        x=,
        y=,
      
        name="
    )
   
    fig.add_trace(trace1)
    fig.add_trace(trace2)
    fig.add_trace(trace3)
   fig.show()

welcome @roei
do you mean this structure ?

from plotly.subplots import make_subplots
fig = make_subplots(
        rows=1, cols=2,
        specs=[[{"type": "pie"},{"type": "Scatter"}]]
)

 trace1= go.Figure()
    trace1 = go.Scatter(
        x=,
        y=,
      
        name="
    )
     trace2 = go.Scatter(
        x=,
        y=,
      
        name="
    )
    
figScatter .add_trace(trace1)
figScatter .add_trace(trace2)

figPie= go.Pie(
                        labels=,
                        values=
                      )

fig.add_trace(figScatter ,row=1, col=1)
fig.add_trace(figPie,row=1, col=2)
fig.show(

            

@sanae I’m looking for something like this about, just working :slight_smile:

1 Like