From 5071118e4771d60ef25b5c76effe36fe0ba635c7 Mon Sep 17 00:00:00 2001 From: zjcOvO Date: Thu, 23 Jan 2025 22:36:02 +0800 Subject: [PATCH] designed unified color --- color/config.json | 38 ++++++++++++++++++++++++++++++++++++++ color/usage.py | 15 +++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 color/config.json create mode 100644 color/usage.py diff --git a/color/config.json b/color/config.json new file mode 100644 index 0000000..57fb412 --- /dev/null +++ b/color/config.json @@ -0,0 +1,38 @@ +{ + "color_pool":[ + "#ec6941", + "#f19149", + "#f8b551", + "#fff45c", + "#b3d465", + "#80c269", + "#32b16c", + "#13b5b1", + "#00b7ee", + "#448aca", + "#556fb5", + "#5f52a0", + "#8957a1", + "#ae5da1", + "#ea68a2", + "#eb6877" + ], + "color":[ + "#ec6941", + "#80c269", + "#448aca", + "#ea68a2", + "#f8b551", + "#13b5b1", + "#5f52a0", + "#eb6877", + "#fff45c", + "#00b7ee", + "#8957a1", + "#f19149", + "#32b16c", + "#556fb5", + "#ae5da1", + "#b3d465" + ] +} \ No newline at end of file diff --git a/color/usage.py b/color/usage.py new file mode 100644 index 0000000..2130c21 --- /dev/null +++ b/color/usage.py @@ -0,0 +1,15 @@ +import json +import numpy as np +import matplotlib.pyplot as plt + +colorList = json.load(open('config.json','r'))["color"] + +N=5 + +data = [ np.random.randn(19)/3 + N - i for i in range(N)] + +for i in range(N): + plt.plot(data[i], color=colorList[i]) + +plt.legend(['data1', 'data2', 'data3', 'data4', 'data5']) +plt.show()