Colors in ODSCharts¶
If no colors are specified in ODSCharts, curves will be assigned color from one of two color tables, the Excel Default Color Table or the Alternate Color Table (see below).
In the add_scatter
call, the option excel_colors=True
selects the Excel table whereas
excel_colors=False
selects the Alternate.
Because Excel does not support marker colors in ods files, ODSCharts defaults to
using the Excel color table so that the marker colors
will match when opened in Excel. (i.e. excel_colors=True
)
LibreOffice and OpenOffice will properly support any specified colors, so the Alternate Table may
be preferred when using LibreOffice or OpenOffice (i.e. excel_colors=False
)
Users may also assign colors to each curve.
When using add_scatter
or add_curve
to create curves on a plot, the two inputs
colorL
and color2L
will specify colors desired for primary or secondary Y Axis.
The python snippet below, for example, will make the first 5 primary Y Axis curves red, cyan, grey, #6699AA and darkgreen respectively.
xcol = 1,
ycolL=[2,3,4,5,6],
colorL=['r','cyan','GRaY','#69a','#006400']
Any color not recognized by name should be input in “#AACCFF” format.
Some common colors such as red, green or blue can be specified in shorthand as r, g or b. (see Short Name Color Table below)
Excel Default Color Table
#325885 | #873331 | #6B833A | #574271 | #2F788C | #B0672B |
#3C679A | #9D3D3A | #7D9844 | #664E83 | #388CA2 | #CB7833 |
#4373AB | #AE4441 | #8BA94D | #725792 | #3F9BB4 | #E1853A |
#4A7EBB | #BE4B48 | #98B954 | #7D60A0 | #46AAC5 | #F69240 |
#809CC7 | #CA817F | #AEC685 | #9C8BB3 | #7EBACE | #F6A97B |
#A5B6D3 | #D5A5A4 | #C1D2A7 | #B6ABC5 | #A4CAD8 | #F6BEA2 |
Short Name Color Table
b blue #0000FF |
c cyan #00FFFF |
db darkblue #00008B |
dc darkcyan #008B8B |
dg darkgreen #006400 |
dk darkkhaki #BDB76B |
dm darkmagenta #8B008B |
do darkolivegreen #556B2F |
dr darkred #8B0000 |
ds darksalmon #E9967A |
dv darkviolet #9400D3 |
f firebrick #B22222 |
g green #008000 |
i indigo #4B0082 |
k black #000000 |
m magenta #FF00FF |
n navy #000080 |
o olive #808000 |
p purple #800080 |
r red #FF0000 |
s sienna #A0522D |
t tan #D2B48C |
v violet #EE82EE |
y yellow #FFFF00 |
Alternate Color Table
red #FF0000 |
green #008000 |
blue #0000FF |
cyan #00FFFF |
magenta #FF00FF |
olive #808000 |
brown #A52A2A |
gold #FFD700 |
coral #FF7F50 |
darkred #8B0000 |
darkgreen #006400 |
darkblue #00008B |
indigo #4B0082 |
firebrick #B22222 |
yellow #FFFF00 |
darkolivegreen #556B2F |
darkseagreen #8FBC8F |
mediumvioletred #C71585 |
mediumorchid #BA55D3 |
chartreuse #7FFF00 |
mediumslateblue #7B68EE |
black #000000 |
springgreen #00FF7F |
crimson #DC143C |
lightsalmon #FFA07A |
turquoise #40E0D0 |
olivedrab #6B8E23 |
silver #C0C0C0 |
skyblue #87CEEB |
gray #808080 |
darkturquoise #00CED1 |
goldenrod #DAA520 |
darkviolet #9400D3 |
darkgray #A9A9A9 |
lightpink #FFB6C1 |
teal #008080 |
darkmagenta #8B008B |
lightgoldenrodyellow #FAFAD2 |
lavender #E6E6FA |
yellowgreen #9ACD32 |
thistle #D8BFD8 |
violet #EE82EE |
navy #000080 |
orchid #DA70D6 |
ghostwhite #F8F8FF |
honeydew #F0FFF0 |
cornflowerblue #6495ED |
purple #800080 |
darkkhaki #BDB76B |
mediumpurple #9370DB |
cornsilk #FFF8DC |
bisque #FFE4C4 |
slategray #708090 |
darkcyan #008B8B |
khaki #F0E68C |
wheat #F5DEB3 |
deepskyblue #00BFFF |
steelblue #4682B4 |
aliceblue #F0F8FF |
gainsboro #DCDCDC |
mediumturquoise #48D1CC |
floralwhite #FFFAF0 |
plum #DDA0DD |
aqua #00FFFF |
lightcyan #E0FFFF |
darksalmon #E9967A |
beige #F5F5DC |
azure #F0FFFF |
lightsteelblue #B0C4DE |
oldlace #FDF5E6 |
greenyellow #ADFF2F |
royalblue #4169E1 |
lightseagreen #20B2AA |
sienna #A0522D |
lightcoral #F08080 |
orangered #FF4500 |
navajowhite #FFDEAD |
lime #00FF00 |
palegreen #98FB98 |
mistyrose #FFE4E1 |
seashell #FFF5EE |
mediumspringgreen #00FA9A |
fuchsia #FF00FF |
blanchedalmond #FFEBCD |
peru #CD853F |
aquamarine #7FFFD4 |
white #FFFFFF |
darkslategray #2F4F4F |
ivory #FFFFF0 |
dodgerblue #1E90FF |
lemonchiffon #FFFACD |
burlywood #DEB887 |
orange #FFA500 |
forestgreen #228B22 |
slateblue #6A5ACD |
mintcream #F5FFFA |
antiquewhite #FAEBD7 |
darkorange #FF8C00 |
hotpink #FF69B4 |
moccasin #FFE4B5 |
limegreen #32CD32 |
saddlebrown #8B4513 |
grey #808080 |
darkslateblue #483D8B |
lightskyblue #87CEFA |
deeppink #FF1493 |
lightgrey #D3D3D3 |
darkgoldenrod #B8860B |
maroon #800000 |
lightgreen #90EE90 |
sandybrown #FAA460 |
tan #D2B48C |
rosybrown #BC8F8F |
pink #FFC0CB |
lightblue #ADD8E6 |
palevioletred #AFEEEE |
mediumseagreen #3CB371 |
dimgray #696969 |
powderblue #B0E0E6 |
seagreen #2E8B57 |
snow #FFFAFA |
mediumblue #0000CD |
midnightblue #191970 |
palegoldenrod #EEE8AA |
whitesmoke #F5F5F5 |
darkorchid #9932CC |
salmon #FA8072 |
lightslategray #778899 |
lawngreen #7CFC00 |
chocolate #D2691E |
tomato #FF6347 |
cadetblue #5F9EA0 |
lightyellow #FFFFE0 |
lavenderblush #FFF0F5 |
linen #FAF0E6 |
mediumaquamarine #66CDAA |
blueviolet #8A2BE2 |