(text_placeholders)
| 138 | |
| 139 | @image_comparison(['tickedstroke.png'], remove_text=True, style='mpl20') |
| 140 | def test_tickedstroke(text_placeholders): |
| 141 | fig, (ax1, ax2, ax3) = plt.subplots(1, 3, figsize=(12, 4)) |
| 142 | path = Path.unit_circle() |
| 143 | patch = patches.PathPatch(path, facecolor='none', lw=2, path_effects=[ |
| 144 | path_effects.withTickedStroke(angle=-90, spacing=10, |
| 145 | length=1)]) |
| 146 | |
| 147 | ax1.add_patch(patch) |
| 148 | ax1.axis('equal') |
| 149 | ax1.set_xlim(-2, 2) |
| 150 | ax1.set_ylim(-2, 2) |
| 151 | |
| 152 | ax2.plot([0, 1], [0, 1], label='C0', |
| 153 | path_effects=[path_effects.withTickedStroke(spacing=7, |
| 154 | angle=135)]) |
| 155 | nx = 101 |
| 156 | x = np.linspace(0.0, 1.0, nx) |
| 157 | y = 0.3 * np.sin(x * 8) + 0.4 |
| 158 | ax2.plot(x, y, label='C1', path_effects=[path_effects.withTickedStroke()]) |
| 159 | |
| 160 | ax2.legend() |
| 161 | |
| 162 | nx = 101 |
| 163 | ny = 105 |
| 164 | |
| 165 | # Set up survey vectors |
| 166 | xvec = np.linspace(0.001, 4.0, nx) |
| 167 | yvec = np.linspace(0.001, 4.0, ny) |
| 168 | |
| 169 | # Set up survey matrices. Design disk loading and gear ratio. |
| 170 | x1, x2 = np.meshgrid(xvec, yvec) |
| 171 | |
| 172 | # Evaluate some stuff to plot |
| 173 | g1 = -(3 * x1 + x2 - 5.5) |
| 174 | g2 = -(x1 + 2 * x2 - 4) |
| 175 | g3 = .8 + x1 ** -3 - x2 |
| 176 | |
| 177 | cg1 = ax3.contour(x1, x2, g1, [0], colors=('k',)) |
| 178 | cg1.set(path_effects=[path_effects.withTickedStroke(angle=135)]) |
| 179 | |
| 180 | cg2 = ax3.contour(x1, x2, g2, [0], colors=('r',)) |
| 181 | cg2.set(path_effects=[path_effects.withTickedStroke(angle=60, length=2)]) |
| 182 | |
| 183 | cg3 = ax3.contour(x1, x2, g3, [0], colors=('b',)) |
| 184 | cg3.set(path_effects=[path_effects.withTickedStroke(spacing=7)]) |
| 185 | |
| 186 | ax3.set_xlim(0, 4) |
| 187 | ax3.set_ylim(0, 4) |
| 188 | |
| 189 | |
| 190 | @image_comparison(['spaces_and_newlines.png'], remove_text=True, style='mpl20') |
nothing calls this directly
no test coverage detected
searching dependent graphs…