Styling Multicategory Axis

Hi everyone,

I was wondering how can the second axis in a multicategory x-axis be styled (e.g: changing the size of the font, font family)?

So in the above example how would one change the styling for only the BB, and BB+?

Many thanks in advance.

I have this same question. Searching for β€˜x2’ in the forums didn’t surface anything that seemed relevant. Any ideas?

This Stack Overflow answer addressed my question! Hope it helps.

Ah! Great thanks @nmbogdan !

The provided solution is for a secondary axis which to my understanding is different than a multicategory axis. Does anyone have a solution on how to modify the style of just one β€œlevel” of a multicategory axis?

For example, in the screenshot below, could I modify the fontsize and rotation of β€œBB” and β€œBB+” without modifying any of the xaxis numbers?


Any help on this would be greatly appreciated!

1 Like

I would like to do something similar to bigmike, has anyone figured out how to do this. Nothing seems obvious from the documentation.

1 Like

I’m struggling to figure this out too. I have a multicategory x-axis where the labels are bleeding between categories. I can style the primary x-axis just fine with fig.update_xaxes(...), but cannot figure out how to target the styling of the multicategory labels.

Any help would be appreciated!