Unit selector dropdown within axis label

Hi all,

Here’s an example screenshot of the functionality I want to implement. The goal is to have a control embedded inline within the X and Y axes which allow the user to select the units. I already have all the logic to handle the units conversion and update the underlying data, the question is how to get the button to be right next to the axis label.

Any ideas on how this can be done?

image