Skip to content

Commit bea4b94

Browse files
committed
add my new black -> red/green/blue colormaps
1 parent 63296a7 commit bea4b94

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

src/abg_python/plot_utils.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1267,3 +1267,22 @@ def clean_savefig(fig,figname,width,height,plotdir=None,savefig_flag=True):
12671267
print('skipping saving')
12681268
return
12691269
fig.savefig(os.path.join(plotdir,figname),bbox_inches='tight')
1270+
1271+
1272+
from matplotlib.colors import LinearSegmentedColormap
1273+
minor = [(0.0, 0.0, 0.0),
1274+
(0.7, 0.0, 0.0),
1275+
(1.0, .5, 0.0)]
1276+
major = [(0.0, 0.0, 0.0),
1277+
(0.1, 0.3, 0.3),
1278+
(1.0, 1.0, 0.0)]
1279+
1280+
cmaps = []
1281+
colors = ['red','green','blue']
1282+
for color in colors:
1283+
cdict = {color:major,**dict([(subcolor,minor) for subcolor in colors if subcolor !=color])}
1284+
cmaps += [LinearSegmentedColormap('Blk'+color.title(),cdict)]
1285+
1286+
BlkRed = cmaps[0]
1287+
BlkGreen = cmaps[1]
1288+
BlkBlue = cmaps[2]

0 commit comments

Comments
 (0)