-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Simplify some examples. #8741
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
Simplify some examples. #8741
Conversation
plt.axis([-3, 3, -3, 3]) | ||
plt.plot([0, 4], [0, 4]) | ||
plt.title('still equal after adding line', fontsize=10) | ||
plt.gca().set_aspect('equal', 'box') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could also do with a plt.subplots()
and removing all the plt.subplot
calls?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
|
||
vax.plot(t, s + nse, '^') | ||
vax.vlines(t, [0], s) | ||
vax.vlines([1, 2], 0, 1, transform=btf(vax.transData, vax.transAxes), colors='r') | ||
vax.vlines([1, 2], 0, 1, transform=vax.get_xaxis_transform(), colors='r') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like vax.get_xaxis_transform()
would benefit from an explanatory comment of why it's in this code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you get to write it then :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no idea why it's there, hence why I'd like to see that comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
""" | ||
|
||
|
||
import matplotlib.pyplot as plt | ||
import numpy as np | ||
|
||
# Plot circle or radius 3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
type: circle of radius 3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
`vline_hline_demo`: Simpler data generation; use `subplots`; no need to explicitly construct a blended transform. `equal_aspect_ratio`: Removed; forcing equal aspect ratio when the x and y axes have different units is pretty silly anyways, plus it does not belong in `subplots_axes_and_figures`. Instead, tweaked the last example of `axis_equal_demo` to demonstrate some more related features.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
vline_hline_demo
: Simpler data generation; usesubplots
; no need toexplicitly construct a blended transform.
equal_aspect_ratio
: Removed; forcing equal aspect ratio when the x andy axes have different units is pretty silly anyways, plus it does not
belong in
subplots_axes_and_figures
. Instead, tweaked the lastexample of
axis_equal_demo
to demonstrate some more related features.PR Summary
PR Checklist