Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When using the associations in a notebook and plot=False, the plot gets closed (i.e. removed) without ever being shown. #167

Closed
Baukebrenninkmeijer opened this issue Dec 6, 2024 · 2 comments · Fixed by #169
Labels
bug Something isn't working

Comments

@Baukebrenninkmeijer
Copy link
Contributor

Hi, thank you for your work on this library.

Version check:

sys.version_info(major=3, minor=12, micro=5, releaselevel='final', serial=0)
0.7.7

However, this problem is still present in 0.7.8.

Describe the bug:

When calling nominal.associations with plot=False when using a notebook and passing an axis, the plot gets closed. What I expect to happen here is that the plot is not closed, the chart is added to the axis and then I can control what happens to it afterwards. Currently, the plots gets closed before that is possible.

Code to reproduce:

from dython.nominal import associations
df = pd.read_csv('fake_test_sample.csv')
fig, ax = plt.subplots(1, 2, figsize=(20, 8))

  fake_corr = associations(
      fake,
      nominal_columns=fake.select_dtypes(['object', 'category']),
      plot=False,
      nom_nom_assoc='theil',
      mark_columns=True,
      annot=annot,
      ax=ax[1],
      cmap=cmap,
  )['corr']
plt.show(). # This is currently empty, rather than having one plot on it.

Error message:

Error message:

<Figure size 640x480 with 0 Axes>

Input data:

real_test_sample.csv
fake_test_sample.csv

Though this issue will persist regardless of what data is used.

@shakedzy
Copy link
Owner

shakedzy commented Dec 6, 2024

Seems to be an issue with how #147 was handled.. I'll have to come up with something else

shakedzy added a commit that referenced this issue Jan 6, 2025
shakedzy added a commit that referenced this issue Jan 6, 2025
…-in-a-notebook-and-plot=false-the-plot-gets-closed-ie-removed-without-ever-being-shown

fix for #167 #168
@shakedzy shakedzy linked a pull request Jan 6, 2025 that will close this issue
@shakedzy
Copy link
Owner

shakedzy commented Jan 6, 2025

Fix available on the new 0.7.9

@shakedzy shakedzy closed this as completed Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants