1 自定义绘图风格文件
1.1 编写格式参考
matplotlib
自带配置文件,其路径为:~\Anaconda3\envs\Python37\Lib\site-packages\matplotlib\mpl-data\matplotlibrc
matplotlib
自带风格文件(如:ggplot
,seaborn-colorblind
,seaborn-poster
等),其路径为:~\Anaconda3\envs\Python37\Lib\site-packages\matplotlib\mpl-data\stylelib
1.2 绘图风格文件
1.2.1 Robert-paper.mplstyle
文件名称:Robert-paper.mplstyle
风格名称:Robert-paper
文件内容:
## Color format
# scalar grayscale intensity: range is 0 to 1, 0 is black
# matplotlib color string, such as r, k, or b
# rgb tuple, such as (1.0, 0.5, 0.0)
# hex string, such as ff00ff (Fuchsia/Magenta). Each two characters represent the values of R, G and B.
# legal html color name, e.g., red, blue, darkslategray
## Fontsize
# Special text sizes can be defined relative to font.size, using the following values: xx-small, x-small, small, medium, large, x-large, xx-large, larger, or smaller
# Lines properties
lines.linewidth: 1.5
lines.markersize: 7
lines.markeredgewidth: 0
lines.solid_capstyle: round # butt|round|projecting
# Text properties
font.family: sans-serif
font.sans-serif: SimHei, DejaVu Sans, Bitstream Vera Sans, Computer Modern Sans Serif, Lucida Grande, Verdana, Geneva, Lucid, Arial, sans-serif
font.size: 10.0
text.color: 0
# Axes properties
axes.unicode_minus: False # If True, use unicode for the minus symbol rather than hyphen. Setting it as False can solve the problem that minus can't display in figure.
axes.facecolor: white
axes.edgecolor: black
axes.linewidth: 1
axes.titlesize: x-large
axes.labelsize: large
axes.labelcolor: 0
axes.axisbelow: True # grid/ticks are below elements (e.g., lines, text)
axes.prop_cycle: cycler('color', ['D62728', '1F77B4', 'FF7F0E', '2CA02C', 'BCBD22', '9467BD', '8C564B', '777777', '000000', 'E24A33', '348ABD', '8EBA42', 'FBC15E', 'FFB5B8', '988ED5', '17BECF'])
# D62728 : red
# 1F77B4 : marine blue
# FF7F0E : light orange
# 2CA02C : forestgreen
# BCBD22 : green yellow
# 9467BD : medium purple
# 8C564B : sienna
# 777777 : gray
# 000000 : black
# E24A33 : orangered
# 348ABD : blue
# 8EBA42 : green
# FBC15E : earthy yellow
# FFB5B8 : pink
# 988ED5 : lilac
# 17BECF : cyan
xtick.color: 0
xtick.direction: in
xtick.labelsize: 10 # fontsize of the tick labels
xtick.major.pad: 3.5 # distance to major tick label in points
xtick.minor.pad: 3.5 # distance to the minor tick label in points
xtick.major.size: 3.5 # major tick size in points
xtick.minor.size: 2 # minor tick size in points
xtick.major.width: 0.8 # major tick width in points
xtick.minor.width: 0.6 # minor tick width in points
ytick.color: 0
ytick.direction: in
ytick.labelsize: 10 # fontsize of the tick labels
ytick.major.pad: