Adjust chart location when using subplots with traces

Hello,

How does one control the position or location of a chart when using traces.

In brief, I created a barpolar and a bar chart and I added them into separate traces, which are plotted using set_subplots. Now, while it doesn’t look bad I want to move the chart with the bars below bar polar chart but I can’t figure out how.

data = [trace1, trace2]

# add subplots to existing traces
fig = go.Figure(data=data, frames=frames).set_subplots(2, 1, vertical_spacing=0.1)
fig.update_layout(...
fig.show()

I tried changing the vertical_spacing but that doesn’t appear to be the answer.

Any ideas?
Thanks.

Hi,

From your figure it looks like the polar plot “ignores” the domain specs from subplots and takes the entire y domain instead. This is expected, since you haven’t specified the type and plotly assumes they are both cartesian. As you haven’t specified the subplot they should be added either, they are both in the first one.

So I expect that you can do something like this to manipulate the domains:

fig.update_layout(yaxis=dict(domain=[0., 0.5]))
fig.update_layout(polar=dict(domain=dict(y=[0.5, 1])))

Otherwise, you can take a look on the documentation about subplot types for more options.

Hi @jlfsjunior

So I expect that you can do something like this to manipulate the domains:

fig.update_layout(yaxis=dict(domain=[0., 0.5]))
fig.update_layout(polar=dict(domain=dict(y=[0.5, 1])))

Ah, yes, I forgot about this option. Honestly, I’ve only used a few times, I’m still learning a lot about Plotly.
Thank you, it worked!

This is expected, since you haven’t specified the type and plotly assumes they are both cartesian. As you haven’t specified the subplot they should be added either, they are both in the first one.

I understand. I must have omitted that without realizing how important it was.

I’ve added the specs to the update_layout, as well as the domain.