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

[ENH]: Add an easy way to plot an infinite half space (e.g. with a HalfSpace patch) #28152

Open
carlosgmartin opened this issue Apr 29, 2024 · 1 comment

Comments

@carlosgmartin
Copy link

Problem

Using axhline, one can easily plot an infinite line:

def plot_line(ax, a, b, c, **kwargs):
    """Plots the solution to a x + b y = c."""
    ax.axline((c / a, 0), (0, c / b), **kwargs)

It would be nice to have an easy way to plot an infinite half space:

def plot_half_space(ax, a, b, c):
    """Plots the solution to a x + b y ≥ c."""
    ...

Proposed solution

This could potentially be done by adding a HalfSpace patch to matplotlib.patches.

For an analogue, see Mathematica's HalfSpace and HalfPlane.

@timhoffm
Copy link
Member

This would be a reasonable feature. PRs welcome.

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

No branches or pull requests

2 participants