Skip to content

Commit

Permalink
more scatter examples
Browse files Browse the repository at this point in the history
  • Loading branch information
jkrumbiegel committed May 26, 2024
1 parent 9022404 commit 44fdbc2
Showing 1 changed file with 62 additions and 1 deletion.
63 changes: 62 additions & 1 deletion src/basic_recipes/makiecore_examples/scatter.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,44 @@
function attribute_examples(::Type{Scatter})
Dict(
:color => [
Example(
code = """
fig = Figure()
kwargs = (; markersize = 30, axis = (; limits = (0, 4, 0, 4)))
scatter(fig[1, 1], 1:3; kwargs..., color = :tomato)
scatter(fig[1, 2], 1:3; kwargs..., color = [RGBf(1, 0, 0), RGBf(0, 1, 0), RGBf(0, 0, 1)])
scatter(fig[2, 1], 1:3; kwargs..., color = [10, 20, 30])
scatter(fig[2, 2], 1:3; kwargs..., color = [10, 20, 30], colormap = :plasma)
fig
"""
)
],
:colormap => [
Example(
code = """
fig = Figure()
kwargs = (; markersize = 30, axis = (; limits = (0, 6, 0, 6)))
scatter(fig[1, 1], 1:5; kwargs..., color = 1:5, colormap = :viridis)
scatter(fig[1, 2], 1:5; kwargs..., color = 1:5, colormap = :plasma)
scatter(fig[2, 1], 1:5; kwargs..., color = 1:5, colormap = Reverse(:viridis))
scatter(fig[2, 2], 1:5; kwargs..., color = 1:5, colormap = [:tomato, :slategray2])
fig
"""
)
],
:markersize => [
Example(
code = """
fig = Figure()
kwargs = (; marker = Rect, axis = (; limits = (0, 4, 0, 4)))
scatter(fig[1, 1], 1:3; kwargs..., markersize = 30)
scatter(fig[1, 2], 1:3; kwargs..., markersize = (30, 20))
scatter(fig[2, 1], 1:3; kwargs..., markersize = [10, 20, 30])
scatter(fig[2, 2], 1:3; kwargs..., markersize = [(10, 20), (20, 30), (40, 30)])
fig
"""
)
],
:rotation => [
Example(
code = """
Expand All @@ -11,6 +50,28 @@ function attribute_examples(::Type{Scatter})
fig
"""
)
]
],
:strokecolor => [
Example(
code = """
fig = Figure()
kwargs = (; markersize = 30, strokewidth = 3)
scatter(fig[1, 1], 1:3; kwargs..., strokecolor = :tomato)
scatter(fig[1, 2], 1:3; kwargs..., strokecolor = [RGBf(1, 0, 0), RGBf(0, 1, 0), RGBf(0, 0, 1)])
fig
"""
)
],
:strokewidth => [
Example(
code = """
fig = Figure()
kwargs = (; markersize = 30, strokecolor = :tomato)
scatter(fig[1, 1], 1:3; kwargs..., strokewidth = 3)
scatter(fig[1, 2], 1:3; kwargs..., strokewidth = [0, 3, 6])
fig
"""
)
],
)
end

0 comments on commit 44fdbc2

Please sign in to comment.