| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -20,7 +20,7 @@ | |||
| 20 | 20 | # A low hump with a spike coming out. | |
| 21 | 21 | # Needs to have z/colour axis on a log scale so we see both hump and spike. | |
| 22 | 22 | # linear scale only shows the spike. | |
| 23 | - Z1 = np.exp(-(X)**2 - (Y)**2) | ||
| 23 | + Z1 = np.exp(-X**2 - Y**2) | ||
| 24 | 24 | Z2 = np.exp(-(X * 10)**2 - (Y * 10)**2) | |
| 25 | 25 | z = Z1 + 50 * Z2 | |
| 26 | 26 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -89,7 +89,7 @@ | |||
| 89 | 89 | # A low hump with a spike coming out. | |
| 90 | 90 | # Needs to have z/colour axis on a log scale so we see both hump and spike. | |
| 91 | 91 | # linear scale only shows the spike. | |
| 92 | - Z1 = np.exp(-(X)**2 - (Y)**2) | ||
| 92 | + Z1 = np.exp(-X**2 - Y**2) | ||
| 93 | 93 | Z2 = np.exp(-(X * 10)**2 - (Y * 10)**2) | |
| 94 | 94 | Z = Z1 + 50 * Z2 | |
| 95 | 95 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -72,7 +72,7 @@ def doall(): | |||
| 72 | 72 | plt.gca().set_yticklabels("", visible=False) | |
| 73 | 73 | ||
| 74 | 74 | # Gap between lines in axes coords | |
| 75 | - line_axesfrac = (1. / (n_lines)) | ||
| 75 | + line_axesfrac = 1 / n_lines | ||
| 76 | 76 | ||
| 77 | 77 | # Plotting header demonstration formula | |
| 78 | 78 | full_demo = mathext_demos[0] | |
@@ -82,7 +82,7 @@ def doall(): | |||
| 82 | 82 | ||
| 83 | 83 | # Plotting features demonstration formulae | |
| 84 | 84 | for i_line in range(1, n_lines): | |
| 85 | - baseline = 1 - (i_line) * line_axesfrac | ||
| 85 | + baseline = 1 - i_line * line_axesfrac | ||
| 86 | 86 | baseline_next = baseline - line_axesfrac | |
| 87 | 87 | title = mathtext_titles[i_line] + ":" | |
| 88 | 88 | fill_color = ['white', mpl_blue_rvb][i_line % 2] | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -21,7 +21,7 @@ | |||
| 21 | 21 | # z/colour axis on a log scale so we see both hump and spike. linear | |
| 22 | 22 | # scale only shows the spike. | |
| 23 | 23 | ||
| 24 | - Z1 = np.exp(-(X)**2 - (Y)**2) | ||
| 24 | + Z1 = np.exp(-X**2 - Y**2) | ||
| 25 | 25 | Z2 = np.exp(-(X * 10)**2 - (Y * 10)**2) | |
| 26 | 26 | Z = Z1 + 50 * Z2 | |
| 27 | 27 | ||
@@ -41,7 +41,7 @@ | |||
| 41 | 41 | # sine wave in Y. We can remove the power law using a PowerNorm. | |
| 42 | 42 | ||
| 43 | 43 | X, Y = np.mgrid[0:3:complex(0, N), 0:2:complex(0, N)] | |
| 44 | - Z1 = (1 + np.sin(Y * 10.)) * X**(2.) | ||
| 44 | + Z1 = (1 + np.sin(Y * 10.)) * X**2 | ||
| 45 | 45 | ||
| 46 | 46 | fig, ax = plt.subplots(2, 1) | |
| 47 | 47 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -18,7 +18,7 @@ | |||
| 18 | 18 | sine wave in Y. We can remove the power law using a PowerNorm. | |
| 19 | 19 | ''' | |
| 20 | 20 | X, Y = np.mgrid[0:3:complex(0, N), 0:2:complex(0, N)] | |
| 21 | - Z1 = (1 + np.sin(Y * 10.)) * X**(2.) | ||
| 21 | + Z1 = (1 + np.sin(Y * 10.)) * X**2 | ||
| 22 | 22 | ||
| 23 | 23 | fig, ax = plt.subplots(2, 1) | |
| 24 | 24 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -350,15 +350,15 @@ def _is_subplotspec_layoutbox(self): | |||
| 350 | 350 | Helper to check if this layoutbox is the layoutbox of a | |
| 351 | 351 | subplotspec | |
| 352 | 352 | ''' | |
| 353 | - name = (self.name).split('.')[-1] | ||
| 353 | + name = self.name.split('.')[-1] | ||
| 354 | 354 | return name[:2] == 'ss' | |
| 355 | 355 | ||
| 356 | 356 | def _is_gridspec_layoutbox(self): | |
| 357 | 357 | ''' | |
| 358 | 358 | Helper to check if this layoutbox is the layoutbox of a | |
| 359 | 359 | gridspec | |
| 360 | 360 | ''' | |
| 361 | - name = (self.name).split('.')[-1] | ||
| 361 | + name = self.name.split('.')[-1] | ||
| 362 | 362 | return name[:8] == 'gridspec' | |
| 363 | 363 | ||
| 364 | 364 | def find_child_subplots(self): | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -89,7 +89,7 @@ def correct_roundoff(x, dpi, n): | |||
| 89 | 89 | ||
| 90 | 90 | wnew = int(w * dpi / n) * n / dpi | |
| 91 | 91 | hnew = int(h * dpi / n) * n / dpi | |
| 92 | - return (correct_roundoff(wnew, dpi, n), correct_roundoff(hnew, dpi, n)) | ||
| 92 | + return correct_roundoff(wnew, dpi, n), correct_roundoff(hnew, dpi, n) | ||
| 93 | 93 | ||
| 94 | 94 | ||
| 95 | 95 | # A registry for available MovieWriter classes | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -200,7 +200,6 @@ def axes(self, new_axes): | |||
| 200 | 200 | self._axes = new_axes | |
| 201 | 201 | if new_axes is not None and new_axes is not self: | |
| 202 | 202 | self.stale_callback = _stale_axes_callback | |
| 203 | - return new_axes | ||
| 204 | 203 | ||
| 205 | 204 | @property | |
| 206 | 205 | def stale(self): | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -610,7 +610,7 @@ def invert(x): | |||
| 610 | 610 | secax.set_xlabel('Period [s]') | |
| 611 | 611 | plt.show() | |
| 612 | 612 | """ | |
| 613 | - if (location in ['top', 'bottom'] or isinstance(location, Number)): | ||
| 613 | + if location in ['top', 'bottom'] or isinstance(location, Number): | ||
| 614 | 614 | secondary_ax = SecondaryAxis(self, 'x', location, functions, | |
| 615 | 615 | **kwargs) | |
| 616 | 616 | self.add_child_axes(secondary_ax) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2523,7 +2523,7 @@ def tol(x): return 1e-5 * abs(x) + 1e-8 | |||
| 2523 | 2523 | 'minposy', self.yaxis, self._ymargin, y_stickies, self.set_ybound) | |
| 2524 | 2524 | ||
| 2525 | 2525 | def _get_axis_list(self): | |
| 2526 | - return (self.xaxis, self.yaxis) | ||
| 2526 | + return self.xaxis, self.yaxis | ||
| 2527 | 2527 | ||
| 2528 | 2528 | def _get_axis_map(self): | |
| 2529 | 2529 | """ | |
@@ -3954,7 +3954,7 @@ def _get_view(self): | |||
| 3954 | 3954 | """ | |
| 3955 | 3955 | xmin, xmax = self.get_xlim() | |
| 3956 | 3956 | ymin, ymax = self.get_ylim() | |
| 3957 | - return (xmin, xmax, ymin, ymax) | ||
| 3957 | + return xmin, xmax, ymin, ymax | ||
| 3958 | 3958 | ||
| 3959 | 3959 | def _set_view(self, view): | |
| 3960 | 3960 | """ | |
| Back | FazBrowse Home | New Git URL |
0 commit comments