Cleanup plot types#20509
Conversation
| Y = [[1.5, 3, 2]] | ||
| U = -np.ones((1, 3)) * 0 | ||
| V = -np.ones((1, 3)) * np.linspace(50, 100, 3) | ||
| U = np.zeros_like(X) |
There was a problem hiding this comment.
This was made lowercase everywhere else. Why uppercase here?
There was a problem hiding this comment.
I mostly follow the capitalization in the signature of the respective plot function, some of which are lowercase, some are uppercase.
There's a loose convention that 1D arrays have regular lowercase names and 2D arrays from np.meshgrid() have uppercase names (e.g. X, Y = np.meshgrid(x, y)). I suspect that the signature roughly follows this pattern: If we expect 2D input, we use an uppercase parameter name. For barbs this is a bit ambiguous as parameters can be 1D or 2D, so I followed the signature style.
| y = 4 + np.random.normal(0, 2, len(x)) | ||
| # size and color: | ||
| S = np.random.uniform(15, 80, len(X)) | ||
| S = np.random.uniform(15, 80, len(x)) |
There was a problem hiding this comment.
Why is this not lowercased? Or maybe rename to sizes.
| X = [[2, 4, 6]] | ||
| Y = [[1.5, 3, 2]] | ||
| U = -np.ones((1, 3)) * 0 | ||
| V = -np.ones((1, 3)) * np.linspace(50, 100, 3) | ||
| U = np.zeros_like(X) | ||
| V = -np.ones_like(X) * np.linspace(50, 100, 3) |
|
I'm not sure that message is what you meant to put in that last commit. |
3d81ba0 to
6b84212
Compare
|
Squashed. |
PR Summary
Some simplifications and more standard code style.