sidebarDepth: 3

sidebar: auto

Customizing Matplotlib with style sheets and rcParams

Tips for customizing the properties and default styles of Matplotlib.

Using style sheets

The style package adds support for easy-to-switch plotting “styles” with the same parameters as a matplotlib rc file (which is read at startup to configure matplotlib).

There are a number of pre-defined styles provided by Matplotlib. For example, there’s a pre-defined style called “ggplot”, which emulates the aesthetics of ggplot (a popular plotting package for R). To use this style, just add:

  1. import numpy as np
  2. import matplotlib.pyplot as plt
  3. import matplotlib as mpl
  4. plt.style.use('ggplot')
  5. data = np.random.randn(50)

To list all available styles, use:

  1. print(plt.style.available)

Out:

  1. ['seaborn-dark', 'dark_background', 'seaborn-pastel', 'seaborn-colorblind', 'tableau-colorblind10', 'seaborn-notebook', 'seaborn-dark-palette', 'grayscale', 'seaborn-poster', 'seaborn', 'bmh', 'seaborn-talk', 'seaborn-ticks', '_classic_test', 'ggplot', 'seaborn-white', 'classic', 'Solarize_Light2', 'seaborn-paper', 'fast', 'fivethirtyeight', 'seaborn-muted', 'seaborn-whitegrid', 'seaborn-darkgrid', 'seaborn-bright', 'seaborn-deep']

Defining your own style

You can create custom styles and use them by calling style.use with the path or URL to the style sheet. Additionally, if you add your .mplstyle file to mpl_configdir/stylelib, you can reuse your custom style sheet with a call to style.use(). By default mpl_configdir should be ~/.config/matplotlib, but you can check where yours is with matplotlib.get_configdir(); you may need to create this directory. You also can change the directory where matplotlib looks for the stylelib/ folder by setting the MPLCONFIGDIR environment variable, see matplotlib configuration and cache directory locations.

Note that a custom style sheet in mpl_configdir/stylelib will override a style sheet defined by matplotlib if the styles have the same name.

For example, you might want to create mpl_configdir/stylelib/presentation.mplstyle with the following:

  1. axes.titlesize : 24
  2. axes.labelsize : 20
  3. lines.linewidth : 3
  4. lines.markersize : 10
  5. xtick.labelsize : 16
  6. ytick.labelsize : 16

Then, when you want to adapt a plot designed for a paper to one that looks good in a presentation, you can just add:

  1. >>> import matplotlib.pyplot as plt
  2. >>> plt.style.use('presentation')

Composing styles

Style sheets are designed to be composed together. So you can have a style sheet that customizes colors and a separate style sheet that alters element sizes for presentations. These styles can easily be combined by passing a list of styles:

  1. >>> import matplotlib.pyplot as plt
  2. >>> plt.style.use(['dark_background', 'presentation'])

Note that styles further to the right will overwrite values that are already defined by styles on the left.

Temporary styling

If you only want to use a style for a specific block of code but don’t want to change the global styling, the style package provides a context manager for limiting your changes to a specific scope. To isolate your styling changes, you can write something like the following:

  1. with plt.style.context('dark_background'):
  2. plt.plot(np.sin(np.linspace(0, 2 * np.pi)), 'r-o')
  3. plt.show()

sphx_glr_customizing_001

matplotlib rcParams

Dynamic rc settings

You can also dynamically change the default rc settings in a python script or interactively from the python shell. All of the rc settings are stored in a dictionary-like variable called matplotlib.rcParams, which is global to the matplotlib package. rcParams can be modified directly, for example:

  1. mpl.rcParams['lines.linewidth'] = 2
  2. mpl.rcParams['lines.color'] = 'r'
  3. plt.plot(data)

sphx_glr_customizing_002

Matplotlib also provides a couple of convenience functions for modifying rc settings. The matplotlib.rc() command can be used to modify multiple settings in a single group at once, using keyword arguments:

  1. mpl.rc('lines', linewidth=4, color='g')
  2. plt.plot(data)

sphx_glr_customizing_003

The matplotlib.rcdefaults() command will restore the standard matplotlib default settings.

There is some degree of validation when setting the values of rcParams, see matplotlib.rcsetup for details.

The matplotlibrc file

matplotlib uses matplotlibrc configuration files to customize all kinds of properties, which we call rc settings or rc parameters. You can control the defaults of almost every property in matplotlib: figure size and dpi, line width, color and style, axes, axis and grid properties, text and font properties and so on. matplotlib looks for matplotlibrc in four locations, in the following order:

Once a matplotlibrc file has been found, it will not search any of the other paths.

To display where the currently active matplotlibrc file was loaded from, one can do the following:

  1. >>> import matplotlib
  2. >>> matplotlib.matplotlib_fname()
  3. '/home/foo/.config/matplotlib/matplotlibrc'

See below for a sample matplotlibrc file.

A sample matplotlibrc file

  1. #### MATPLOTLIBRC FORMAT
  2. ## This is a sample matplotlib configuration file - you can find a copy
  3. ## of it on your system in
  4. ## site-packages/matplotlib/mpl-data/matplotlibrc. If you edit it
  5. ## there, please note that it will be overwritten in your next install.
  6. ## If you want to keep a permanent local copy that will not be
  7. ## overwritten, place it in the following location:
  8. ## unix/linux:
  9. ## $HOME/.config/matplotlib/matplotlibrc or
  10. ## $XDG_CONFIG_HOME/matplotlib/matplotlibrc (if $XDG_CONFIG_HOME is set)
  11. ## other platforms:
  12. ## $HOME/.matplotlib/matplotlibrc
  13. ##
  14. ## See http://matplotlib.org/users/customizing.html#the-matplotlibrc-file for
  15. ## more details on the paths which are checked for the configuration file.
  16. ##
  17. ## This file is best viewed in a editor which supports python mode
  18. ## syntax highlighting. Blank lines, or lines starting with a comment
  19. ## symbol, are ignored, as are trailing comments. Other lines must
  20. ## have the format
  21. ## key : val ## optional comment
  22. ##
  23. ## Colors: for the color values below, you can either use - a
  24. ## matplotlib color string, such as r, k, or b - an rgb tuple, such as
  25. ## (1.0, 0.5, 0.0) - a hex string, such as ff00ff - a scalar
  26. ## grayscale intensity such as 0.75 - a legal html color name, e.g., red,
  27. ## blue, darkslategray
  28. ##### CONFIGURATION BEGINS HERE
  29. ## The default backend. If you omit this parameter, the first
  30. ## working backend from the following list is used:
  31. ## MacOSX Qt5Agg Qt4Agg Gtk3Agg TkAgg WxAgg Agg
  32. ##
  33. ## Other choices include:
  34. ## Qt5Cairo Qt4Cairo GTK3Cairo TkCairo WxCairo Cairo Wx PS PDF SVG Template.
  35. ##
  36. ## You can also deploy your own backend outside of matplotlib by
  37. ## referring to the module name (which must be in the PYTHONPATH) as
  38. ## 'module://my_backend'.
  39. #backend : Agg
  40. ## Note that this can be overridden by the environment variable
  41. ## QT_API used by Enthought Tool Suite (ETS); valid values are
  42. ## "pyqt" and "pyside". The "pyqt" setting has the side effect of
  43. ## forcing the use of Version 2 API for QString and QVariant.
  44. ## The port to use for the web server in the WebAgg backend.
  45. #webagg.port : 8988
  46. ## The address on which the WebAgg web server should be reachable
  47. #webagg.address : 127.0.0.1
  48. ## If webagg.port is unavailable, a number of other random ports will
  49. ## be tried until one that is available is found.
  50. #webagg.port_retries : 50
  51. ## When True, open the webbrowser to the plot that is shown
  52. #webagg.open_in_browser : True
  53. ## if you are running pyplot inside a GUI and your backend choice
  54. ## conflicts, we will automatically try to find a compatible one for
  55. ## you if backend_fallback is True
  56. #backend_fallback: True
  57. #interactive : False
  58. #toolbar : toolbar2 ## None | toolbar2 ("classic" is deprecated)
  59. #timezone : UTC ## a pytz timezone string, e.g., US/Central or Europe/Paris
  60. ## Where your matplotlib data lives if you installed to a non-default
  61. ## location. This is where the matplotlib fonts, bitmaps, etc reside
  62. #datapath : /home/jdhunter/mpldata
  63. #### LINES
  64. ## See http://matplotlib.org/api/artist_api.html#module-matplotlib.lines for more
  65. ## information on line properties.
  66. #lines.linewidth : 1.5 ## line width in points
  67. #lines.linestyle : - ## solid line
  68. #lines.color : C0 ## has no affect on plot(); see axes.prop_cycle
  69. #lines.marker : None ## the default marker
  70. #lines.markerfacecolor : auto ## the default markerfacecolor
  71. #lines.markeredgecolor : auto ## the default markeredgecolor
  72. #lines.markeredgewidth : 1.0 ## the line width around the marker symbol
  73. #lines.markersize : 6 ## markersize, in points
  74. #lines.dash_joinstyle : round ## miter|round|bevel
  75. #lines.dash_capstyle : butt ## butt|round|projecting
  76. #lines.solid_joinstyle : round ## miter|round|bevel
  77. #lines.solid_capstyle : projecting ## butt|round|projecting
  78. #lines.antialiased : True ## render lines in antialiased (no jaggies)
  79. ## The three standard dash patterns. These are scaled by the linewidth.
  80. #lines.dashed_pattern : 3.7, 1.6
  81. #lines.dashdot_pattern : 6.4, 1.6, 1, 1.6
  82. #lines.dotted_pattern : 1, 1.65
  83. #lines.scale_dashes : True
  84. #markers.fillstyle: full ## full|left|right|bottom|top|none
  85. #### PATCHES
  86. ## Patches are graphical objects that fill 2D space, like polygons or
  87. ## circles. See
  88. ## http://matplotlib.org/api/artist_api.html#module-matplotlib.patches
  89. ## information on patch properties
  90. #patch.linewidth : 1 ## edge width in points.
  91. #patch.facecolor : C0
  92. #patch.edgecolor : black ## if forced, or patch is not filled
  93. #patch.force_edgecolor : False ## True to always use edgecolor
  94. #patch.antialiased : True ## render patches in antialiased (no jaggies)
  95. #### HATCHES
  96. #hatch.color : black
  97. #hatch.linewidth : 1.0
  98. #### Boxplot
  99. #boxplot.notch : False
  100. #boxplot.vertical : True
  101. #boxplot.whiskers : 1.5
  102. #boxplot.bootstrap : None
  103. #boxplot.patchartist : False
  104. #boxplot.showmeans : False
  105. #boxplot.showcaps : True
  106. #boxplot.showbox : True
  107. #boxplot.showfliers : True
  108. #boxplot.meanline : False
  109. #boxplot.flierprops.color : black
  110. #boxplot.flierprops.marker : o
  111. #boxplot.flierprops.markerfacecolor : none
  112. #boxplot.flierprops.markeredgecolor : black
  113. #boxplot.flierprops.markeredgewidth : 1.0
  114. #boxplot.flierprops.markersize : 6
  115. #boxplot.flierprops.linestyle : none
  116. #boxplot.flierprops.linewidth : 1.0
  117. #boxplot.boxprops.color : black
  118. #boxplot.boxprops.linewidth : 1.0
  119. #boxplot.boxprops.linestyle : -
  120. #boxplot.whiskerprops.color : black
  121. #boxplot.whiskerprops.linewidth : 1.0
  122. #boxplot.whiskerprops.linestyle : -
  123. #boxplot.capprops.color : black
  124. #boxplot.capprops.linewidth : 1.0
  125. #boxplot.capprops.linestyle : -
  126. #boxplot.medianprops.color : C1
  127. #boxplot.medianprops.linewidth : 1.0
  128. #boxplot.medianprops.linestyle : -
  129. #boxplot.meanprops.color : C2
  130. #boxplot.meanprops.marker : ^
  131. #boxplot.meanprops.markerfacecolor : C2
  132. #boxplot.meanprops.markeredgecolor : C2
  133. #boxplot.meanprops.markersize : 6
  134. #boxplot.meanprops.linestyle : --
  135. #boxplot.meanprops.linewidth : 1.0
  136. #### FONT
  137. ## font properties used by text.Text. See
  138. ## http://matplotlib.org/api/font_manager_api.html for more
  139. ## information on font properties. The 6 font properties used for font
  140. ## matching are given below with their default values.
  141. ##
  142. ## The font.family property has five values: 'serif' (e.g., Times),
  143. ## 'sans-serif' (e.g., Helvetica), 'cursive' (e.g., Zapf-Chancery),
  144. ## 'fantasy' (e.g., Western), and 'monospace' (e.g., Courier). Each of
  145. ## these font families has a default list of font names in decreasing
  146. ## order of priority associated with them. When text.usetex is False,
  147. ## font.family may also be one or more concrete font names.
  148. ##
  149. ## The font.style property has three values: normal (or roman), italic
  150. ## or oblique. The oblique style will be used for italic, if it is not
  151. ## present.
  152. ##
  153. ## The font.variant property has two values: normal or small-caps. For
  154. ## TrueType fonts, which are scalable fonts, small-caps is equivalent
  155. ## to using a font size of 'smaller', or about 83%% of the current font
  156. ## size.
  157. ##
  158. ## The font.weight property has effectively 13 values: normal, bold,
  159. ## bolder, lighter, 100, 200, 300, ..., 900. Normal is the same as
  160. ## 400, and bold is 700. bolder and lighter are relative values with
  161. ## respect to the current weight.
  162. ##
  163. ## The font.stretch property has 11 values: ultra-condensed,
  164. ## extra-condensed, condensed, semi-condensed, normal, semi-expanded,
  165. ## expanded, extra-expanded, ultra-expanded, wider, and narrower. This
  166. ## property is not currently implemented.
  167. ##
  168. ## The font.size property is the default font size for text, given in pts.
  169. ## 10 pt is the standard value.
  170. #font.family : sans-serif
  171. #font.style : normal
  172. #font.variant : normal
  173. #font.weight : normal
  174. #font.stretch : normal
  175. ## note that font.size controls default text sizes. To configure
  176. ## special text sizes tick labels, axes, labels, title, etc, see the rc
  177. ## settings for axes and ticks. Special text sizes can be defined
  178. ## relative to font.size, using the following values: xx-small, x-small,
  179. ## small, medium, large, x-large, xx-large, larger, or smaller
  180. #font.size : 10.0
  181. #font.serif : DejaVu Serif, Bitstream Vera Serif, Computer Modern Roman, New Century Schoolbook, Century Schoolbook L, Utopia, ITC Bookman, Bookman, Nimbus Roman No9 L, Times New Roman, Times, Palatino, Charter, serif
  182. #font.sans-serif : DejaVu Sans, Bitstream Vera Sans, Computer Modern Sans Serif, Lucida Grande, Verdana, Geneva, Lucid, Arial, Helvetica, Avant Garde, sans-serif
  183. #font.cursive : Apple Chancery, Textile, Zapf Chancery, Sand, Script MT, Felipa, cursive
  184. #font.fantasy : Comic Sans MS, Chicago, Charcoal, ImpactWestern, Humor Sans, xkcd, fantasy
  185. #font.monospace : DejaVu Sans Mono, Bitstream Vera Sans Mono, Computer Modern Typewriter, Andale Mono, Nimbus Mono L, Courier New, Courier, Fixed, Terminal, monospace
  186. #### TEXT
  187. ## text properties used by text.Text. See
  188. ## http://matplotlib.org/api/artist_api.html#module-matplotlib.text for more
  189. ## information on text properties
  190. #text.color : black
  191. #### LaTeX customizations. See http://wiki.scipy.org/Cookbook/Matplotlib/UsingTex
  192. #text.usetex : False ## use latex for all text handling. The following fonts
  193. ## are supported through the usual rc parameter settings:
  194. ## new century schoolbook, bookman, times, palatino,
  195. ## zapf chancery, charter, serif, sans-serif, helvetica,
  196. ## avant garde, courier, monospace, computer modern roman,
  197. ## computer modern sans serif, computer modern typewriter
  198. ## If another font is desired which can loaded using the
  199. ## LaTeX \usepackage command, please inquire at the
  200. ## matplotlib mailing list
  201. #text.latex.preamble : ## IMPROPER USE OF THIS FEATURE WILL LEAD TO LATEX FAILURES
  202. ## AND IS THEREFORE UNSUPPORTED. PLEASE DO NOT ASK FOR HELP
  203. ## IF THIS FEATURE DOES NOT DO WHAT YOU EXPECT IT TO.
  204. ## text.latex.preamble is a single line of LaTeX code that
  205. ## will be passed on to the LaTeX system. It may contain
  206. ## any code that is valid for the LaTeX "preamble", i.e.
  207. ## between the "\documentclass" and "\begin{document}"
  208. ## statements.
  209. ## Note that it has to be put on a single line, which may
  210. ## become quite long.
  211. ## The following packages are always loaded with usetex, so
  212. ## beware of package collisions: color, geometry, graphicx,
  213. ## type1cm, textcomp.
  214. ## Adobe Postscript (PSSNFS) font packages may also be
  215. ## loaded, depending on your font settings.
  216. #text.latex.preview : False
  217. #text.hinting : auto ## May be one of the following:
  218. ## none: Perform no hinting
  219. ## auto: Use FreeType's autohinter
  220. ## native: Use the hinting information in the
  221. # font file, if available, and if your
  222. # FreeType library supports it
  223. ## either: Use the native hinting information,
  224. # or the autohinter if none is available.
  225. ## For backward compatibility, this value may also be
  226. ## True === 'auto' or False === 'none'.
  227. #text.hinting_factor : 8 ## Specifies the amount of softness for hinting in the
  228. ## horizontal direction. A value of 1 will hint to full
  229. ## pixels. A value of 2 will hint to half pixels etc.
  230. #text.antialiased : True ## If True (default), the text will be antialiased.
  231. ## This only affects the Agg backend.
  232. ## The following settings allow you to select the fonts in math mode.
  233. ## They map from a TeX font name to a fontconfig font pattern.
  234. ## These settings are only used if mathtext.fontset is 'custom'.
  235. ## Note that this "custom" mode is unsupported and may go away in the
  236. ## future.
  237. #mathtext.cal : cursive
  238. #mathtext.rm : sans
  239. #mathtext.tt : monospace
  240. #mathtext.it : sans:italic
  241. #mathtext.bf : sans:bold
  242. #mathtext.sf : sans
  243. #mathtext.fontset : dejavusans ## Should be 'dejavusans' (default),
  244. ## 'dejavuserif', 'cm' (Computer Modern), 'stix',
  245. ## 'stixsans' or 'custom'
  246. #mathtext.fallback_to_cm : True ## When True, use symbols from the Computer Modern
  247. ## fonts when a symbol can not be found in one of
  248. ## the custom math fonts.
  249. #mathtext.default : it ## The default font to use for math.
  250. ## Can be any of the LaTeX font names, including
  251. ## the special name "regular" for the same font
  252. ## used in regular text.
  253. #### AXES
  254. ## default face and edge color, default tick sizes,
  255. ## default fontsizes for ticklabels, and so on. See
  256. ## http://matplotlib.org/api/axes_api.html#module-matplotlib.axes
  257. #axes.facecolor : white ## axes background color
  258. #axes.edgecolor : black ## axes edge color
  259. #axes.linewidth : 0.8 ## edge linewidth
  260. #axes.grid : False ## display grid or not
  261. #axes.grid.axis : both ## which axis the grid should apply to
  262. #axes.grid.which : major ## gridlines at major, minor or both ticks
  263. #axes.titlesize : large ## fontsize of the axes title
  264. #axes.titleweight : normal ## font weight of title
  265. #axes.titlepad : 6.0 ## pad between axes and title in points
  266. #axes.labelsize : medium ## fontsize of the x any y labels
  267. #axes.labelpad : 4.0 ## space between label and axis
  268. #axes.labelweight : normal ## weight of the x and y labels
  269. #axes.labelcolor : black
  270. #axes.axisbelow : line ## draw axis gridlines and ticks below
  271. ## patches (True); above patches but below
  272. ## lines ('line'); or above all (False)
  273. #axes.formatter.limits : -7, 7 ## use scientific notation if log10
  274. ## of the axis range is smaller than the
  275. ## first or larger than the second
  276. #axes.formatter.use_locale : False ## When True, format tick labels
  277. ## according to the user's locale.
  278. ## For example, use ',' as a decimal
  279. ## separator in the fr_FR locale.
  280. #axes.formatter.use_mathtext : False ## When True, use mathtext for scientific
  281. ## notation.
  282. #axes.formatter.min_exponent: 0 ## minimum exponent to format in scientific notation
  283. #axes.formatter.useoffset : True ## If True, the tick label formatter
  284. ## will default to labeling ticks relative
  285. ## to an offset when the data range is
  286. ## small compared to the minimum absolute
  287. ## value of the data.
  288. #axes.formatter.offset_threshold : 4 ## When useoffset is True, the offset
  289. ## will be used when it can remove
  290. ## at least this number of significant
  291. ## digits from tick labels.
  292. #axes.spines.left : True ## display axis spines
  293. #axes.spines.bottom : True
  294. #axes.spines.top : True
  295. #axes.spines.right : True
  296. #axes.unicode_minus : True ## use unicode for the minus symbol
  297. ## rather than hyphen. See
  298. ## http://en.wikipedia.org/wiki/Plus_and_minus_signs#Character_codes
  299. #axes.prop_cycle : cycler('color', ['1f77b4', 'ff7f0e', '2ca02c', 'd62728', '9467bd', '8c564b', 'e377c2', '7f7f7f', 'bcbd22', '17becf'])
  300. ## color cycle for plot lines as list of string
  301. ## colorspecs: single letter, long name, or web-style hex
  302. ## Note the use of string escapes here ('1f77b4', instead of 1f77b4)
  303. ## as opposed to the rest of this file.
  304. #axes.autolimit_mode : data ## How to scale axes limits to the data.
  305. ## Use "data" to use data limits, plus some margin
  306. ## Use "round_number" move to the nearest "round" number
  307. #axes.xmargin : .05 ## x margin. See `axes.Axes.margins`
  308. #axes.ymargin : .05 ## y margin See `axes.Axes.margins`
  309. #polaraxes.grid : True ## display grid on polar axes
  310. #axes3d.grid : True ## display grid on 3d axes
  311. #### DATES
  312. ## These control the default format strings used in AutoDateFormatter.
  313. ## Any valid format datetime format string can be used (see the python
  314. ## `datetime` for details). For example using '%%x' will use the locale date representation
  315. ## '%%X' will use the locale time representation and '%%c' will use the full locale datetime
  316. ## representation.
  317. ## These values map to the scales:
  318. ## {'year': 365, 'month': 30, 'day': 1, 'hour': 1/24, 'minute': 1 / (24 * 60)}
  319. #date.autoformatter.year : %Y
  320. #date.autoformatter.month : %Y-%m
  321. #date.autoformatter.day : %Y-%m-%d
  322. #date.autoformatter.hour : %m-%d %H
  323. #date.autoformatter.minute : %d %H:%M
  324. #date.autoformatter.second : %H:%M:%S
  325. #date.autoformatter.microsecond : %M:%S.%f
  326. #### TICKS
  327. ## see http://matplotlib.org/api/axis_api.html#matplotlib.axis.Tick
  328. #xtick.top : False ## draw ticks on the top side
  329. #xtick.bottom : True ## draw ticks on the bottom side
  330. #xtick.labeltop : False ## draw label on the top
  331. #xtick.labelbottom : True ## draw label on the bottom
  332. #xtick.major.size : 3.5 ## major tick size in points
  333. #xtick.minor.size : 2 ## minor tick size in points
  334. #xtick.major.width : 0.8 ## major tick width in points
  335. #xtick.minor.width : 0.6 ## minor tick width in points
  336. #xtick.major.pad : 3.5 ## distance to major tick label in points
  337. #xtick.minor.pad : 3.4 ## distance to the minor tick label in points
  338. #xtick.color : black ## color of the tick labels
  339. #xtick.labelsize : medium ## fontsize of the tick labels
  340. #xtick.direction : out ## direction: in, out, or inout
  341. #xtick.minor.visible : False ## visibility of minor ticks on x-axis
  342. #xtick.major.top : True ## draw x axis top major ticks
  343. #xtick.major.bottom : True ## draw x axis bottom major ticks
  344. #xtick.minor.top : True ## draw x axis top minor ticks
  345. #xtick.minor.bottom : True ## draw x axis bottom minor ticks
  346. #xtick.alignment : center ## alignment of xticks
  347. #ytick.left : True ## draw ticks on the left side
  348. #ytick.right : False ## draw ticks on the right side
  349. #ytick.labelleft : True ## draw tick labels on the left side
  350. #ytick.labelright : False ## draw tick labels on the right side
  351. #ytick.major.size : 3.5 ## major tick size in points
  352. #ytick.minor.size : 2 ## minor tick size in points
  353. #ytick.major.width : 0.8 ## major tick width in points
  354. #ytick.minor.width : 0.6 ## minor tick width in points
  355. #ytick.major.pad : 3.5 ## distance to major tick label in points
  356. #ytick.minor.pad : 3.4 ## distance to the minor tick label in points
  357. #ytick.color : black ## color of the tick labels
  358. #ytick.labelsize : medium ## fontsize of the tick labels
  359. #ytick.direction : out ## direction: in, out, or inout
  360. #ytick.minor.visible : False ## visibility of minor ticks on y-axis
  361. #ytick.major.left : True ## draw y axis left major ticks
  362. #ytick.major.right : True ## draw y axis right major ticks
  363. #ytick.minor.left : True ## draw y axis left minor ticks
  364. #ytick.minor.right : True ## draw y axis right minor ticks
  365. #ytick.alignment : center_baseline ## alignment of yticks
  366. #### GRIDS
  367. #grid.color : b0b0b0 ## grid color
  368. #grid.linestyle : - ## solid
  369. #grid.linewidth : 0.8 ## in points
  370. #grid.alpha : 1.0 ## transparency, between 0.0 and 1.0
  371. #### Legend
  372. #legend.loc : best
  373. #legend.frameon : True ## if True, draw the legend on a background patch
  374. #legend.framealpha : 0.8 ## legend patch transparency
  375. #legend.facecolor : inherit ## inherit from axes.facecolor; or color spec
  376. #legend.edgecolor : 0.8 ## background patch boundary color
  377. #legend.fancybox : True ## if True, use a rounded box for the
  378. ## legend background, else a rectangle
  379. #legend.shadow : False ## if True, give background a shadow effect
  380. #legend.numpoints : 1 ## the number of marker points in the legend line
  381. #legend.scatterpoints : 1 ## number of scatter points
  382. #legend.markerscale : 1.0 ## the relative size of legend markers vs. original
  383. #legend.fontsize : medium
  384. #legend.title_fontsize : None ## None sets to the same as the default axes.
  385. ## Dimensions as fraction of fontsize:
  386. #legend.borderpad : 0.4 ## border whitespace
  387. #legend.labelspacing : 0.5 ## the vertical space between the legend entries
  388. #legend.handlelength : 2.0 ## the length of the legend lines
  389. #legend.handleheight : 0.7 ## the height of the legend handle
  390. #legend.handletextpad : 0.8 ## the space between the legend line and legend text
  391. #legend.borderaxespad : 0.5 ## the border between the axes and legend edge
  392. #legend.columnspacing : 2.0 ## column separation
  393. #### FIGURE
  394. ## See http://matplotlib.org/api/figure_api.html#matplotlib.figure.Figure
  395. #figure.titlesize : large ## size of the figure title (Figure.suptitle())
  396. #figure.titleweight : normal ## weight of the figure title
  397. #figure.figsize : 6.4, 4.8 ## figure size in inches
  398. #figure.dpi : 100 ## figure dots per inch
  399. #figure.facecolor : white ## figure facecolor
  400. #figure.edgecolor : white ## figure edgecolor
  401. #figure.frameon : True ## enable figure frame
  402. #figure.max_open_warning : 20 ## The maximum number of figures to open through
  403. ## the pyplot interface before emitting a warning.
  404. ## If less than one this feature is disabled.
  405. ## The figure subplot parameters. All dimensions are a fraction of the
  406. #figure.subplot.left : 0.125 ## the left side of the subplots of the figure
  407. #figure.subplot.right : 0.9 ## the right side of the subplots of the figure
  408. #figure.subplot.bottom : 0.11 ## the bottom of the subplots of the figure
  409. #figure.subplot.top : 0.88 ## the top of the subplots of the figure
  410. #figure.subplot.wspace : 0.2 ## the amount of width reserved for space between subplots,
  411. ## expressed as a fraction of the average axis width
  412. #figure.subplot.hspace : 0.2 ## the amount of height reserved for space between subplots,
  413. ## expressed as a fraction of the average axis height
  414. ## Figure layout
  415. #figure.autolayout : False ## When True, automatically adjust subplot
  416. ## parameters to make the plot fit the figure
  417. ## using `tight_layout`
  418. #figure.constrained_layout.use: False ## When True, automatically make plot
  419. ## elements fit on the figure. (Not compatible
  420. ## with `autolayout`, above).
  421. #figure.constrained_layout.h_pad : 0.04167 ## Padding around axes objects. Float representing
  422. #figure.constrained_layout.w_pad : 0.04167 ## inches. Default is 3./72. inches (3 pts)
  423. #figure.constrained_layout.hspace : 0.02 ## Space between subplot groups. Float representing
  424. #figure.constrained_layout.wspace : 0.02 ## a fraction of the subplot widths being separated.
  425. #### IMAGES
  426. #image.aspect : equal ## equal | auto | a number
  427. #image.interpolation : nearest ## see help(imshow) for options
  428. #image.cmap : viridis ## A colormap name, gray etc...
  429. #image.lut : 256 ## the size of the colormap lookup table
  430. #image.origin : upper ## lower | upper
  431. #image.resample : True
  432. #image.composite_image : True ## When True, all the images on a set of axes are
  433. ## combined into a single composite image before
  434. ## saving a figure as a vector graphics file,
  435. ## such as a PDF.
  436. #### CONTOUR PLOTS
  437. #contour.negative_linestyle : dashed ## string or on-off ink sequence
  438. #contour.corner_mask : True ## True | False | legacy
  439. #### ERRORBAR PLOTS
  440. #errorbar.capsize : 0 ## length of end cap on error bars in pixels
  441. #### HISTOGRAM PLOTS
  442. #hist.bins : 10 ## The default number of histogram bins.
  443. ## If Numpy 1.11 or later is
  444. ## installed, may also be `auto`
  445. #### SCATTER PLOTS
  446. #scatter.marker : o ## The default marker type for scatter plots.
  447. #scatter.edgecolors : face ## The default edgecolors for scatter plots.
  448. #### Agg rendering
  449. #### Warning: experimental, 2008/10/10
  450. #agg.path.chunksize : 0 ## 0 to disable; values in the range
  451. ## 10000 to 100000 can improve speed slightly
  452. ## and prevent an Agg rendering failure
  453. ## when plotting very large data sets,
  454. ## especially if they are very gappy.
  455. ## It may cause minor artifacts, though.
  456. ## A value of 20000 is probably a good
  457. ## starting point.
  458. #### PATHS
  459. #path.simplify : True ## When True, simplify paths by removing "invisible"
  460. ## points to reduce file size and increase rendering
  461. ## speed
  462. #path.simplify_threshold : 0.111111111111 ## The threshold of similarity below which
  463. ## vertices will be removed in the
  464. ## simplification process
  465. #path.snap : True ## When True, rectilinear axis-aligned paths will be snapped to
  466. ## the nearest pixel when certain criteria are met. When False,
  467. ## paths will never be snapped.
  468. #path.sketch : None ## May be none, or a 3-tuple of the form (scale, length,
  469. ## randomness).
  470. ## *scale* is the amplitude of the wiggle
  471. ## perpendicular to the line (in pixels). *length*
  472. ## is the length of the wiggle along the line (in
  473. ## pixels). *randomness* is the factor by which
  474. ## the length is randomly scaled.
  475. #path.effects : [] ##
  476. #### SAVING FIGURES
  477. ## the default savefig params can be different from the display params
  478. ## e.g., you may want a higher resolution, or to make the figure
  479. ## background white
  480. #savefig.dpi : figure ## figure dots per inch or 'figure'
  481. #savefig.facecolor : white ## figure facecolor when saving
  482. #savefig.edgecolor : white ## figure edgecolor when saving
  483. #savefig.format : png ## png, ps, pdf, svg
  484. #savefig.bbox : standard ## 'tight' or 'standard'.
  485. ## 'tight' is incompatible with pipe-based animation
  486. ## backends but will workd with temporary file based ones:
  487. ## e.g. setting animation.writer to ffmpeg will not work,
  488. ## use ffmpeg_file instead
  489. #savefig.pad_inches : 0.1 ## Padding to be used when bbox is set to 'tight'
  490. #savefig.jpeg_quality: 95 ## when a jpeg is saved, the default quality parameter.
  491. #savefig.directory : ~ ## default directory in savefig dialog box,
  492. ## leave empty to always use current working directory
  493. #savefig.transparent : False ## setting that controls whether figures are saved with a
  494. ## transparent background by default
  495. #savefig.orientation : portrait ## Orientation of saved figure
  496. ### tk backend params
  497. #tk.window_focus : False ## Maintain shell focus for TkAgg
  498. ### ps backend params
  499. #ps.papersize : letter ## auto, letter, legal, ledger, A0-A10, B0-B10
  500. #ps.useafm : False ## use of afm fonts, results in small files
  501. #ps.usedistiller : False ## can be: None, ghostscript or xpdf
  502. ## Experimental: may produce smaller files.
  503. ## xpdf intended for production of publication quality files,
  504. ## but requires ghostscript, xpdf and ps2eps
  505. #ps.distiller.res : 6000 ## dpi
  506. #ps.fonttype : 3 ## Output Type 3 (Type3) or Type 42 (TrueType)
  507. ### pdf backend params
  508. #pdf.compression : 6 ## integer from 0 to 9
  509. ## 0 disables compression (good for debugging)
  510. #pdf.fonttype : 3 ## Output Type 3 (Type3) or Type 42 (TrueType)
  511. #pdf.use14corefonts : False
  512. #pdf.inheritcolor : False
  513. ### svg backend params
  514. #svg.image_inline : True ## write raster image data directly into the svg file
  515. #svg.fonttype : path ## How to handle SVG fonts:
  516. ## none: Assume fonts are installed on the machine where the SVG will be viewed.
  517. ## path: Embed characters as paths -- supported by most SVG renderers
  518. #svg.hashsalt : None ## if not None, use this string as hash salt
  519. ## instead of uuid4
  520. ### pgf parameter
  521. #pgf.rcfonts : True
  522. #pgf.preamble : ## see text.latex.preamble for documentation
  523. #pgf.texsystem : xelatex
  524. ### docstring params
  525. ##docstring.hardcopy = False ## set this when you want to generate hardcopy docstring
  526. ## Event keys to interact with figures/plots via keyboard.
  527. ## Customize these settings according to your needs.
  528. ## Leave the field(s) empty if you don't need a key-map. (i.e., fullscreen : '')
  529. #keymap.fullscreen : f, ctrl+f ## toggling
  530. #keymap.home : h, r, home ## home or reset mnemonic
  531. #keymap.back : left, c, backspace, MouseButton.BACK ## forward / backward keys
  532. #keymap.forward : right, v, MouseButton.FORWARD ## for quick navigation
  533. #keymap.pan : p ## pan mnemonic
  534. #keymap.zoom : o ## zoom mnemonic
  535. #keymap.save : s, ctrl+s ## saving current figure
  536. #keymap.help : f1 ## display help about active tools
  537. #keymap.quit : ctrl+w, cmd+w, q ## close the current figure
  538. #keymap.quit_all : W, cmd+W, Q ## close all figures
  539. #keymap.grid : g ## switching on/off major grids in current axes
  540. #keymap.grid_minor : G ## switching on/off minor grids in current axes
  541. #keymap.yscale : l ## toggle scaling of y-axes ('log'/'linear')
  542. #keymap.xscale : k, L ## toggle scaling of x-axes ('log'/'linear')
  543. #keymap.all_axes : a ## enable all axes
  544. #keymap.copy : ctrl+c, cmd+c ## Copy figure to clipboard
  545. ###ANIMATION settings
  546. #animation.html : none ## How to display the animation as HTML in
  547. ## the IPython notebook. 'html5' uses
  548. ## HTML5 video tag; 'jshtml' creates a
  549. ## Javascript animation
  550. #animation.writer : ffmpeg ## MovieWriter 'backend' to use
  551. #animation.codec : h264 ## Codec to use for writing movie
  552. #animation.bitrate: -1 ## Controls size/quality tradeoff for movie.
  553. ## -1 implies let utility auto-determine
  554. #animation.frame_format: png ## Controls frame format used by temp files
  555. #animation.html_args: ## Additional arguments to pass to html writer
  556. #animation.ffmpeg_path: ffmpeg ## Path to ffmpeg binary. Without full path
  557. ## $PATH is searched
  558. #animation.ffmpeg_args: ## Additional arguments to pass to ffmpeg
  559. #animation.avconv_path: avconv ## Path to avconv binary. Without full path
  560. ## $PATH is searched
  561. #animation.avconv_args: ## Additional arguments to pass to avconv
  562. #animation.convert_path: convert ## Path to ImageMagick's convert binary.
  563. ## On Windows use the full path since convert
  564. ## is also the name of a system tool.
  565. #animation.convert_args: ## Additional arguments to pass to convert
  566. #animation.embed_limit : 20.0 ## Limit, in MB, of size of base64 encoded
  567. ## animation in HTML (i.e. IPython notebook)

Download