(text, x_or_y_axis)
| 110 | |
| 111 | |
| 112 | def _axis_title_annotation(text, x_or_y_axis): |
| 113 | if x_or_y_axis == "x": |
| 114 | x_pos = 0.5 |
| 115 | y_pos = -0.1 |
| 116 | textangle = 0 |
| 117 | elif x_or_y_axis == "y": |
| 118 | x_pos = -0.1 |
| 119 | y_pos = 0.5 |
| 120 | textangle = 270 |
| 121 | |
| 122 | if not text: |
| 123 | text = "" |
| 124 | |
| 125 | annot = { |
| 126 | "font": {"color": "#000000", "size": AXIS_TITLE_SIZE}, |
| 127 | "showarrow": False, |
| 128 | "text": text, |
| 129 | "textangle": textangle, |
| 130 | "x": x_pos, |
| 131 | "xanchor": "center", |
| 132 | "xref": "paper", |
| 133 | "y": y_pos, |
| 134 | "yanchor": "middle", |
| 135 | "yref": "paper", |
| 136 | } |
| 137 | return annot |
| 138 | |
| 139 | |
| 140 | def _add_shapes_to_fig(fig, annot_rect_color, flipped_rows=False, flipped_cols=False): |