Skip to content

Prefer plot() to scatter() in examples. #14174

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

Closed
wants to merge 1 commit into from
Closed
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
4 changes: 2 additions & 2 deletions examples/axisartist/demo_floating_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,12 +149,12 @@ def setup_axes3(fig, rect):
ax2, aux_ax2 = setup_axes2(fig, 132)
theta = np.random.rand(10)*.5*np.pi
radius = np.random.rand(10) + 1.
aux_ax2.scatter(theta, radius)
aux_ax2.plot(theta, radius, ".")

ax3, aux_ax3 = setup_axes3(fig, 133)

theta = (8 + np.random.rand(10)*(14 - 8))*15. # in degrees
radius = np.random.rand(10)*14000.
aux_ax3.scatter(theta, radius)
aux_ax3.plot(theta, radius, ".")

plt.show()
4 changes: 2 additions & 2 deletions examples/images_contours_and_fields/quiver_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
pivot='mid', units='inches')
qk = ax2.quiverkey(Q, 0.9, 0.9, 1, r'$1 \frac{m}{s}$', labelpos='E',
coordinates='figure')
ax2.scatter(X[::3, ::3], Y[::3, ::3], color='r', s=5)
ax2.plot(X[::3, ::3], Y[::3, ::3], '.', ms=3, c='r')

###############################################################################

Expand All @@ -48,7 +48,7 @@
scale=1 / 0.15)
qk = ax3.quiverkey(Q, 0.9, 0.9, 1, r'$1 \frac{m}{s}$', labelpos='E',
coordinates='figure')
ax3.scatter(X, Y, color='0.5', s=1)
ax3.plot(X, Y, '.', color='0.5', ms=3)

plt.show()

Expand Down
5 changes: 2 additions & 3 deletions examples/lines_bars_and_markers/scatter_star_poly.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@
Scatter Star Poly
=================

Create multiple scatter plots with different
star symbols.

Create multiple scatter plots with different star symbols.
"""

import numpy as np
import matplotlib.pyplot as plt

Expand Down
12 changes: 6 additions & 6 deletions examples/statistics/confidence_ellipse.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,14 +142,14 @@ def get_correlated_dataset(n, dependency, mu, scale):
fig, axs = plt.subplots(1, 3, figsize=(9, 3))
for ax, (title, dependency) in zip(axs, PARAMETERS.items()):
x, y = get_correlated_dataset(800, dependency, mu, scale)
ax.scatter(x, y, s=0.5)
ax.plot(x, y, ".", ms=1)

ax.axvline(c='grey', lw=1)
ax.axhline(c='grey', lw=1)

confidence_ellipse(x, y, ax, edgecolor='red')

ax.scatter(mu[0], mu[1], c='red', s=3)
ax.plot(mu[0], mu[1], ".", ms=1, c="r")
ax.set_title(title)

plt.show()
Expand All @@ -175,7 +175,7 @@ def get_correlated_dataset(n, dependency, mu, scale):
ax_nstd.axhline(c='grey', lw=1)

x, y = get_correlated_dataset(500, dependency_nstd, mu, scale)
ax_nstd.scatter(x, y, s=0.5)
ax_nstd.plot(x, y, ".", ms=1)

confidence_ellipse(x, y, ax_nstd, n_std=1,
label=r'$1\sigma$', edgecolor='firebrick')
Expand All @@ -184,7 +184,7 @@ def get_correlated_dataset(n, dependency, mu, scale):
confidence_ellipse(x, y, ax_nstd, n_std=3,
label=r'$3\sigma$', edgecolor='blue', linestyle=':')

ax_nstd.scatter(mu[0], mu[1], c='red', s=3)
ax_nstd.plot(mu[0], mu[1], ".", ms=1, c="r")
ax_nstd.set_title('Different standard deviations')
ax_nstd.legend()
plt.show()
Expand Down Expand Up @@ -215,8 +215,8 @@ def get_correlated_dataset(n, dependency, mu, scale):
confidence_ellipse(x, y, ax_kwargs,
alpha=0.5, facecolor='pink', edgecolor='purple', zorder=0)

ax_kwargs.scatter(x, y, s=0.5)
ax_kwargs.scatter(mu[0], mu[1], c='red', s=3)
ax_kwargs.plot(x, y, ".", ms=1)
ax_kwargs.plot(mu[0], mu[1], ".", ms=1, c="r")
ax_kwargs.set_title(f'Using kwargs')

fig.subplots_adjust(hspace=0.25)
Expand Down
2 changes: 1 addition & 1 deletion examples/statistics/customized_violin.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def set_axis_style(ax, labels):
whiskersMin, whiskersMax = whiskers[:, 0], whiskers[:, 1]

inds = np.arange(1, len(medians) + 1)
ax2.scatter(inds, medians, marker='o', color='white', s=30, zorder=3)
ax2.plot(inds, medians, 'o', color='white', zorder=3)
ax2.vlines(inds, quartile1, quartile3, color='k', linestyle='-', lw=5)
ax2.vlines(inds, whiskersMin, whiskersMax, color='k', linestyle='-', lw=1)

Expand Down
2 changes: 1 addition & 1 deletion examples/text_labels_and_annotations/text_rotation.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def addtext(ax, props):
ax.text(3.5, 0.5, 'text 225', props, rotation=225)
ax.text(4.5, 0.5, 'text -45', props, rotation=-45)
for x in range(0, 5):
ax.scatter(x + 0.5, 0.5, color='r', alpha=0.5)
ax.plot(x + 0.5, 0.5, 'ro', alpha=0.5)
ax.set_yticks([0, .5, 1])
ax.set_xlim(0, 5)
ax.grid(True)
Expand Down
4 changes: 2 additions & 2 deletions examples/userdemo/annotate_text_arrow.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
x2 = 1. + np.random.randn(100)
y2 = 1. + np.random.randn(100)

ax.scatter(x1, y1, color="r")
ax.scatter(x2, y2, color="g")
ax.plot(x1, y1, ".", c="r")
ax.plot(x2, y2, ".", c="g")

bbox_props = dict(boxstyle="round", fc="w", ec="0.5", alpha=0.9)
ax.text(-2, -2, "Sample A", ha="center", va="center", size=20,
Expand Down