From 90585ad49df90699e01ff4c7ef1cf1067e9a32d1 Mon Sep 17 00:00:00 2001 From: Vitor Gratiere Torres <26410338+vitorgt@users.noreply.github.com> Date: Sat, 6 Mar 2021 14:41:55 -0300 Subject: [PATCH 1/4] Accessible colors for color blindness https://github.com/GenericMappingTools/pygmt/issues/1011 --- examples/gallery/plot/scatter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/gallery/plot/scatter.py b/examples/gallery/plot/scatter.py index 2d3199b35c8..6dcb1778840 100644 --- a/examples/gallery/plot/scatter.py +++ b/examples/gallery/plot/scatter.py @@ -21,7 +21,7 @@ projection="X10c/10c", frame=["xa0.2fg", "ya0.2fg", "WSrt"], ) -for color in ["blue", "orange", "green"]: +for color in ["seagreen2", "chocolate1", "mediumpurple1"]: x, y = np.random.rand(2, n) # random X and Y data in [0,1] sizes = np.random.rand(n) * 0.5 # random size [0,0.5], in cm # plot data points as circles (style="c"), with different sizes From 2b235ea4dcf937535e1eb24545dc3b6f95a17268 Mon Sep 17 00:00:00 2001 From: Vitor Gratiere Torres <26410338+vitorgt@users.noreply.github.com> Date: Sun, 7 Mar 2021 16:08:41 -0300 Subject: [PATCH 2/4] change colors, add different symbols Colors chosen based on (https://colorbrewer2.org/#type=qualitative&scheme=Dark2&n=3) --- examples/gallery/plot/scatter.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/gallery/plot/scatter.py b/examples/gallery/plot/scatter.py index 6dcb1778840..78b0f92f5b6 100644 --- a/examples/gallery/plot/scatter.py +++ b/examples/gallery/plot/scatter.py @@ -21,19 +21,19 @@ projection="X10c/10c", frame=["xa0.2fg", "ya0.2fg", "WSrt"], ) -for color in ["seagreen2", "chocolate1", "mediumpurple1"]: +for color, style in [("gray73", "c"), ("darkorange", "s"), ("slateblue", "t")]: x, y = np.random.rand(2, n) # random X and Y data in [0,1] sizes = np.random.rand(n) * 0.5 # random size [0,0.5], in cm # plot data points as circles (style="c"), with different sizes fig.plot( x=x, y=y, - style="c", + style=style, sizes=sizes, color=color, # Set the legend label, - # and set the circle size to be 0.25 cm (+S0.25c) in legend - label=f"{color}+S0.25c", + # and set the style size to be 0.25 cm (+S0.25{style}) in legend + label=f"{color}+S0.25{style}", transparency=70, # set transparency level for all symbols ) From d1bafa14018940f80e44f1e77feb5c56d39b025a Mon Sep 17 00:00:00 2001 From: Vitor Gratiere Torres <26410338+vitorgt@users.noreply.github.com> Date: Tue, 6 Apr 2021 20:27:15 -0300 Subject: [PATCH 3/4] remove style change; more opaque symbols --- examples/gallery/plot/scatter.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/gallery/plot/scatter.py b/examples/gallery/plot/scatter.py index 78b0f92f5b6..1631c306a9f 100644 --- a/examples/gallery/plot/scatter.py +++ b/examples/gallery/plot/scatter.py @@ -21,20 +21,20 @@ projection="X10c/10c", frame=["xa0.2fg", "ya0.2fg", "WSrt"], ) -for color, style in [("gray73", "c"), ("darkorange", "s"), ("slateblue", "t")]: +for color in ["gray73", "darkorange", "slateblue"]: x, y = np.random.rand(2, n) # random X and Y data in [0,1] sizes = np.random.rand(n) * 0.5 # random size [0,0.5], in cm # plot data points as circles (style="c"), with different sizes fig.plot( x=x, y=y, - style=style, + style="c", sizes=sizes, color=color, # Set the legend label, - # and set the style size to be 0.25 cm (+S0.25{style}) in legend - label=f"{color}+S0.25{style}", - transparency=70, # set transparency level for all symbols + # and set the symbol size to be 0.25 cm (+S0.25c) in legend + label=f"{color}+S0.25c", + transparency=50, # set transparency level for all symbols ) fig.legend(transparency=30) # set transparency level for legends From 85611b29b435ee9958f3bdbe11979e7ddd7202d2 Mon Sep 17 00:00:00 2001 From: Vitor Gratiere Torres <26410338+vitorgt@users.noreply.github.com> Date: Sat, 10 Apr 2021 16:26:27 -0300 Subject: [PATCH 4/4] move plot/scatter.py to symbols/scatter.py --- examples/gallery/{plot => symbols}/scatter.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename examples/gallery/{plot => symbols}/scatter.py (100%) diff --git a/examples/gallery/plot/scatter.py b/examples/gallery/symbols/scatter.py similarity index 100% rename from examples/gallery/plot/scatter.py rename to examples/gallery/symbols/scatter.py