Set the y-axis view limits. Parameters ---------- bottom : float, optional The bottom ylim in data coordinates. Passing *None* leaves the limit unchanged. The bottom and top ylims may also be passed as the tuple (*bot
(self, bottom=None, top=None, *, emit=True, auto=False,
ymin=None, ymax=None)
| 4141 | return tuple(self.viewLim.intervaly) |
| 4142 | |
| 4143 | def set_ylim(self, bottom=None, top=None, *, emit=True, auto=False, |
| 4144 | ymin=None, ymax=None): |
| 4145 | """ |
| 4146 | Set the y-axis view limits. |
| 4147 | |
| 4148 | Parameters |
| 4149 | ---------- |
| 4150 | bottom : float, optional |
| 4151 | The bottom ylim in data coordinates. Passing *None* leaves the |
| 4152 | limit unchanged. |
| 4153 | |
| 4154 | The bottom and top ylims may also be passed as the tuple |
| 4155 | (*bottom*, *top*) as the first positional argument (or as |
| 4156 | the *bottom* keyword argument). |
| 4157 | |
| 4158 | .. ACCEPTS: (bottom: float, top: float) |
| 4159 | |
| 4160 | top : float, optional |
| 4161 | The top ylim in data coordinates. Passing *None* leaves the |
| 4162 | limit unchanged. |
| 4163 | |
| 4164 | emit : bool, default: True |
| 4165 | Whether to notify observers of limit change. |
| 4166 | |
| 4167 | auto : bool or None, default: False |
| 4168 | Whether to turn on autoscaling of the y-axis. *True* turns on, |
| 4169 | *False* turns off, *None* leaves unchanged. |
| 4170 | |
| 4171 | ymin, ymax : float, optional |
| 4172 | They are equivalent to bottom and top respectively, and it is an |
| 4173 | error to pass both *ymin* and *bottom* or *ymax* and *top*. |
| 4174 | |
| 4175 | Returns |
| 4176 | ------- |
| 4177 | bottom, top : (float, float) |
| 4178 | The new y-axis limits in data coordinates. |
| 4179 | |
| 4180 | See Also |
| 4181 | -------- |
| 4182 | get_ylim |
| 4183 | set_ybound, get_ybound |
| 4184 | invert_yaxis, yaxis_inverted |
| 4185 | |
| 4186 | Notes |
| 4187 | ----- |
| 4188 | The *bottom* value may be greater than the *top* value, in which |
| 4189 | case the y-axis values will decrease from *bottom* to *top*. |
| 4190 | |
| 4191 | Examples |
| 4192 | -------- |
| 4193 | >>> set_ylim(bottom, top) |
| 4194 | >>> set_ylim((bottom, top)) |
| 4195 | >>> bottom, top = set_ylim(bottom, top) |
| 4196 | |
| 4197 | One limit may be left unchanged. |
| 4198 | |
| 4199 | >>> set_ylim(top=top_lim) |
| 4200 |