Skip to content
Advertisement

Position label of colorbar

I have this function:

JavaScript

Which gives me this sort of image: figure generated by the code snippet How can I position the “Distance from diagonal” to the left of the colorbar?

(Also, is there a cleaner way to plot the diagonal over a scatter plot like this?)

Advertisement

Answer

one way to do it is to use the text as the label for the secondary y-axis. That will keep the text before the colorbar. Also, you can draw a line for the diagonal. The code (without your data) is shown below. If you use transform=ax.transAxes details, the coordinates are interpreted as axes coordinates

JavaScript

Plot

enter image description here

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement