From 44fdbc28812ff9681ac051489c879b59079a0ad3 Mon Sep 17 00:00:00 2001 From: Julius Krumbiegel Date: Sun, 26 May 2024 10:36:34 +0200 Subject: [PATCH] more scatter examples --- .../makiecore_examples/scatter.jl | 63 ++++++++++++++++++- 1 file changed, 62 insertions(+), 1 deletion(-) diff --git a/src/basic_recipes/makiecore_examples/scatter.jl b/src/basic_recipes/makiecore_examples/scatter.jl index 7394abae614..f228ae4e742 100644 --- a/src/basic_recipes/makiecore_examples/scatter.jl +++ b/src/basic_recipes/makiecore_examples/scatter.jl @@ -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 = """ @@ -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 \ No newline at end of file