How to find the matplotlib style name?


To find the matplotlib style name, we can take the following steps −

  • import matplotlib.pyplot as plt

  • print(plt.style.library)

Example

import matplotlib.pyplot as plt
print(plt.style.library)

Output

{'bmh': RcParams({'axes.edgecolor': '#bcbcbc',
   'axes.facecolor': '#eeeeee',
   'axes.grid': True,
   'axes.labelsize': 'large','axes.prop_cycle': cycler('color', ['#348ABD', '#A60628', '#7A68A6',             '#467821', '#D55E00', '#CC79A7', '#56B4E9', '#009E73', '#F0E442', '#0072B2']),
   'axes.titlesize': 'x-large',
   'grid.color': '#b2b2b2',
   'grid.linestyle': '--',
   'grid.linewidth': 0.5,
   'legend.fancybox': True,
   'lines.linewidth': 2.0,
   'mathtext.fontset': 'cm',
   'patch.antialiased': True,
   'patch.edgecolor': '#eeeeee',
   'patch.facecolor': 'blue',
   'patch.linewidth': 0.5,
   'text.hinting_factor': 8,
   'xtick.direction': 'in',
   'ytick.direction': 'in'}), 'classic': RcParams({'_internal.classic_mode': True,
   'agg.path.chunksize': 0,
   'animation.bitrate': -1,
   'animation.codec': 'mpeg4',
   'animation.convert_args': [],
   'animation.convert_path': 'convert',
   'animation.ffmpeg_args': [],
   'animation.ffmpeg_path': 'ffmpeg',
   'animation.frame_format': 'png',
   'animation.html': 'none',
   'animation.writer': 'ffmpeg',
   'axes.autolimit_mode': 'round_numbers',
   'axes.axisbelow': False,
   'axes.edgecolor': 'k',
   'axes.facecolor': 'w',
   'axes.formatter.limits': [-7, 7],
   'axes.formatter.offset_threshold': 2,
   'axes.formatter.use_locale': False,
   'axes.formatter.use_mathtext': False,
   'axes.formatter.useoffset': True,
   'axes.grid': False,
   'axes.grid.axis': 'both',
   'axes.grid.which': 'major',
   'axes.labelcolor': 'k',
   'axes.labelpad': 5.0,
   'axes.labelsize': 'medium',
   'axes.labelweight': 'normal',
   'axes.linewidth': 1.0,
   'axes.prop_cycle': cycler('color', ['b', 'g', 'r', 'c', 'm', 'y', 'k']),
   'axes.spines.bottom': True,
   'axes.spines.left': True,
   'axes.spines.right': True,
   'axes.spines.top': True,
   'axes.titlepad': 5.0,
   'axes.titlesize': 'large',
   'axes.titleweight': 'normal',
   'axes.titley': 1.0,
   'axes.unicode_minus': True,
   'axes.xmargin': 0.0,
   'axes.ymargin': 0.0,
   'axes3d.grid': True,
   'boxplot.bootstrap': None,
   'boxplot.boxprops.color': 'b',
   'boxplot.boxprops.linestyle': '-',
   'boxplot.boxprops.linewidth': 1.0,
   'boxplot.capprops.color': 'k',
   'boxplot.capprops.linestyle': '-',
   'boxplot.capprops.linewidth': 1.0,
   'boxplot.flierprops.color': 'b',
   'boxplot.flierprops.linestyle': 'none',
   'boxplot.flierprops.linewidth': 1.0,
   'boxplot.flierprops.marker': '+',
   'boxplot.flierprops.markeredgecolor': 'k',
   'boxplot.flierprops.markerfacecolor': 'auto',
   'boxplot.flierprops.markersize': 6.0,
   'boxplot.meanline': False,
   'boxplot.meanprops.color': 'r',
   'boxplot.meanprops.linestyle': '-',
   'boxplot.meanprops.linewidth': 1.0,
   'boxplot.meanprops.marker': 's',
   'boxplot.meanprops.markeredgecolor': 'k',
   'boxplot.meanprops.markerfacecolor': 'r',
   'boxplot.meanprops.markersize': 6.0,
   'boxplot.medianprops.color': 'r',
   'boxplot.medianprops.linestyle': '-',
   'boxplot.medianprops.linewidth': 1.0,
   'boxplot.notch': False,
   'boxplot.patchartist': False,
   'boxplot.showbox': True,
   'boxplot.showcaps': True,
   'boxplot.showfliers': True,
   'boxplot.showmeans': False,
   'boxplot.vertical': True,
   'boxplot.whiskerprops.color': 'b',
   'boxplot.whiskerprops.linestyle': '--',
   'boxplot.whiskerprops.linewidth': 1.0,
   'boxplot.whiskers': 1.5,
   'contour.corner_mask': True,
   'contour.negative_linestyle': 'dashed',
   'date.autoformatter.day': '%b %d %Y',
   'date.autoformatter.hour': '%H:%M:%S',
   'date.autoformatter.microsecond': '%H:%M:%S.%f',
   'date.autoformatter.minute': '%H:%M:%S.%f',
   'date.autoformatter.month': '%b %Y',
   'date.autoformatter.second': '%H:%M:%S.%f',
   'date.autoformatter.year': '%Y',
   'date.converter': None,
   'errorbar.capsize': 3.0,
   'figure.autolayout': False,
   'figure.dpi': 80.0,
   'figure.edgecolor': 'w',
   'figure.facecolor': '0.75',
   'figure.figsize': [8.0, 6.0],
   'figure.frameon': True,
   ...
   ...
RcParams({'axes.axisbelow': True,
   'axes.edgecolor': '#f0f0f0',
   'axes.facecolor': '#f0f0f0',
   'axes.grid': True,
   'axes.labelsize': 'large',
   'axes.linewidth': 3.0,
   ...
   ...
RcParams({'axes.axisbelow': True,
   'axes.edgecolor': '#eee8d5',
   'axes.facecolor': '#eee8d5',
   'axes.grid': True,
   'axes.labelcolor': '#657b83',
   'axes.labelsize': 12.0,
   ...
   ...

Updated on: 23-Sep-2021

115 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements