|
1 | 1 | """ |
2 | | -======================================================== |
3 | | -Demonstration of advanced quiver and quiverkey functions |
4 | | -======================================================== |
| 2 | +======================================= |
| 3 | +Advanced quiver and quiverkey functions |
| 4 | +======================================= |
5 | 5 |
|
6 | 6 | Demonstrates some more advanced options for `~.axes.Axes.quiver`. For a simple |
7 | 7 | example refer to :doc:`/gallery/images_contours_and_fields/quiver_simple_demo`. |
8 | 8 |
|
9 | | -Known problem: the plot autoscaling does not take into account the arrows, so |
10 | | -those on the boundaries are often out of the picture. This is *not* an easy |
11 | | -problem to solve in a perfectly general way. The workaround is to manually |
12 | | -expand the Axes objects. |
| 9 | +Note: The plot autoscaling does not take into account the arrows, so |
| 10 | +those on the boundaries may reach out of the picture. This is not an easy |
| 11 | +problem to solve in a perfectly general way. The recommended workaround is to |
| 12 | +manually set the Axes limits in such a case. |
13 | 13 | """ |
| 14 | + |
14 | 15 | import matplotlib.pyplot as plt |
15 | 16 | import numpy as np |
16 | 17 |
|
|
38 | 39 |
|
39 | 40 | ############################################################################### |
40 | 41 |
|
| 42 | +# sphinx_gallery_thumbnail_number = 3 |
| 43 | + |
41 | 44 | fig3, ax3 = plt.subplots() |
42 | 45 | ax3.set_title("pivot='tip'; scales with x view") |
43 | 46 | M = np.hypot(U, V) |
44 | 47 | Q = ax3.quiver(X, Y, U, V, M, units='x', pivot='tip', width=0.022, |
45 | 48 | scale=1 / 0.15) |
46 | 49 | qk = ax3.quiverkey(Q, 0.9, 0.9, 1, r'$1 \frac{m}{s}$', labelpos='E', |
47 | 50 | coordinates='figure') |
48 | | -ax3.scatter(X, Y, color='k', s=5) |
| 51 | +ax3.scatter(X, Y, color='0.5', s=1) |
49 | 52 |
|
50 | 53 | plt.show() |
51 | 54 |
|
|
0 commit comments