Get rotation, horizontal alignment, and vertical alignment, respectively, based on orientation and rotation
(location, rotation)
| 132 | |
| 133 | |
| 134 | def _set_label_positions(location, rotation): |
| 135 | """Get rotation, horizontal alignment, and vertical alignment, |
| 136 | respectively, based on orientation and rotation |
| 137 | """ |
| 138 | if location in ['top', 'bottom']: |
| 139 | rotation = 'horizontal' if rotation is None else rotation |
| 140 | return rotation, 'right', 'center' |
| 141 | |
| 142 | elif location in ['left', 'right']: |
| 143 | rotation = 90 if rotation is None else rotation |
| 144 | if rotation == 90 or rotation == 0: |
| 145 | return rotation, 'center', 'bottom' |
| 146 | else: |
| 147 | return rotation, 'left', 'bottom' |
| 148 | else: |
| 149 | raise ValueError("`location` must be 'top', 'bottom', 'left' or " |
| 150 | "'right'") |
| 151 | |
| 152 | |
| 153 | def _set_colorbar_labels(cbar, label, location, fontsize=10, rotation=None): |
no outgoing calls
no test coverage detected