Skip to content

Commit

Permalink
Fix typing issue and elaborate some comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Waskom committed Aug 29, 2021
1 parent 1b1929b commit 09f2ad6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
12 changes: 8 additions & 4 deletions seaborn/_core/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ def _setup_figure(self, pyplot: bool = False) -> None:
)

# --- Figure initialization
figure_kws = {"figsize": getattr(self, "_figsize", None)} # TODO
figure_kws = {"figsize": getattr(self, "_figsize", None)} # TODO fix this hack
self._figure = subplots.init_figure(pyplot, figure_kws)

# --- Assignment of scales
Expand Down Expand Up @@ -491,8 +491,8 @@ def _setup_figure(self, pyplot: bool = False) -> None:
ax.set(**{
# TODO Should we make it possible to use only one x/y label for
# all rows/columns in a faceted plot? Maybe using sub{axis}label,
# although the alignments of the labels from taht method leaves
# something to be desired.
# although the alignments of the labels from that method leaves
# something to be desired (in terms of how it defines 'centered').
f"{axis}label": setup_data.names.get(axis_key)
})

Expand Down Expand Up @@ -794,7 +794,11 @@ def generate_splits() -> Generator:

def _repr_png_(self) -> bytes:

# TODO better to do this through a Jupyter hook?
# TODO better to do this through a Jupyter hook? e.g.
# ipy = IPython.core.formatters.get_ipython()
# fmt = ipy.display_formatter.formatters["text/html"]
# fmt.for_type(Plot, ...)

# TODO Would like to allow for svg too ... how to configure?

# TODO perhaps have self.show() flip a switch to disable this, so that
Expand Down
1 change: 1 addition & 0 deletions seaborn/_core/subplots.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ def init_figure(self, pyplot: bool, figure_kws: dict | None = None) -> Figure:
# Get i, j coordinates for each Axes object
# Note that i, j are with respect to faceting/pairing,
# not the subplot grid itself, (which only matters in the case of wrapping).
iter_axs: np.ndenumerate | zip
if not self.pair_spec.get("cartesian", True):
indices = np.arange(self.n_subplots)
iter_axs = zip(zip(indices, indices), axs.flat)
Expand Down

0 comments on commit 09f2ad6

Please sign in to comment.