Skip to content

Update parameter 'color' to 'fill' in examples and tutorials #2201

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 34 commits into from
Nov 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
a3278a9
Update parameter 'color' to 'fill' in examples
michaelgrund Nov 22, 2022
fbda1c3
Update great_circles.py
michaelgrund Nov 22, 2022
6ed4586
Update linefronts.py
michaelgrund Nov 22, 2022
c5dbc51
Update vector_heads_tails.py
michaelgrund Nov 22, 2022
5296223
Update basic_symbols.py
michaelgrund Nov 22, 2022
8d8bcd5
Update points_categorical.py
michaelgrund Nov 22, 2022
8728c0f
Update custom_symbols.py
michaelgrund Nov 22, 2022
bd7e718
Update datetime_inputs.py
michaelgrund Nov 22, 2022
71f677c
Update multi_parameter_symbols.py
michaelgrund Nov 22, 2022
d3fe5df
Merge branch 'main' into gallery-color-to-fill
michaelgrund Nov 23, 2022
d3aca4d
Update points.py
michaelgrund Nov 23, 2022
6a704a6
Update points_transparency.py
michaelgrund Nov 23, 2022
b4b8389
Update scatter.py
michaelgrund Nov 23, 2022
89f5c41
Update text_symbols.py
michaelgrund Nov 23, 2022
2d7c511
Update track_sampling.py
michaelgrund Nov 23, 2022
c47fd54
Update double_y_axes.py
michaelgrund Nov 23, 2022
71469f6
Update blockm.py
michaelgrund Nov 23, 2022
a97be18
Update legend.py
michaelgrund Nov 23, 2022
eef46b8
Update plot.py
michaelgrund Nov 23, 2022
05cd189
Update date_time_charts.py
michaelgrund Nov 23, 2022
567de63
Update vectors.py
michaelgrund Nov 23, 2022
e8b2f8e
Update vectors.py
michaelgrund Nov 23, 2022
0fc5beb
Update cartesian_logarithmic.py
michaelgrund Nov 23, 2022
f6f2b9b
Update cartesian_power.py
michaelgrund Nov 23, 2022
799792b
Update scatter3d.py
michaelgrund Nov 23, 2022
04351ad
Update wiggle.py
michaelgrund Nov 23, 2022
521fe3d
Update bars.py
michaelgrund Nov 23, 2022
feab550
Update bars.py
michaelgrund Nov 23, 2022
2a6b3a1
Update scatter.py
michaelgrund Nov 23, 2022
b3cfc17
Update wiggle.py
michaelgrund Nov 24, 2022
f5e8140
Merge branch 'main' into gallery-color-to-fill
michaelgrund Nov 24, 2022
6f2dc12
[format-command] fixes
actions-bot Nov 24, 2022
2c3b92b
Update cartesian_power.py
michaelgrund Nov 24, 2022
12c2cf8
[format-command] fixes
actions-bot Nov 24, 2022
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
2 changes: 1 addition & 1 deletion examples/gallery/3d_plots/scatter3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
# Use 3D cubes ("u") as symbols, with size in centimeter units ("c")
style="uc",
# Points colored by categorical number code
color=df.species.cat.codes.astype(int),
fill=df.species.cat.codes.astype(int),
# Use colormap created by makecpt
cmap=True,
# Set map dimensions (xmin, xmax, ymin, ymax, zmin, zmax)
Expand Down
4 changes: 2 additions & 2 deletions examples/gallery/basemaps/double_y_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class can control which axes should be plotted and optionally show annotations,
# Plot the line for y1 data
fig.plot(x=x, y=y1, pen="1p,blue")
# Plot points for y1 data
fig.plot(x=x, y=y1, style="c0.2c", color="blue", label="y1")
fig.plot(x=x, y=y1, style="c0.2c", fill="blue", label="y1")

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

# Create a legend in the top-left corner of the plot
fig.legend(position="jTL+o0.1c", box=True)
Expand Down
4 changes: 2 additions & 2 deletions examples/gallery/embellishments/legend.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
fig.plot(
data="@Table_5_11.txt",
style="c0.40c",
color="lightgreen",
fill="lightgreen",
pen="faint",
label="Apples",
)
fig.plot(data="@Table_5_11.txt", pen="1.5p,gray", label="My lines")
fig.plot(data="@Table_5_11.txt", style="t0.40c", color="orange", label="Oranges")
fig.plot(data="@Table_5_11.txt", style="t0.40c", fill="orange", label="Oranges")

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

Expand Down
8 changes: 2 additions & 6 deletions examples/gallery/histograms/blockm.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@
# plot slightly transparent landmasses on top
fig.coast(land="darkgray", transparency=40)
# plot original data points
fig.plot(
x=data.longitude, y=data.latitude, style="c0.3c", color="white", pen="1p,black"
)
fig.plot(x=data.longitude, y=data.latitude, style="c0.3c", fill="white", pen="1p,black")
fig.colorbar(frame=["x+lkm"])

fig.shift_origin(xshift="w+5c")
Expand All @@ -55,9 +53,7 @@
cmap="batlow",
)
fig.coast(land="darkgray", transparency=40)
fig.plot(
x=data.longitude, y=data.latitude, style="c0.3c", color="white", pen="1p,black"
)
fig.plot(x=data.longitude, y=data.latitude, style="c0.3c", fill="white", pen="1p,black")
fig.colorbar(frame=["x+lcount"])

fig.show()
2 changes: 1 addition & 1 deletion examples/gallery/images/track_sampling.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@
y=track.latitude,
style="c0.15c",
cmap="terra",
color=(track.bathymetry - track.bathymetry.mean()) / track.bathymetry.std(),
fill=(track.bathymetry - track.bathymetry.mean()) / track.bathymetry.std(),
)
fig.show()
6 changes: 3 additions & 3 deletions examples/gallery/lines/great_circles.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,16 @@
# plot individual points of first great circle as seagreen line
fig.plot(x=points1.r, y=points1.s, pen="2p,seagreen")
# plot individual points as seagreen squares atop
fig.plot(x=points1.r, y=points1.s, style="s.45c", color="seagreen", pen="1p")
fig.plot(x=points1.r, y=points1.s, style="s.45c", fill="seagreen", pen="1p")

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

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

fig.show()
2 changes: 1 addition & 1 deletion examples/gallery/lines/linefronts.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
"f0.5c/0.3c+r+t+o0.3c+p+i",
]:
y -= 1 # move the current line down
fig.plot(x=x, y=y, pen="1.25p", style=frontstyle, color="red3")
fig.plot(x=x, y=y, pen="1.25p", style=frontstyle, fill="red3")
fig.text(
x=x[-1],
y=y[-1],
Expand Down
2 changes: 1 addition & 1 deletion examples/gallery/lines/vector_heads_tails.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
"v1c+bi+ea+r+h0.5+a45",
]:
fig.plot(
x=x, y=y, style=vecstyle, direction=([angle], [length]), pen="2p", color="red3"
x=x, y=y, style=vecstyle, direction=([angle], [length]), pen="2p", fill="red3"
)
fig.text(
x=6, y=y, text=vecstyle, font="Courier-Bold", justify="ML", offset="0.2c/0c"
Expand Down
2 changes: 1 addition & 1 deletion examples/gallery/lines/vector_styles.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
# data for circular vectors
data = np.column_stack([x, y, radius, startdir, stopdir])
arcstyle = "m0.5c+ea" # Circular vector (m) with an arrow at end
fig.plot(data=data, style=arcstyle, color="red3", pen="1.5p,black")
fig.plot(data=data, style=arcstyle, fill="red3", pen="1.5p,black")
fig.text(text="CIRCULAR", x=-95, y=44.2, font="13p,Helvetica-Bold,black", fill="white")


Expand Down
16 changes: 8 additions & 8 deletions examples/gallery/symbols/bars.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,20 @@

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

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

# generate dictionary for plotting multi-band bars
data = {
Expand Down
22 changes: 11 additions & 11 deletions examples/gallery/symbols/basic_symbols.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
geometric symbols are shown underneath their corresponding shortcut codes.
Four symbols (**-**, **+**, **x** and **y**) are line-symbols only for which we
can adjust the linewidth via the ``pen`` parameter. The point symbol (**p**)
only takes a color fill which we can define via the ``color`` parameter. For
only takes a color fill which we can define via the ``fill`` parameter. For
the remaining symbols we may define a linewidth as well as a color fill.

"""
Expand Down Expand Up @@ -36,31 +36,31 @@
# use a star (a) with a size of 0.9 cm,
# linewidth is set to 1p, the linecolor to "black" (default) and the
# color fill to "darkorange"
fig.plot(x=3, y=y, style="a0.9c", pen="1p,black", color="darkorange")
fig.plot(x=3, y=y, style="a0.9c", pen="1p,black", fill="darkorange")
fig.text(x=3, y=y + 0.6, text="a", font=font)

# use a circle (c) with a size of 0.9 cm,
# linewidth is set to 1p, the linecolor to "black" and the
# color fill to "darkred"
fig.plot(x=4, y=y, style="c0.9c", pen="1p,black", color="darkred")
fig.plot(x=4, y=y, style="c0.9c", pen="1p,black", fill="darkred")
fig.text(x=4, y=y + 0.6, text="c", font=font)

# use a diamond (d) with a size of 0.9 cm,
# linewidth is set to 1p, the linecolor to "black" and the
# color fill to "seagreen"
fig.plot(x=5, y=y, style="d0.9c", pen="1p,black", color="seagreen")
fig.plot(x=5, y=y, style="d0.9c", pen="1p,black", fill="seagreen")
fig.text(x=5, y=y + 0.6, text="d", font=font)

# use a octagon (g) with a size of 0.9 cm,
# linewidth is set to 1p, the linecolor to "black" and the
# color fill to "dodgerblue4"
fig.plot(x=6, y=y, style="g0.9c", pen="1p,black", color="dodgerblue4")
fig.plot(x=6, y=y, style="g0.9c", pen="1p,black", fill="dodgerblue4")
fig.text(x=6, y=y + 0.6, text="g", font=font)

# use a hexagon (h) with a size of 0.9 cm,
# linewidth is set to 1p, the linecolor to "black" and the
# color fill to "lightgray"
fig.plot(x=7, y=y, style="h0.9c", pen="1p,black", color="lightgray")
fig.plot(x=7, y=y, style="h0.9c", pen="1p,black", fill="lightgray")
fig.text(x=7, y=y + 0.6, text="h", font=font)

# lower row
Expand All @@ -69,30 +69,30 @@
# use an inverted triangle (i) with a size of 0.9 cm,
# linewidth is set to 1p, the linecolor to "black" and the
# color fill to "tomato"
fig.plot(x=1, y=y, style="i0.9c", pen="1p,black", color="tomato")
fig.plot(x=1, y=y, style="i0.9c", pen="1p,black", fill="tomato")
fig.text(x=1, y=y + 0.6, text="i", font=font)

# use pentagon (n) with a size of 0.9 cm,
# linewidth is set to 1p, the linecolor to "black" and the
# color fill to "lightseagreen"
fig.plot(x=2, y=y, style="n0.9c", pen="1p,black", color="lightseagreen")
fig.plot(x=2, y=y, style="n0.9c", pen="1p,black", fill="lightseagreen")
fig.text(x=2, y=y + 0.6, text="n", font=font)

# use a point (p) with a size of 0.9 cm,
# color fill is set to "lightseagreen"
fig.plot(x=3, y=y, style="p0.9c", color="slateblue")
fig.plot(x=3, y=y, style="p0.9c", fill="slateblue")
fig.text(x=3, y=y + 0.6, text="p", font=font)

# use square (s) with a size of 0.9 cm,
# linewidth is set to 1p, the linecolor to "black" and the
# color fill to "gold2"
fig.plot(x=4, y=y, style="s0.9c", pen="1p,black", color="gold2")
fig.plot(x=4, y=y, style="s0.9c", pen="1p,black", fill="gold2")
fig.text(x=4, y=y + 0.6, text="s", font=font)

# use triangle (t) with a size of 0.9 cm,
# linewidth is set to 1p, the linecolor to "black" and the
# color fill to "magenta4"
fig.plot(x=5, y=y, style="t0.9c", pen="1p,black", color="magenta4")
fig.plot(x=5, y=y, style="t0.9c", pen="1p,black", fill="magenta4")
fig.text(x=5, y=y + 0.6, text="t", font=font)

# use cross (x) with a size of 0.9 cm,
Expand Down
10 changes: 5 additions & 5 deletions examples/gallery/symbols/custom_symbols.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,27 +21,27 @@

# use the volcano symbol with a size of 1.5c,
# fill color is set to "seagreen"
fig.plot(x=1, y=1.25, style="kvolcano/1.5c", pen=pen, color="seagreen")
fig.plot(x=1, y=1.25, style="kvolcano/1.5c", pen=pen, fill="seagreen")
fig.text(x=1, y=2.5, text="volcano", font=font)

# use the astroid symbol with a size of 1.5c,
# fill color is set to "red3"
fig.plot(x=2.5, y=1.25, style="kastroid/1.5c", pen=pen, color="red3")
fig.plot(x=2.5, y=1.25, style="kastroid/1.5c", pen=pen, fill="red3")
fig.text(x=2.5, y=2.5, text="astroid", font=font)

# use the flash symbol with a size of 1.5c,
# fill color is set to "darkorange"
fig.plot(x=4, y=1.25, style="kflash/1.5c", pen=pen, color="darkorange")
fig.plot(x=4, y=1.25, style="kflash/1.5c", pen=pen, fill="darkorange")
fig.text(x=4, y=2.5, text="flash", font=font)

# use the star4 symbol with a size of 1.5c,
# fill color is set to "dodgerblue4"
fig.plot(x=5.5, y=1.25, style="kstar4/1.5c", pen=pen, color="dodgerblue4")
fig.plot(x=5.5, y=1.25, style="kstar4/1.5c", pen=pen, fill="dodgerblue4")
fig.text(x=5.5, y=2.5, text="star4", font=font)

# use the hurricane symbol with a size of 1.5c,
# fill color is set to "magenta4"
fig.plot(x=7, y=1.25, style="khurricane/1.5c", pen=pen, color="magenta4")
fig.plot(x=7, y=1.25, style="khurricane/1.5c", pen=pen, fill="magenta4")
fig.text(x=7, y=2.5, text="hurricane", font=font)

fig.show()
8 changes: 4 additions & 4 deletions examples/gallery/symbols/datetime_inputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@
# numpy.datetime64 types
x = np.array(["2010-06-01", "2011-06-01T12", "2012-01-01T12:34:56"], dtype="datetime64")
y = [1, 2, 3]
fig.plot(x=x, y=y, style="c0.4c", pen="1p", color="red3")
fig.plot(x=x, y=y, style="c0.4c", pen="1p", fill="red3")

# pandas.DatetimeIndex
x = pd.date_range("2013", periods=3, freq="YS")
y = [4, 5, 6]
fig.plot(x=x, y=y, style="t0.4c", pen="1p", color="gold")
fig.plot(x=x, y=y, style="t0.4c", pen="1p", fill="gold")

# xarray.DataArray
x = xr.DataArray(data=pd.date_range(start="2015-03", periods=3, freq="QS"))
Expand All @@ -56,11 +56,11 @@
# raw datetime strings
x = ["2016-02-01", "2016-06-04T14", "2016-10-04T00:00:15"]
y = [7, 8, 9]
fig.plot(x=x, y=y, style="a0.4c", pen="1p", color="dodgerblue")
fig.plot(x=x, y=y, style="a0.4c", pen="1p", fill="dodgerblue")

# the Python built-in datetime and date
x = [datetime.date(2018, 1, 1), datetime.datetime(2019, 6, 1, 20, 5, 45)]
y = [6.5, 4.5]
fig.plot(x=x, y=y, style="i0.4c", pen="1p", color="seagreen")
fig.plot(x=x, y=y, style="i0.4c", pen="1p", fill="seagreen")

fig.show()
20 changes: 10 additions & 10 deletions examples/gallery/symbols/multi_parameter_symbols.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@
fig.basemap(region=[0, 6, 0, 2], projection="x3c", frame=True)

# Ellipse
fig.plot(x=0.5, y=1, style="e45/3/1", color="orange", pen="2p,black")
fig.plot(x=0.5, y=1, style="e45/3/1", fill="orange", pen="2p,black")
# Rotated rectangle
fig.plot(x=1.5, y=1, style="j120/5/0.5", color="red3", pen="2p,black")
fig.plot(x=1.5, y=1, style="j120/5/0.5", fill="red3", pen="2p,black")
# Rectangle
fig.plot(x=3, y=1, style="r4/1.5", color="dodgerblue", pen="2p,black")
fig.plot(x=3, y=1, style="r4/1.5", fill="dodgerblue", pen="2p,black")
# Rounded rectangle
fig.plot(x=4.5, y=1, style="R1.25/4/0.5", color="seagreen", pen="2p,black")
fig.plot(x=4.5, y=1, style="R1.25/4/0.5", fill="seagreen", pen="2p,black")
# Pie wedge
fig.plot(x=5.5, y=1, style="w2.5/45/330", color="lightgray", pen="2p,black")
fig.plot(x=5.5, y=1, style="w2.5/45/330", fill="lightgray", pen="2p,black")

fig.show()

Expand All @@ -72,18 +72,18 @@

# Ellipse
data = [[0.5, 1, 45, 3, 1], [0.5, 3, 135, 2, 1]]
fig.plot(data=data, style="e", color="orange", pen="2p,black")
fig.plot(data=data, style="e", fill="orange", pen="2p,black")
# Rotated rectangle
data = [[1.5, 1, 120, 5, 0.5], [1.5, 3, 50, 3, 0.5]]
fig.plot(data=data, style="j", color="red3", pen="2p,black")
fig.plot(data=data, style="j", fill="red3", pen="2p,black")
# Rectangle
data = [[3, 1, 4, 1.5], [3, 3, 3, 1.5]]
fig.plot(data=data, style="r", color="dodgerblue", pen="2p,black")
fig.plot(data=data, style="r", fill="dodgerblue", pen="2p,black")
# Rounded rectangle
data = [[4.5, 1, 1.25, 4, 0.5], [4.5, 3, 1.25, 2.0, 0.2]]
fig.plot(data=data, style="R", color="seagreen", pen="2p,black")
fig.plot(data=data, style="R", fill="seagreen", pen="2p,black")
# Pie wedge
data = [[5.5, 1, 2.5, 45, 330], [5.5, 3, 1.5, 60, 300]]
fig.plot(data=data, style="w", color="lightgray", pen="2p,black")
fig.plot(data=data, style="w", fill="lightgray", pen="2p,black")

fig.show()
2 changes: 1 addition & 1 deletion examples/gallery/symbols/points.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@
# data region
fig.basemap(region=region, projection="X15c", frame=True)
# Plot using inverted triangles (i) of 0.5 cm size
fig.plot(x=x, y=y, style="i0.5c", color="black")
fig.plot(x=x, y=y, style="i0.5c", fill="black")
fig.show()
2 changes: 1 addition & 1 deletion examples/gallery/symbols/points_categorical.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
# scaled by 7.5*10e-5)
size=df.body_mass_g * 7.5e-5,
# Points colored by categorical number code
color=df.species.cat.codes.astype(int),
fill=df.species.cat.codes.astype(int),
# Use colormap created by makecpt
cmap=True,
# Do not clip symbols that fall close to the map bounds
Expand Down
2 changes: 1 addition & 1 deletion examples/gallery/symbols/points_transparency.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@
frame=["xaf+lTransparency level+u%", "WSrt"],
projection="X15c/6c",
)
fig.plot(x=x, y=y, style="c0.6c", color="blue", pen="1p,red", transparency=transparency)
fig.plot(x=x, y=y, style="c0.6c", fill="blue", pen="1p,red", transparency=transparency)
fig.show()
6 changes: 3 additions & 3 deletions examples/gallery/symbols/scatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
projection="X10c/10c",
frame=["xa0.2fg", "ya0.2fg", "WSrt"],
)
for color in ["gray73", "darkorange", "slateblue"]:
for fill in ["gray73", "darkorange", "slateblue"]:
x, y = np.random.rand(2, n) # random X and Y data in [0,1]
size = np.random.rand(n) * 0.5 # random size [0,0.5], in cm
# plot data points as circles (style="c"), with different sizes
Expand All @@ -30,10 +30,10 @@
y=y,
style="c",
size=size,
color=color,
fill=fill,
# Set the legend label,
# and set the symbol size to be 0.25 cm (+S0.25c) in legend
label=f"{color}+S0.25c",
label=f"{fill}+S0.25c",
transparency=50, # set transparency level for all symbols
)

Expand Down
Loading