Set the Axes box aspect, i.e. the ratio of height to width. This defines the aspect of the Axes in figure space and is not to be confused with the data aspect (see `~.Axes.set_aspect`). Parameters ---------- aspect : float or None Change
(self, aspect=None)
| 1853 | return self._box_aspect |
| 1854 | |
| 1855 | def set_box_aspect(self, aspect=None): |
| 1856 | """ |
| 1857 | Set the Axes box aspect, i.e. the ratio of height to width. |
| 1858 | |
| 1859 | This defines the aspect of the Axes in figure space and is not to be |
| 1860 | confused with the data aspect (see `~.Axes.set_aspect`). |
| 1861 | |
| 1862 | Parameters |
| 1863 | ---------- |
| 1864 | aspect : float or None |
| 1865 | Changes the physical dimensions of the Axes, such that the ratio |
| 1866 | of the Axes height to the Axes width in physical units is equal to |
| 1867 | *aspect*. Defining a box aspect will change the *adjustable* |
| 1868 | property to 'datalim' (see `~.Axes.set_adjustable`). |
| 1869 | |
| 1870 | *None* will disable a fixed box aspect so that height and width |
| 1871 | of the Axes are chosen independently. |
| 1872 | |
| 1873 | See Also |
| 1874 | -------- |
| 1875 | matplotlib.axes.Axes.set_aspect |
| 1876 | for a description of aspect handling. |
| 1877 | """ |
| 1878 | axs = {*self._twinned_axes.get_siblings(self), |
| 1879 | *self._twinned_axes.get_siblings(self)} |
| 1880 | |
| 1881 | if aspect is not None: |
| 1882 | aspect = float(aspect) |
| 1883 | # when box_aspect is set to other than ´None`, |
| 1884 | # adjustable must be "datalim" |
| 1885 | for ax in axs: |
| 1886 | ax.set_adjustable("datalim") |
| 1887 | |
| 1888 | for ax in axs: |
| 1889 | ax._box_aspect = aspect |
| 1890 | ax.stale = True |
| 1891 | |
| 1892 | def get_anchor(self): |
| 1893 | """ |