-
Notifications
You must be signed in to change notification settings - Fork 224
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
Use colorblind-friendly colors in the scatter plots gallery example #1013
Changes from 2 commits
90585ad
2b235ea
c6d0936
44d090b
d1bafa1
85611b2
e20c030
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -21,19 +21,19 @@ | |||||
projection="X10c/10c", | ||||||
frame=["xa0.2fg", "ya0.2fg", "WSrt"], | ||||||
) | ||||||
for color in ["blue", "orange", "green"]: | ||||||
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 | ||||||
seisman marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
label=f"{color}+S0.25{style}", | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See the warning at https://pygmt-ln1ssu8ap-gmt.vercel.app/gallery/plot/scatter.html#sphx-glr-gallery-plot-scatter-py:
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thank you so much, and I'm sorry, I didn't know that, I thought it was the symbol to show, not the size in cm. Appreciated. |
||||||
transparency=70, # set transparency level for all symbols | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Perhaps 50 gives a better result. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, please try 50, i.e. less transparency (more opaque). See also #1013 (comment). |
||||||
) | ||||||
|
||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.