[Feature request] Make it easier to specify spacing in between titles and subtitles
I really appreciate the subtitle parameter within Plotly Express charts. However, I'm finding that, when I use title_y to update the title's location, the subtitle's location doesn't follow accordingly. This can result in unsightly gaps between the title and subtitle.
Would it be possible to add a subtitle_y dimension that would let me adjust the spacing between title and subtitle elements? I suppose subtitle_x would be handy also in case some users want a horizontal offset between titles and subtitles.
Here are some screenshots for reference. First, in this chart, I'd like to move the title and subtitle up to increase the spacing between those elements and my legend:
I can set title_y to 0.98 to move it farther from the legend; however, the y position of the subtitle moves up only a little, thus increasing the gap between the two.
If there were a corresponding subtitle_y parameter that I could adjust, I would be able to easily resolve this issue. (In the meantime, I can get around it by creating subtitles via add_annotation.)
Thank you in advance for your consideration and help!
I've now found a better workaround than add_annotation: It appears that setting title_yanchor to bottom keeps the spacing between titles and subtitles much more consistent. Here's an updated screenshot in which title_yanchor is set to bottom, margin_t is set to 120, and title_y is set to 0.95:
Although it would still be nice to have a subtitle_y parameter down the road, using title_yanchor='bottom' will work great for now. :)
Great that you were able to find a workaround! We probably won't get to this issue any time soon but we'll keep it in the icebox in case others run into the same problem!