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 - Improve the custom labelling capability #21300

Open
Davide-sd opened this issue Apr 12, 2021 · 0 comments
Open

Plotting - Improve the custom labelling capability #21300

Davide-sd opened this issue Apr 12, 2021 · 0 comments
Labels

Comments

@Davide-sd
Copy link
Contributor

Whenever two expressions are being plotted with the same plot command, a string representation of the expression is automatically generated:

expr1 = (cos(x) + sin(x * pi / 4)) * exp(-x**2 / 20)
expr2 = cos(x)
p = plot(expr1, expr2, legend=True)

For long expression, this is quite inconvenient as the legend will eventually cover the plot. At the moment, it is possible to change the label with the following:

p._series[0].label = "a"
p._series[1].label = "b"
p.show()

However, this is unnecessary complicated as it requires two steps/multiple commands to get a single plot. Ideally, something similar to the following would be much appreciated:

plot((expr1, "a"), (expr2, "b"), legend=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants