| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -354,9 +354,7 @@ def get_gridlines(self, which="major", axis="both"): | |||
| 354 | 354 | locs.extend(self.axes.xaxis.major.locator()) | |
| 355 | 355 | if which in ("both", "minor"): | |
| 356 | 356 | locs.extend(self.axes.xaxis.minor.locator()) | |
| 357 | - | ||
| 358 | - for x in locs: | ||
| 359 | - gridlines.append([[x, x], [y1, y2]]) | ||
| 357 | + gridlines.extend([[x, x], [y1, y2]] for x in locs) | ||
| 360 | 358 | ||
| 361 | 359 | if axis in ("both", "y"): | |
| 362 | 360 | x1, x2 = self.axes.get_xlim() | |
@@ -365,9 +363,7 @@ def get_gridlines(self, which="major", axis="both"): | |||
| 365 | 363 | locs.extend(self.axes.yaxis.major.locator()) | |
| 366 | 364 | if self.axes.yaxis._minor_tick_kw["gridOn"]: | |
| 367 | 365 | locs.extend(self.axes.yaxis.minor.locator()) | |
| 368 | - | ||
| 369 | - for y in locs: | ||
| 370 | - gridlines.append([[x1, x2], [y, y]]) | ||
| 366 | + gridlines.extend([[x1, x2], [y, y]] for y in locs) | ||
| 371 | 367 | ||
| 372 | 368 | return gridlines | |
| 373 | 369 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -34,15 +34,16 @@ def _find_line_box_crossings(xys, bbox): | |||
| 34 | 34 | umin, vmin = bbox.min[sl] | |
| 35 | 35 | umax, vmax = bbox.max[sl] | |
| 36 | 36 | for u0, inside in [(umin, us > umin), (umax, us < umax)]: | |
| 37 | - crossings.append([]) | ||
| 37 | + cross = [] | ||
| 38 | 38 | idxs, = (inside[:-1] ^ inside[1:]).nonzero() | |
| 39 | 39 | for idx in idxs: | |
| 40 | 40 | v = vs[idx] + (u0 - us[idx]) * dvs[idx] / dus[idx] | |
| 41 | 41 | if not vmin <= v <= vmax: | |
| 42 | 42 | continue | |
| 43 | 43 | crossing = (u0, v)[sl] | |
| 44 | 44 | theta = np.degrees(np.arctan2(*dxys[idx][::-1])) | |
| 45 | - crossings[-1].append((crossing, theta)) | ||
| 45 | + cross.append((crossing, theta)) | ||
| 46 | + crossings.append(cross) | ||
| 46 | 47 | return crossings | |
| 47 | 48 | ||
| 48 | 49 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments