-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplot_color_dicts.py
More file actions
55 lines (45 loc) · 1.92 KB
/
Copy pathplot_color_dicts.py
File metadata and controls
55 lines (45 loc) · 1.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
'''
Two sets of colors for graphing. Subsets derived from the following references:
Robert M. Boynton. (1989)
Eleven Colors That Are Almost Never Confused.
Proc. SPIE 1077, Human Vision, Visual Processing, and Digital Display, 322-332.
http://doi.org/10.1117/12.952730
Kelly, K. L. (1965).
Twenty-two colors of maximum
contrast. Color Engineering, 3(26), 26–27.
Paul Green-Armytage (2010)
A colour alphabet and the limits of colour coding.
Colour: Design & Creativity, 5:1–23.
https://eleanormaclure.files.wordpress.com/2011/03/colour-coding.pdf
'''
#Subset of Boynton's list of "11 colors that are almost never confused"
boynton_cmap = {'Blue':(0.0, 0.0, 1.0),
'Red':(1.0, 0.0, 0.0),
'Green':(0.0, 1.0, 0.0),
'Yellow':(1.0, 1.0, 0.0),
'Magenta':(1.0, 0.0, 1.0),
'Pink':(1.0, 0.5, 0.5),
'Gray':(0.5, 0.5, 0.5),
'Brown':(0.5, 0.0, 0.0),
'Orange':(1.0, 0.5, 0.0),}
#Subset of Kelly's "22 colors of maximum contrast"
kelly_cmap = {'Vivid Yellow':'#FFB300',
'Strong Purple':'#803E75',
'Vivid Orange':'#FF6800',
'Very Light Blue':'#A6BDD7',
'Vivid Red':'#C10020',
'Grayish Yellow':'#CEA262',
'Medium Gray':'#817066'}
#The six colors I use most often for simple plots on a white background
color_map = ["#0000FF", "#FF0000", "#FFB300", "#808080", "#803E75", "#FF6800"]
# Updated for deuteranopia (removed "#FF6800"; replaced with "#FF7F7F" pink from Boynton colors)
color_map1 = ["#0000FF", "#FF0000", "#FFB300", "#808080", "#803E75", "#FF7F7F"]
#Plot the colors using matplotlib
import matplotlib.pyplot as plt
fig,ax = plt.subplots(1,figsize=(8, 1), dpi=40)
xdat = range(0,(len(color_map)))
ydat = [1 for x in xdat]
plt.scatter(xdat, ydat, color=color_map, s=1e3)
ax.set_yticklabels([])
print("color_map")
plt.show()