Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 70a296d

Browse filesBrowse files
committed
isort examples
1 parent a8d1469 commit 70a296d
Copy full SHA for 70a296d

File tree

Expand file treeCollapse file tree

475 files changed

+906
-610
lines changed
Filter options

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Dismiss banner
Expand file treeCollapse file tree

475 files changed

+906
-610
lines changed

‎.pre-commit-config.yaml

Copy file name to clipboardExpand all lines: .pre-commit-config.yaml
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,4 @@ repos:
4747
- id: isort
4848
name: isort (python)
4949
args: ['--force-sort-within-sections', 'true']
50-
files: ^tutorials/
50+
files: ^tutorials/|^examples/

‎examples/animation/animate_decay.py

Copy file name to clipboardExpand all lines: examples/animation/animate_decay.py
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@
1414
import itertools
1515

1616
import numpy as np
17-
import matplotlib.pyplot as plt
17+
1818
import matplotlib.animation as animation
19+
import matplotlib.pyplot as plt
1920

2021

2122
def data_gen():

‎examples/animation/animated_histogram.py

Copy file name to clipboardExpand all lines: examples/animation/animated_histogram.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99

1010
import numpy as np
1111

12-
import matplotlib.pyplot as plt
1312
import matplotlib.animation as animation
13+
import matplotlib.pyplot as plt
1414

1515
# Fixing random state for reproducibility
1616
np.random.seed(19680801)

‎examples/animation/animation_demo.py

Copy file name to clipboardExpand all lines: examples/animation/animation_demo.py
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@
1414
Output generate via `matplotlib.animation.Animation.to_jshtml`.
1515
"""
1616

17-
import matplotlib.pyplot as plt
1817
import numpy as np
1918

19+
import matplotlib.pyplot as plt
20+
2021
np.random.seed(19680801)
2122
data = np.random.random((50, 50, 50))
2223

‎examples/animation/bayes_update.py

Copy file name to clipboardExpand all lines: examples/animation/bayes_update.py
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@
1414
import math
1515

1616
import numpy as np
17-
import matplotlib.pyplot as plt
17+
1818
from matplotlib.animation import FuncAnimation
19+
import matplotlib.pyplot as plt
1920

2021

2122
def beta_pdf(x, a, b):

‎examples/animation/double_pendulum.py

Copy file name to clipboardExpand all lines: examples/animation/double_pendulum.py
+5-3Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@
1111
Output generate via `matplotlib.animation.Animation.to_jshtml`.
1212
"""
1313

14-
from numpy import sin, cos
14+
from collections import deque
15+
1516
import numpy as np
16-
import matplotlib.pyplot as plt
17+
from numpy import cos, sin
18+
1719
import matplotlib.animation as animation
18-
from collections import deque
20+
import matplotlib.pyplot as plt
1921

2022
G = 9.8 # acceleration due to gravity, in m/s^2
2123
L1 = 1.0 # length of pendulum 1 in m

‎examples/animation/dynamic_image.py

Copy file name to clipboardExpand all lines: examples/animation/dynamic_image.py
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@
77
"""
88

99
import numpy as np
10-
import matplotlib.pyplot as plt
10+
1111
import matplotlib.animation as animation
12+
import matplotlib.pyplot as plt
1213

1314
fig, ax = plt.subplots()
1415

‎examples/animation/frame_grabbing_sgskip.py

Copy file name to clipboardExpand all lines: examples/animation/frame_grabbing_sgskip.py
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@
1111
"""
1212

1313
import numpy as np
14+
1415
import matplotlib
16+
1517
matplotlib.use("Agg")
16-
import matplotlib.pyplot as plt
1718
from matplotlib.animation import FFMpegWriter
19+
import matplotlib.pyplot as plt
1820

1921
# Fixing random state for reproducibility
2022
np.random.seed(19680801)

‎examples/animation/multiple_axes.py

Copy file name to clipboardExpand all lines: examples/animation/multiple_axes.py
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@
1212
"""
1313

1414
import numpy as np
15-
import matplotlib.pyplot as plt
15+
1616
import matplotlib.animation as animation
1717
from matplotlib.patches import ConnectionPatch
18+
import matplotlib.pyplot as plt
1819

1920
fig, (axl, axr) = plt.subplots(
2021
ncols=2,

‎examples/animation/pause_resume.py

Copy file name to clipboardExpand all lines: examples/animation/pause_resume.py
+3-2Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,11 @@
1919
Output generate via `matplotlib.animation.Animation.to_jshtml`.
2020
"""
2121

22-
import matplotlib.pyplot as plt
23-
import matplotlib.animation as animation
2422
import numpy as np
2523

24+
import matplotlib.animation as animation
25+
import matplotlib.pyplot as plt
26+
2627

2728
class PauseAnimation:
2829
def __init__(self):

‎examples/animation/rain.py

Copy file name to clipboardExpand all lines: examples/animation/rain.py
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@
1212
"""
1313

1414
import numpy as np
15-
import matplotlib.pyplot as plt
15+
1616
from matplotlib.animation import FuncAnimation
17+
import matplotlib.pyplot as plt
1718

1819
# Fixing random state for reproducibility
1920
np.random.seed(19680801)

‎examples/animation/random_walk.py

Copy file name to clipboardExpand all lines: examples/animation/random_walk.py
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@
77
"""
88

99
import numpy as np
10-
import matplotlib.pyplot as plt
10+
1111
import matplotlib.animation as animation
12+
import matplotlib.pyplot as plt
1213

1314
# Fixing random state for reproducibility
1415
np.random.seed(19680801)

‎examples/animation/simple_anim.py

Copy file name to clipboardExpand all lines: examples/animation/simple_anim.py
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@
77
"""
88

99
import numpy as np
10-
import matplotlib.pyplot as plt
10+
1111
import matplotlib.animation as animation
12+
import matplotlib.pyplot as plt
1213

1314
fig, ax = plt.subplots()
1415

‎examples/animation/simple_scatter.py

Copy file name to clipboardExpand all lines: examples/animation/simple_scatter.py
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@
66
Output generate via `matplotlib.animation.Animation.to_jshtml`.
77
"""
88
import numpy as np
9-
import matplotlib.pyplot as plt
9+
1010
import matplotlib.animation as animation
11+
import matplotlib.pyplot as plt
1112

1213
fig, ax = plt.subplots()
1314
ax.set_xlim([0, 10])

‎examples/animation/strip_chart.py

Copy file name to clipboardExpand all lines: examples/animation/strip_chart.py
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@
99
"""
1010

1111
import numpy as np
12+
13+
import matplotlib.animation as animation
1214
from matplotlib.lines import Line2D
1315
import matplotlib.pyplot as plt
14-
import matplotlib.animation as animation
1516

1617

1718
class Scope:

‎examples/animation/unchained.py

Copy file name to clipboardExpand all lines: examples/animation/unchained.py
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@
1212
"""
1313

1414
import numpy as np
15-
import matplotlib.pyplot as plt
15+
1616
import matplotlib.animation as animation
17+
import matplotlib.pyplot as plt
1718

1819
# Fixing random state for reproducibility
1920
np.random.seed(19680801)

‎examples/axes_grid1/demo_anchored_direction_arrows.py

Copy file name to clipboardExpand all lines: examples/axes_grid1/demo_anchored_direction_arrows.py
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
========================
55
66
"""
7-
import matplotlib.pyplot as plt
8-
import numpy as np
97
from mpl_toolkits.axes_grid1.anchored_artists import AnchoredDirectionArrows
10-
import matplotlib.font_manager as fm
8+
import numpy as np
119

10+
import matplotlib.font_manager as fm
11+
import matplotlib.pyplot as plt
1212

1313
# Fixing random state for reproducibility
1414
np.random.seed(19680801)

‎examples/axes_grid1/demo_axes_divider.py

Copy file name to clipboardExpand all lines: examples/axes_grid1/demo_axes_divider.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def demo_simple_image(ax):
2727

2828
def demo_locatable_axes_hard(fig):
2929

30-
from mpl_toolkits.axes_grid1 import SubplotDivider, Size
30+
from mpl_toolkits.axes_grid1 import Size, SubplotDivider
3131
from mpl_toolkits.axes_grid1.mpl_axes import Axes
3232

3333
divider = SubplotDivider(fig, 2, 2, 2, aspect=True)

‎examples/axes_grid1/demo_axes_grid.py

Copy file name to clipboardExpand all lines: examples/axes_grid1/demo_axes_grid.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
Grid of 2x2 images with a single colorbar or with one colorbar per axes.
77
"""
88

9-
from matplotlib import cbook
10-
import matplotlib.pyplot as plt
119
from mpl_toolkits.axes_grid1 import ImageGrid
1210

11+
from matplotlib import cbook
12+
import matplotlib.pyplot as plt
1313

1414
Z = cbook.get_sample_data( # (15, 15) array
1515
"axes_grid/bivariate_normal.npy", np_load=True)

‎examples/axes_grid1/demo_axes_grid2.py

Copy file name to clipboardExpand all lines: examples/axes_grid1/demo_axes_grid2.py
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@
66
Grid of images with shared xaxis and yaxis.
77
"""
88

9+
from mpl_toolkits.axes_grid1 import ImageGrid
910
import numpy as np
11+
1012
from matplotlib import cbook
1113
import matplotlib.colors
1214
import matplotlib.pyplot as plt
13-
from mpl_toolkits.axes_grid1 import ImageGrid
1415

1516

1617
def add_inner_title(ax, title, loc, **kwargs):

‎examples/axes_grid1/demo_axes_hbox_divider.py

Copy file name to clipboardExpand all lines: examples/axes_grid1/demo_axes_hbox_divider.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010
1111
"""
1212

13-
import numpy as np
14-
import matplotlib.pyplot as plt
1513
from mpl_toolkits.axes_grid1.axes_divider import HBoxDivider, VBoxDivider
1614
import mpl_toolkits.axes_grid1.axes_size as Size
15+
import numpy as np
1716

17+
import matplotlib.pyplot as plt
1818

1919
arr1 = np.arange(20).reshape((4, 5))
2020
arr2 = np.arange(20).reshape((5, 4))

‎examples/axes_grid1/demo_axes_rgb.py

Copy file name to clipboardExpand all lines: examples/axes_grid1/demo_axes_rgb.py
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@
88
channels.
99
"""
1010

11+
from mpl_toolkits.axes_grid1.axes_rgb import RGBAxes, make_rgb_axes
1112
import numpy as np
13+
1214
from matplotlib import cbook
1315
import matplotlib.pyplot as plt
14-
from mpl_toolkits.axes_grid1.axes_rgb import make_rgb_axes, RGBAxes
1516

1617

1718
def get_rgb():

‎examples/axes_grid1/demo_colorbar_of_inset_axes.py

Copy file name to clipboardExpand all lines: examples/axes_grid1/demo_colorbar_of_inset_axes.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
===============================
55
"""
66

7-
from matplotlib import cbook
8-
import matplotlib.pyplot as plt
97
from mpl_toolkits.axes_grid1.inset_locator import inset_axes, zoomed_inset_axes
108

9+
from matplotlib import cbook
10+
import matplotlib.pyplot as plt
1111

1212
fig, ax = plt.subplots(figsize=[5, 4])
1313
ax.set(aspect=1, xlim=(-15, 15), ylim=(-20, 5))

‎examples/axes_grid1/demo_colorbar_with_axes_divider.py

Copy file name to clipboardExpand all lines: examples/axes_grid1/demo_colorbar_with_axes_divider.py
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@
1010
uses `.append_axes` to add colorbars next to axes.
1111
"""
1212

13-
import matplotlib.pyplot as plt
1413
from mpl_toolkits.axes_grid1.axes_divider import make_axes_locatable
1514

15+
import matplotlib.pyplot as plt
16+
1617
fig, (ax1, ax2) = plt.subplots(1, 2)
1718
fig.subplots_adjust(wspace=0.5)
1819

‎examples/axes_grid1/demo_colorbar_with_inset_locator.py

Copy file name to clipboardExpand all lines: examples/axes_grid1/demo_colorbar_with_inset_locator.py
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@
1212
work in the same way, and are also demonstrated here.
1313
"""
1414

15-
import matplotlib.pyplot as plt
1615
from mpl_toolkits.axes_grid1.inset_locator import inset_axes
1716

17+
import matplotlib.pyplot as plt
18+
1819
fig, (ax1, ax2) = plt.subplots(1, 2, figsize=[6, 3])
1920

2021
im1 = ax1.imshow([[1, 2], [2, 3]])

‎examples/axes_grid1/demo_edge_colorbar.py

Copy file name to clipboardExpand all lines: examples/axes_grid1/demo_edge_colorbar.py
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@
77
of an image grid.
88
"""
99

10+
from mpl_toolkits.axes_grid1 import AxesGrid
11+
1012
from matplotlib import cbook
1113
import matplotlib.pyplot as plt
12-
from mpl_toolkits.axes_grid1 import AxesGrid
1314

1415

1516
def get_demo_image():

‎examples/axes_grid1/demo_fixed_size_axes.py

Copy file name to clipboardExpand all lines: examples/axes_grid1/demo_fixed_size_axes.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
===============================
55
"""
66

7-
import matplotlib.pyplot as plt
8-
97
from mpl_toolkits.axes_grid1 import Divider, Size
108

9+
import matplotlib.pyplot as plt
10+
1111
# %%
1212

1313

‎examples/axes_grid1/demo_imagegrid_aspect.py

Copy file name to clipboardExpand all lines: examples/axes_grid1/demo_imagegrid_aspect.py
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@
44
=========================================
55
"""
66

7-
import matplotlib.pyplot as plt
87
from mpl_toolkits.axes_grid1 import ImageGrid
98

9+
import matplotlib.pyplot as plt
10+
1011
fig = plt.figure()
1112

1213
grid1 = ImageGrid(fig, 121, (2, 2), axes_pad=0.1,

‎examples/axes_grid1/inset_locator_demo.py

Copy file name to clipboardExpand all lines: examples/axes_grid1/inset_locator_demo.py
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
# By default, the inset is offset by some points from the axes,
1414
# controlled via the *borderpad* parameter.
1515

16-
import matplotlib.pyplot as plt
1716
from mpl_toolkits.axes_grid1.inset_locator import inset_axes
1817

18+
import matplotlib.pyplot as plt
1919

2020
fig, (ax, ax2) = plt.subplots(1, 2, figsize=[5.5, 2.8])
2121

@@ -136,6 +136,7 @@
136136
# Create an inset horizontally centered in figure coordinates and vertically
137137
# bound to line up with the axes.
138138
from matplotlib.transforms import blended_transform_factory # noqa
139+
139140
transform = blended_transform_factory(fig.transFigure, ax2.transAxes)
140141
axins4 = inset_axes(ax2, width="16%", height="34%",
141142
bbox_to_anchor=(0, 0, 1, 1),

‎examples/axes_grid1/inset_locator_demo2.py

Copy file name to clipboardExpand all lines: examples/axes_grid1/inset_locator_demo2.py
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@
1212
:doc:`/gallery/subplots_axes_and_figures/zoom_inset_axes`.
1313
"""
1414

15-
from matplotlib import cbook
16-
import matplotlib.pyplot as plt
17-
from mpl_toolkits.axes_grid1.inset_locator import zoomed_inset_axes, mark_inset
1815
from mpl_toolkits.axes_grid1.anchored_artists import AnchoredSizeBar
19-
16+
from mpl_toolkits.axes_grid1.inset_locator import mark_inset, zoomed_inset_axes
2017
import numpy as np
2118

19+
from matplotlib import cbook
20+
import matplotlib.pyplot as plt
21+
2222

2323
def get_demo_image():
2424
z = cbook.get_sample_data("axes_grid/bivariate_normal.npy", np_load=True)

‎examples/axes_grid1/make_room_for_ylabel_using_axesgrid.py

Copy file name to clipboardExpand all lines: examples/axes_grid1/make_room_for_ylabel_using_axesgrid.py
+1-2Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,10 @@
44
====================================
55
"""
66

7-
import matplotlib.pyplot as plt
8-
97
from mpl_toolkits.axes_grid1 import make_axes_locatable
108
from mpl_toolkits.axes_grid1.axes_divider import make_axes_area_auto_adjustable
119

10+
import matplotlib.pyplot as plt
1211

1312
fig = plt.figure()
1413
ax = fig.add_axes([0, 0, 1, 1])

‎examples/axes_grid1/parasite_simple.py

Copy file name to clipboardExpand all lines: examples/axes_grid1/parasite_simple.py
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@
44
===============
55
"""
66

7-
import matplotlib.pyplot as plt
87
from mpl_toolkits.axes_grid1 import host_subplot
98

9+
import matplotlib.pyplot as plt
10+
1011
host = host_subplot(111)
1112
par = host.twinx()
1213

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.