Skip to content

Conversation

lilisako
Copy link
Contributor

Original Issue

Behavior

import numpy as np
import pandas as pd
import seaborn as sns
from matplotlib import pyplot as plt

np.random.seed(12345)
df = pd.DataFrame({'x': np.random.rand(60),
                   'y': np.random.rand(60),
                   'sz': np.append(np.random.randint(0, 2500, 30), np.random.randint(2500, 6000, 30))})

fig, axs = plt.subplots(ncols=2, figsize=(10, 4), sharex=True, sharey=True)
sns.scatterplot(data=df[:30], x='x', y='y', size='sz', sizes=(0.01, 200), size_norm=(0, 6000), ax=axs[0])
sns.scatterplot(data=df, x='x', y='y', size='sz', sizes=(0.01, 200), size_norm=(0, 6000), ax=axs[1])
  • Before
    スクリーンショット 2021-05-10 18 33 06

  • After
    スクリーンショット 2021-05-10 18 31 40

@codecov
Copy link

codecov bot commented May 10, 2021

Codecov Report

Merging #2579 (3dab64c) into master (4f79753) will increase coverage by 0.19%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2579      +/-   ##
==========================================
+ Coverage   97.27%   97.46%   +0.19%     
==========================================
  Files          17       17              
  Lines        6340     6350      +10     
==========================================
+ Hits         6167     6189      +22     
+ Misses        173      161      -12     
Impacted Files Coverage Δ
seaborn/rcmod.py 100.00% <ø> (ø)
seaborn/_core.py 98.61% <100.00%> (-0.01%) ⬇️
seaborn/categorical.py 98.53% <100.00%> (+0.14%) ⬆️
seaborn/matrix.py 95.87% <100.00%> (+<0.01%) ⬆️
seaborn/regression.py 97.88% <100.00%> (+0.71%) ⬆️
seaborn/distributions.py 96.37% <0.00%> (+0.32%) ⬆️
seaborn/_docstrings.py 100.00% <0.00%> (+12.50%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 536fa2d...3dab64c. Read the comment docs.

@mwaskom
Copy link
Owner

mwaskom commented May 10, 2021

Thanks for tracking down the root cause here! I pulled your commits into #2580 and built on them a little bit to add a test for the original problem and to reorganize things a bit so that the _default_size_range attribute was not accessed in a new place (I would like to clean up how that works because it is a bit of a mess at the moment).

PS its' generally cleaner to create a new branch before making edits rather than adding commits onto the master branch of your fork.

Thanks again!

@mwaskom mwaskom closed this May 10, 2021
@lilisako
Copy link
Contributor Author

Thanks for the review & merging my commits! I'll make sure to create a new branch next time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants