Skip to content

Instantly share code, notes, and snippets.

@cyan8810
Last active January 21, 2018 05:00
Show Gist options
  • Save cyan8810/5a98be1883217da04ae3064e946fe44b to your computer and use it in GitHub Desktop.
Save cyan8810/5a98be1883217da04ae3064e946fe44b to your computer and use it in GitHub Desktop.
matplotlib, mathematica, matlabでデフォルトで使用されるブルーの比較
import matplotlib.pyplot as plt
LINEWIDTH = 10
FONTSIZE = 14
SHIFT = 0.5
DPI = 600
def main():
fig = plt.figure()
ax = fig.add_subplot(111)
# Mathematica
ax.plot([0, 1], [1, 1], color=[0.368, 0.507, 0.710], linewidth=LINEWIDTH)
ax.text(1.0, 1 - SHIFT, 'Mathematica', horizontalalignment='right', fontsize=FONTSIZE)
# Matplotlib
ax.plot([0, 1], [2, 2], color=[0.122, 0.467, 0.706], linewidth=LINEWIDTH)
ax.text(1.0, 2 - SHIFT, 'Matplotlib', horizontalalignment='right', fontsize=FONTSIZE)
# Matlab
ax.plot([0, 1], [3, 3], color=[0, 0.447, 0.741], linewidth=LINEWIDTH)
ax.text(1.0, 3 - SHIFT, 'Matlab', horizontalalignment='right', fontsize=FONTSIZE)
# Blue (for comparison)
ax.plot([0, 1], [5, 5], color=[0, 0, 1], linewidth=LINEWIDTH)
ax.text(1.0, 5 - SHIFT, 'Blue', horizontalalignment='right', fontsize=FONTSIZE)
ax.set_ylim(0, 6)
ax.tick_params(labelbottom="off", bottom="off", labelleft="off", left="off")
ax.spines["right"].set_color("none")
ax.spines["left"].set_color("none")
ax.spines["top"].set_color("none")
ax.spines["bottom"].set_color("none")
fig.savefig('default_blue', dpi=DPI, bbox_inches='tight')
if __name__ == '__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment