Skip to content

Commit 89916b6

Browse files
authored
Update parameter 'color' to 'fill' in examples and tutorials (#2201)
1 parent 5644d99 commit 89916b6

24 files changed

+100
-104
lines changed

examples/gallery/3d_plots/scatter3d.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
# Use 3D cubes ("u") as symbols, with size in centimeter units ("c")
7373
style="uc",
7474
# Points colored by categorical number code
75-
color=df.species.cat.codes.astype(int),
75+
fill=df.species.cat.codes.astype(int),
7676
# Use colormap created by makecpt
7777
cmap=True,
7878
# Set map dimensions (xmin, xmax, ymin, ymax, zmin, zmax)

examples/gallery/basemaps/double_y_axes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class can control which axes should be plotted and optionally show annotations,
4646
# Plot the line for y1 data
4747
fig.plot(x=x, y=y1, pen="1p,blue")
4848
# Plot points for y1 data
49-
fig.plot(x=x, y=y1, style="c0.2c", color="blue", label="y1")
49+
fig.plot(x=x, y=y1, style="c0.2c", fill="blue", label="y1")
5050

5151
# Plot the Y axis for y2 data
5252
# The right axis (E) is plotted with red annotations, ticks, and label
@@ -60,7 +60,7 @@ class can control which axes should be plotted and optionally show annotations,
6060
# Plot the line for y2 data
6161
fig.plot(x=x, y=y2, pen="1p,red")
6262
# Plot points for y2 data
63-
fig.plot(x=x, y=y2, style="s0.28c", color="red", label="y2")
63+
fig.plot(x=x, y=y2, style="s0.28c", fill="red", label="y2")
6464

6565
# Create a legend in the top-left corner of the plot
6666
fig.legend(position="jTL+o0.1c", box=True)

examples/gallery/embellishments/legend.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@
1515
fig.plot(
1616
data="@Table_5_11.txt",
1717
style="c0.40c",
18-
color="lightgreen",
18+
fill="lightgreen",
1919
pen="faint",
2020
label="Apples",
2121
)
2222
fig.plot(data="@Table_5_11.txt", pen="1.5p,gray", label="My lines")
23-
fig.plot(data="@Table_5_11.txt", style="t0.40c", color="orange", label="Oranges")
23+
fig.plot(data="@Table_5_11.txt", style="t0.40c", fill="orange", label="Oranges")
2424

2525
fig.legend(position="JTR+jTR+o0.2c", box=True)
2626

examples/gallery/histograms/blockm.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,7 @@
3636
# plot slightly transparent landmasses on top
3737
fig.coast(land="darkgray", transparency=40)
3838
# plot original data points
39-
fig.plot(
40-
x=data.longitude, y=data.latitude, style="c0.3c", color="white", pen="1p,black"
41-
)
39+
fig.plot(x=data.longitude, y=data.latitude, style="c0.3c", fill="white", pen="1p,black")
4240
fig.colorbar(frame=["x+lkm"])
4341

4442
fig.shift_origin(xshift="w+5c")
@@ -55,9 +53,7 @@
5553
cmap="batlow",
5654
)
5755
fig.coast(land="darkgray", transparency=40)
58-
fig.plot(
59-
x=data.longitude, y=data.latitude, style="c0.3c", color="white", pen="1p,black"
60-
)
56+
fig.plot(x=data.longitude, y=data.latitude, style="c0.3c", fill="white", pen="1p,black")
6157
fig.colorbar(frame=["x+lcount"])
6258

6359
fig.show()

examples/gallery/images/track_sampling.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,6 @@
3636
y=track.latitude,
3737
style="c0.15c",
3838
cmap="terra",
39-
color=(track.bathymetry - track.bathymetry.mean()) / track.bathymetry.std(),
39+
fill=(track.bathymetry - track.bathymetry.mean()) / track.bathymetry.std(),
4040
)
4141
fig.show()

examples/gallery/lines/great_circles.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,16 @@
2828
# plot individual points of first great circle as seagreen line
2929
fig.plot(x=points1.r, y=points1.s, pen="2p,seagreen")
3030
# plot individual points as seagreen squares atop
31-
fig.plot(x=points1.r, y=points1.s, style="s.45c", color="seagreen", pen="1p")
31+
fig.plot(x=points1.r, y=points1.s, style="s.45c", fill="seagreen", pen="1p")
3232

3333
# plot individual points of second great circle as orange line
3434
fig.plot(x=points2.r, y=points2.s, pen="2p,orange")
3535
# plot individual points as orange inverted triangles atop
36-
fig.plot(x=points2.r, y=points2.s, style="i.6c", color="orange", pen="1p")
36+
fig.plot(x=points2.r, y=points2.s, style="i.6c", fill="orange", pen="1p")
3737

3838
# plot individual points of third great circle as red3 line
3939
fig.plot(x=points3.r, y=points3.s, pen="2p,red3")
4040
# plot individual points as red3 circles atop
41-
fig.plot(x=points3.r, y=points3.s, style="c.3c", color="red3", pen="1p")
41+
fig.plot(x=points3.r, y=points3.s, style="c.3c", fill="red3", pen="1p")
4242

4343
fig.show()

examples/gallery/lines/linefronts.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
"f0.5c/0.3c+r+t+o0.3c+p+i",
7777
]:
7878
y -= 1 # move the current line down
79-
fig.plot(x=x, y=y, pen="1.25p", style=frontstyle, color="red3")
79+
fig.plot(x=x, y=y, pen="1.25p", style=frontstyle, fill="red3")
8080
fig.text(
8181
x=x[-1],
8282
y=y[-1],

examples/gallery/lines/vector_heads_tails.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
"v1c+bi+ea+r+h0.5+a45",
7575
]:
7676
fig.plot(
77-
x=x, y=y, style=vecstyle, direction=([angle], [length]), pen="2p", color="red3"
77+
x=x, y=y, style=vecstyle, direction=([angle], [length]), pen="2p", fill="red3"
7878
)
7979
fig.text(
8080
x=6, y=y, text=vecstyle, font="Courier-Bold", justify="ML", offset="0.2c/0c"

examples/gallery/lines/vector_styles.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
# data for circular vectors
4646
data = np.column_stack([x, y, radius, startdir, stopdir])
4747
arcstyle = "m0.5c+ea" # Circular vector (m) with an arrow at end
48-
fig.plot(data=data, style=arcstyle, color="red3", pen="1.5p,black")
48+
fig.plot(data=data, style=arcstyle, fill="red3", pen="1.5p,black")
4949
fig.text(text="CIRCULAR", x=-95, y=44.2, font="13p,Helvetica-Bold,black", fill="white")
5050

5151

examples/gallery/symbols/bars.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,20 +36,20 @@
3636

3737
pen = "1.5p"
3838
with fig.set_panel(panel=0):
39-
color = "skyblue"
39+
fill = "skyblue"
4040
fig.basemap(region=[0, 4, 0, 3], frame="+tvertical bars")
41-
fig.plot(x=1, y=2, style="b0.5c", color=color, pen=pen)
42-
fig.plot(x=2, y=2.5, style="b1c", color=color, pen=pen)
41+
fig.plot(x=1, y=2, style="b0.5c", fill=fill, pen=pen)
42+
fig.plot(x=2, y=2.5, style="b1c", fill=fill, pen=pen)
4343
# +b1 means that the bar is starting from y=1 here
44-
fig.plot(x=3, y=2.5, style="b0.75c+b1", color=color, pen=pen)
44+
fig.plot(x=3, y=2.5, style="b0.75c+b1", fill=fill, pen=pen)
4545

4646
with fig.set_panel(panel=1):
47-
color = "tomato"
47+
fill = "tomato"
4848
fig.basemap(region=[0, 4, 0, 3], frame="+thorizontal bars")
49-
fig.plot(x=1.5, y=0.5, style="B0.75c", color=color, pen=pen)
50-
fig.plot(x=3, y=1.5, style="B1c", color=color, pen=pen)
49+
fig.plot(x=1.5, y=0.5, style="B0.75c", fill=fill, pen=pen)
50+
fig.plot(x=3, y=1.5, style="B1c", fill=fill, pen=pen)
5151
# +b2 means that the bar is starting from x=2 here
52-
fig.plot(x=3.5, y=2.5, style="B0.5c+b2", color=color, pen=pen)
52+
fig.plot(x=3.5, y=2.5, style="B0.5c+b2", fill=fill, pen=pen)
5353

5454
# generate dictionary for plotting multi-band bars
5555
data = {

0 commit comments

Comments
 (0)