question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Feature request] Take in an `ax` object like seaborn, networkx, and other matplotlib wrappers

See original GitHub issue
from supervenn import supervenn
sets = [{1, 2, 3, 4}, {3, 4, 5}, {1, 6, 7, 8}]
with plt.style.context("seaborn-white"):
    fig, ax = plt.subplots()
    supervenn(sets, side_plots=False, ax=ax)
# ---------------------------------------------------------------------------
# TypeError                                 Traceback (most recent call last)
# <ipython-input-61-9074a6cee262> in <module>
#       3 with plt.style.context("seaborn-white"):
#       4     fig, ax = plt.subplots()
# ----> 5     supervenn(sets, side_plots=False, ax=ax)

# ~/anaconda3/envs/soothsayer5_env/lib/python3.8/site-packages/supervenn/_plots.py in supervenn(sets, set_annotations, figsize, side_plots, chunks_ordering, sets_ordering, reverse_chunks_order, reverse_sets_order, max_bruteforce_size, seeds, noise_prob, side_plot_width, min_width_for_annotation, widths_minmax_ratio, side_plot_color, dpi, **kw)
#     323         effective_min_width_for_annotation = min_width_for_annotation
#     324 
# --> 325     plot_binary_array(
#     326         arr=composition_array,
#     327         row_annotations=set_annotations,

# TypeError: plot_binary_array() got multiple values for keyword argument 'ax'

Right now it’s not practical to use these in a production setting because we can’t integrate these into existing figures.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:17 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
gecko984commented, Sep 6, 2020

@jolespin hey Josh, I’ve added a returned object in 0.3.0, which gives access to chunks’ contents and to axes of the plot. The new ersion is already on PyPi https://github.com/gecko984/supervenn#inspect-the-chunks-contents https://github.com/gecko984/supervenn#access-the-figure-and-axes-objects-of-the-plot

1reaction
gecko984commented, Aug 3, 2020

Hi Josh, thanks for your input. This is definitely a good idea. I used to think that it was imposiible to split an existing axis into four uneven-sized axes, which I need for the “side plots”. But after reading your message I dug deeper and now I think I figured out how to do it. So probably will implement it in the next few days, stay tuned.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Which library should I use for my Python dashboard?
The main Python library for networks is NetworkX. By default, NetworkX is using Matplotlib as a backend for drawing².
Read more >
Can seaborn and networkx be integrated into GUI via ...
My best idea is that these functions are designing their own matplotlib figure (or subplot, not sure), and this figure cannot be supplied...
Read more >
An introduction to seaborn — seaborn 0.12.1 documentation
Seaborn is a library for making statistical graphics in Python. It builds on top of matplotlib and integrates closely with pandas data structures....
Read more >
Visualization with Matplotlib | Python Data Science Handbook
Matplotlib is a multi-platform data visualization library built on NumPy arrays, and designed to work with the broader SciPy stack. It was conceived...
Read more >
Matplotlib.pdf
matplotlib is a library for making 2D plots of arrays in Python. Although it has its origins in emulating the. MATLAB® 1 graphics...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found