Subplot Title incorrectly positioned for Barpolar plot

I am making a simple 2 x 2 subplot. the first 3 plots are Scatter and the last is Barpolar. For some reason, the subplot_title position correctly for the scatter plot but not the Barpolar. I cant seem to figure out how to adjust the Barpolar plot in position 2,2. Any ideas if this is normal behavior and if so, how to fix it?

Here is my code:

fig = []
fig = make_subplots(
     rows=2, cols=2,
     # horizontal_spacing=0.1,
     # vertical_spacing=0.25,
     subplot_titles=('test','','',evtm.columns[5]),
     specs=[[{'type': 'xy'}, {'type': 'xy'}],
       [{'type': 'xy'}, {'type': 'polar'}]]
     #insets=[{'cell':(1,1),'b':0.2}]
     # row_heights=(0.4,0.6),
     # subplot_titles=('','','',evtm.columns[5])     
 )
 fig.add_trace(go.Scatter(
     x=evtm.Date_Time_EDT,
     y=evtm.Tide_ft,
     name = evtm.columns[2],
     line = dict(color = bupu13[0]),
     opacity = 0.8),
     row=1,
     col=1
 )
 fig.add_trace(go.Scatter(
     x=evtm.Date_Time_EDT,
     y=evtm.Precip_in,
     name = evtm.columns[3],
     line = dict(color = bupu13[1]),
     opacity = 0.8),
     row=1,
     col=2
 )
 fig.add_trace(go.Scatter(
     x=evtm.Date_Time_EDT,
     y=evtm.Wind_Speed_mph,
     name = evtm.columns[4],
     line = dict(color = bupu13[5]),
     opacity = 0.8),
     row=2,
     col=1
 )
 fig.add_trace(go.Barpolar(
     theta=wind_sum.Dir,
     r=wind_sum.Perc,
     name = evtm.columns[5],
     marker_color = bupu13[10]),
     row=2,
     col=2
 )
 # fig.update_layout(showlegend=False)
 fig.show()

This is the result I get where you can see subplot(1,1) title β€œtest” is positioned correctly, while subplot(2,2) title β€œWind_Dir_deg” is on top of β€œE”:

@mats2332 Subplot titles are recorded within fig.layout.annotations.

Example:

from plotly.subplots import make_subplots
fig = make_subplots(
             rows=2, cols=2,
             subplot_titles=('Title 1', 'Title 2', 'Title 3', 'Barplot title'),
             specs=[[{'type': 'xy'}, {'type': 'xy'}],
                    [{'type': 'xy'}, {'type': 'polar'}]])
      

Display fig.layout.annotation and you’ll see in fig.layout.annotation[3] the cartesian coordinates of the barplot title.
Since fig.layout.annotations is a tuple, j convert it to a list and update the position of barplot title:

annot =list(fig.layout.annotations)
annot[3].x = 0.76 
fig.layout.annotations = annot

Display again fig.layout.annotation to see that your update was performed.

Thanks! That workaround works. Is there a reason that the title doesn’t automatically position correctly on the Barpolar compared to Scatter? I suspect it is not recognizing that it is overlapping the polar.angularaxis? Is there an auto-position for these titles?

@mats2332 I don’t know how the title position is computed. For more details see:

https://github.com/plotly/plotly.py/blob/master/packages/python/plotly/plotly/subplots.py