Skip to content

Commit

Permalink
Initialize default semantics with relevant variable names
Browse files Browse the repository at this point in the history
  • Loading branch information
mwaskom committed Oct 16, 2021
1 parent c7777d9 commit 42020a0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ htmlcov/
.vscode/
.pytest_cache/
notes/
notebooks/
6 changes: 3 additions & 3 deletions seaborn/_core/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@

SEMANTICS = { # TODO should this be pluggable?
"color": ColorSemantic(),
"facecolor": ColorSemantic(),
"edgecolor": ColorSemantic(),
"facecolor": ColorSemantic(variable="facecolor"),
"edgecolor": ColorSemantic(variable="edgecolor"),
"marker": MarkerSemantic(),
"linestyle": LineStyleSemantic(),
"fill": BooleanSemantic(),
"fill": BooleanSemantic(variable="fill"),
"linewidth": LineWidthSemantic(),
}

Expand Down
7 changes: 7 additions & 0 deletions seaborn/_core/scales.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,13 @@ def __init__(
self.type_declared = True

if norm is None:
# TODO customize norm_from_scale to return "datetime scale" etc.?
# TODO also we could use a pre-norm function for have a map_pointsize
# that has the option of squaring the sizes before normalizing.
# From the scale perspective it would be a general pre-norm function,
# but then map_pointsize could have a special param.
# TODO what else is this useful for? Maybe outlier removal?
# Maybe log norming for color?
norm = norm_from_scale(scale, norm)
self.norm = norm

Expand Down

0 comments on commit 42020a0

Please sign in to comment.