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

Plotting polytopes on same plot/ adding "_get_patch" as an import option #77

Open
victoraalves opened this issue Sep 18, 2022 · 0 comments
Assignees

Comments

@victoraalves
Copy link

victoraalves commented Sep 18, 2022

Hi,

I've been using polytope for a while now after using MPT for quite some time in MATLAB. Congrats on the nice work.

I've been trying to plot several polytopes in the same plot (some of these are within a Region and other from other polytopic operations) and have found the handy _get_patch inside polyope.py:

def _get_patch(poly1, **kwargs):

But this import is not available unless chagning init.py as:

from .polytope import (
    Polytope, Region,
    is_empty, is_fulldim, is_convex, is_adjacent, is_subset,
    reduce, separate, box2poly, grid_region,
    cheby_ball, bounding_box, envelope, extreme, qhull,
    is_inside, union, mldivide, intersect, volume, projection, **__get_patch_**

From this subtle change I am able to use _get_patch to reconstruct the plot in a new figure with all polytopes I want to show in a single one:
image

In the case above I am plotting a collection of convex polytopes that were inside a Region + Its respective bounding box, just for illustration purposes.

Am I overcomplicating things or should _get_patch be available for importing so it can be freely used?

Thanks.

@slivingston slivingston self-assigned this Aug 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants