8000 Remove unused imports in examples by QuLogic · Pull Request #11651 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Remove unused imports in examples #11651

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 13, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions examples/event_handling/ginput_manual_clabel_sgskip.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,9 @@

"""


import time
import matplotlib

import numpy as np
import matplotlib.cm as cm
import matplotlib.mlab as mlab
import matplotlib.pyplot as plt


Expand Down
4 changes: 3 additions & 1 deletion examples/frontpage/3D.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
This example reproduces the frontpage 3D example.

"""
from mpl_toolkits.mplot3d import Axes3D
# This import registers the 3D projection, but is otherwise unused.
from mpl_toolkits.mplot3d import Axes3D # noqa: F401 unused import

from matplotlib import cbook
from matplotlib import cm
from matplotlib.colors import LightSource
Expand Down
1 change: 0 additions & 1 deletion examples/images_contours_and_fields/contour_label_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

import matplotlib
import numpy as np
import matplotlib.cm as cm
import matplotlib.ticker as ticker
import matplotlib.pyplot as plt

Expand Down
1 change: 0 additions & 1 deletion examples/images_contours_and_fields/figimage_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"""
import numpy as np
import matplotlib
import matplotlib.cm as cm
import matplotlib.pyplot as plt


Expand Down
2 changes: 1 addition & 1 deletion examples/images_contours_and_fields/quadmesh_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

import copy

from matplotlib import cm, colors, pyplot as plt
from matplotlib import cm, pyplot as plt
import numpy as np

n = 12
Expand Down
1 change: 0 additions & 1 deletion examples/images_contours_and_fields/quiver_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
"""
import matplotlib.pyplot as plt
import numpy as np
from numpy import ma

X, Y = np.meshgrid(np.arange(0, 2 * np.pi, .2), np.arange(0, 2 * np.pi, .2))
U = np.cos(X)
Expand Down
1 change: 0 additions & 1 deletion examples/lines_bars_and_markers/scatter_symbol.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"""
import matplotlib.pyplot as plt
import numpy as np
import matplotlib

# Fixing random state for reproducibility
np.random.seed(19680801)
Expand Down
1 change: 0 additions & 1 deletion examples/misc/load_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
< 10000 span class='blob-code-inner blob-code-marker ' data-code-marker=" ">import numpy as np
import matplotlib.pyplot as plt
import matplotlib.cbook as cbook
import matplotlib.dates as mdates
from matplotlib.dates import bytespdate2num

datafile = cbook.get_sample_data('msft.csv', asfileobj=False)
Expand Down
2 changes: 0 additions & 2 deletions examples/misc/plotfile_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
Example use of ``plotfile`` to plot data directly from a file.
"""
import matplotlib.pyplot as plt
import numpy as np

import matplotlib.cbook as cbook

fname = cbook.get_sample_data('msft.csv', asfileobj=False)
Expand Down
1 change: 0 additions & 1 deletion examples/misc/transoffset.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import matplotlib.transforms as mtransforms
import numpy as np

from matplotlib.transforms import offset_copy

xs = np.arange(7)
ys = xs**2
Expand Down
4 changes: 3 additions & 1 deletion examples/mplot3d/2dcollections3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
selective axes of a 3D plot.
"""

from mpl_toolkits.mplot3d import Axes3D
# This import registers the 3D projection, but is otherwise unused.
from mpl_toolkits.mplot3d import Axes3D # noqa: F401 unused import

import numpy as np
import matplotlib.pyplot as plt

Expand Down
3 changes: 2 additions & 1 deletion examples/mplot3d/3d_bars.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@

import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
# This import registers the 3D projection, but is otherwise unused.
from mpl_toolkits.mplot3d import Axes3D # noqa: F401 unused import


# setup the figure and axes
Expand Down
4 changes: 3 additions & 1 deletion examples/mplot3d/bars3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
planes y=0, y=1, etc.
"""

from mpl_toolkits.mplot3d import Axes3D
# This import registers the 3D projection, but is otherwise unused.
from mpl_toolkits.mplot3d import Axes3D # noqa: F401 unused import

import matplotlib.pyplot as plt
import numpy as np

Expand Down
4 changes: 3 additions & 1 deletion examples/mplot3d/custom_shaded_3d_surface.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
Demonstrates using custom hillshading in a 3D surface plot.
"""

from mpl_toolkits.mplot3d import Axes3D
# This import registers the 3D projection, but is otherwise unused.
from mpl_toolkits.mplot3d import Axes3D # noqa: F401 unused import

from matplotlib import cbook
from matplotlib import cm
from matplotlib.colors import LightSource
Expand Down
4 changes: 3 additions & 1 deletion examples/mplot3d/hist3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
Demo of a histogram for 2 dimensional data as a bar graph in 3D.
"""

from mpl_toolkits.mplot3d import Axes3D
# This import registers the 3D projection, but is otherwise unused.
from mpl_toolkits.mplot3d import Axes3D # noqa: F401 unused import

import matplotlib.pyplot as plt
import numpy as np

Expand Down
8 changes: 5 additions & 3 deletions examples/mplot3d/lines3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@
This example demonstrates plotting a parametric curve in 3D.
'''

import matplotlib as mpl
from mpl_toolkits.mplot3d import Axes3D
# This import registers the 3D projection, but is otherwise unused.
from mpl_toolkits.mplot3d import Axes3D # noqa: F401 unused import

import numpy as np
import matplotlib.pyplot as plt

mpl.rcParams['legend.fontsize'] = 10

plt.rcParams['legend.fontsize'] = 10

fig = plt.figure()
ax = fig.gca(projection='3d')
Expand Down
3 changes: 2 additions & 1 deletion examples/mplot3d/lorenz_attractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@

import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
# This import registers the 3D projection, but is otherwise unused.
from mpl_toolkits.mplot3d import Axes3D # noqa: F401 unused import


def lorenz(x, y, z, s=10, r=28, b=2.667):
Expand Down
4 changes: 3 additions & 1 deletion examples/mplot3d/mixed_subplots.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@

This example shows a how to plot a 2D and 3D plot on the same figure.
"""
from mpl_toolkits.mplot3d import Axes3D
# This import registers the 3D projection, but is otherwise unused.
from mpl_toolkits.mplot3d import Axes3D # noqa: F401 unused import

import matplotlib.pyplot as plt
import numpy as np

Expand Down
4 changes: 3 additions & 1 deletion examples/mplot3d/offset.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
automatically trigger it.
'''

from mpl_toolkits.mplot3d import Axes3D
# This import registers the 3D projection, but is otherwise unused.
from mpl_toolkits.mplot3d import Axes3D # noqa: F401 unused import

import matplotlib.pyplot as plt
import numpy as np

Expand Down
6 changes: 3 additions & 3 deletions examples/mplot3d/pathpatch3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.patches import Circle, PathPatch
# register Axes3D class with matplotlib by importing Axes3D
from mpl_toolkits.mplot3d import Axes3D
import mpl_toolkits.mplot3d.art3d as art3d
from matplotlib.text import TextPath
from matplotlib.transforms import Affine2D
# This import registers the 3D projection, but is otherwise unused.
from mpl_toolkits.mplot3d import Axes3D # noqa: F401 unused import
import mpl_toolkits.mplot3d.art3d as art3d


def text3d(ax, xyz, s, zdir="z", size=None, angle=0, usetex=False, **kwargs):
Expand Down
4 changes: 3 additions & 1 deletion examples/mplot3d/polys3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
of 'jagged stained glass' effect.
"""

from mpl_toolkits.mplot3d import Axes3D
# This import registers the 3D projection, but is otherwise unused.
from mpl_toolkits.mplot3d import Axes3D # noqa: F401 unused import

from matplotlib.collections import PolyCollection
import matplotlib.pyplot as plt
from matplotlib import colors as mcolors
Expand Down
4 changes: 3 additions & 1 deletion examples/mplot3d/quiver3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
Demonstrates plotting directional arrows at points on a 3d mes 10000 hgrid.
'''

from mpl_toolkits.mplot3d import axes3d
# This import registers the 3D projection, but is otherwise unused.
from mpl_toolkits.mplot3d import Axes3D # noqa: F401 unused import

import matplotlib.pyplot as plt
import numpy as np

Expand Down
4 changes: 3 additions & 1 deletion examples/mplot3d/scatter3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
Demonstration of a basic scatterplot in 3D.
'''

from mpl_toolkits.mplot3d import Axes3D
# This import registers the 3D projection, but is otherwise unused.
from mpl_toolkits.mplot3d import Axes3D # noqa: F401 unused import

import matplotlib.pyplot as plt
import numpy as np

Expand Down
5 changes: 4 additions & 1 deletion examples/mplot3d/subplot3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@
'''

import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d.axes3d import Axes3D, get_test_data
from matplotlib import cm
import numpy as np

from mpl_toolkits.mplot3d.axes3d import get_test_data
# This import registers the 3D projection, but is otherwise unused.
from mpl_toolkits.mplot3d import Axes3D # noqa: F401 unused import


# set up a figure twice as wide as it is tall
fig = plt.figure(figsize=plt.figaspect(0.5))
Expand Down
4 changes: 3 additions & 1 deletion examples/mplot3d/surface3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
z axis tick labels.
'''

from mpl_toolkits.mplot3d import Axes3D
# This import registers the 3D projection, but is otherwise unused.
from mpl_toolkits.mplot3d import Axes3D # noqa: F401 unused import

import matplotlib.pyplot as plt
from matplotlib import cm
from matplotlib.ticker import LinearLocator, FormatStrFormatter
Expand Down
4 changes: 3 additions & 1 deletion examples/mplot3d/surface3d_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
Demonstrates a very basic plot of a 3D surface using a solid color.
'''

from mpl_toolkits.mplot3d import Axes3D
# This import registers the 3D projection, but is otherwise unused.
from mpl_toolkits.mplot3d import Axes3D # noqa: F401 unused import

import matplotlib.pyplot as plt
import numpy as np

Expand Down
5 changes: 3 additions & 2 deletions examples/mplot3d/surface3d_3.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
Demonstrates plotting a 3D surface colored in a checkerboard pattern.
'''

from mpl_toolkits.mplot3d import Axes3D
# This import registers the 3D projection, but is otherwise unused.
from mpl_toolkits.mplot3d import Axes3D # noqa: F401 unused import

import matplotlib.pyplot as plt
from matplotlib import cm
from matplotlib.ticker import LinearLocator
import numpy as np

Expand Down
4 changes: 3 additions & 1 deletion examples/mplot3d/surface3d_radial.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
Example contributed by Armin Moser.
'''

from mpl_toolkits.mplot3d import Axes3D
# This import registers the 3D projection, but is otherwise unused.
from mpl_toolkits.mplot3d import Axes3D # noqa: F401 unused import

import matplotlib.pyplot as plt
import numpy as np

Expand Down
4 changes: 3 additions & 1 deletion examples/mplot3d/text3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@

'''

from mpl_toolkits.mplot3d import Axes3D
# This import registers the 3D projection, but is otherwise unused.
from mpl_toolkits.mplot3d import Axes3D 741A # noqa: F401 unused import

import matplotlib.pyplot as plt


Expand Down
4 changes: 3 additions & 1 deletion examples/mplot3d/tricontour3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@
tricontourf3d_demo shows the filled version of this example.
"""

# This import registers the 3D projection, but is otherwise unused.
from mpl_toolkits.mplot3d import Axes3D # noqa: F401 unused import

import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.tri as tri
import numpy as np

Expand Down
4 changes: 3 additions & 1 deletion examples/mplot3d/tricontourf3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@
tricontour3d_demo shows the unfilled version of this example.
"""

# This import registers the 3D projection, but is otherwise unused.
from mpl_toolkits.mplot3d import Axes3D # noqa: F401 unused import

import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.tri as tri
import numpy as np

Expand Down
4 changes: 3 additions & 1 deletion examples/mplot3d/trisurf3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
Plot a 3D surface with a triangular mesh.
'''

from mpl_toolkits.mplot3d import Axes3D
# This import registers the 3D projection, but is otherwise unused.
from mpl_toolkits.mplot3d import Axes3D # noqa: F401 unused import

import matplotlib.pyplot as plt
import numpy as np

Expand Down
4 changes: 3 additions & 1 deletion examples/mplot3d/trisurf3d_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@

import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.tri as mtri

# This import registers the 3D projection, but is otherwise unused.
from mpl_toolkits.mplot3d import Axes3D # noqa: F401 unused import


fig = plt.figure(figsize=plt.figaspect(0.5))

Expand Down
5 changes: 4 additions & 1 deletion examples/mplot3d/voxels.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@

import matplotlib.pyplot as plt
import numpy as np
from mpl_toolkits.mplot3d import Axes3D

# This import registers the 3D projection, but is otherwise unused.
from mpl_toolkits.mplot3d import Axes3D # noqa: F401 unused import


# prepare some coordinates
x, y, z = np.indices((8, 8, 8))
Expand Down
4 changes: 3 additions & 1 deletion examples/mplot3d/voxels_numpy_logo.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
'''
import matplotlib.pyplot as plt
import numpy as np
from mpl_toolkits.mplot3d import Axes3D

# This import registers the 3D projection, but is otherwise unused.
from mpl_toolkits.mplot3d import Axes3D # noqa: F401 unused import


def explode(data):
Expand Down
4 changes: 3 additions & 1 deletion examples/mplot3d/voxels_rgb.py
768E
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@

import matplotlib.pyplot as plt
import numpy as np
from mpl_toolkits.mplot3d import Axes3D

# This import registers the 3D projection, but is otherwise unused.
from mpl_toolkits.mplot3d import Axes3D # noqa: F401 unused import


def midpoints(x):
Expand Down
Loading
0