matplotlib--Configuration Parameters

Source: Internet
Author: User

Matplotlib is an Open-source project initiated by John Hunter. There is a little story about the origin of Matplotlib. John Hunter and his colleagues who studied epilepsy were using a proprietary software to analyze the EEG, but his lab had only one license for the analysis software. He and many of the colleagues working together had to take turns using the software's hardware to encrypt the dog. Johnhunter then has the idea of developing a tool to replace the software currently in use. At that time, MATLAB is widely used in the biomedical industry, John Hunter and so on originally want to develop a version based on MATLAB, but due to some limitations and shortcomings of MATLAB, coupled with his own python very familiar with, so there is the birth of matplotlib. Therefore, whether from the name, or from the matplotlib provided by the function name, parameters and use methods are very similar to MATLAB.

MATPLOTLIBRC is a configuration file with matplotlib default parameter settings in the file.

Import matplotlib
matplotlib.matplotlib_fname () #将会获得matplotlibrc路径

Or

Keysview (Rcparams ({' _internal.classic_mode ': False,
' Agg.path.chunksize ': 0,
' Animation.avconv_args ': [],
' Animation.avconv_path ': ' Avconv ',
' Animation.bitrate ':-1,
' Animation.codec ': ' H264 ',
' Animation.convert_args ': [],
' Animation.convert_path ': ' Convert ',
' Animation.embed_limit ': 20.0,
' Animation.ffmpeg_args ': [],
' Animation.ffmpeg_path ': ' FFmpeg ',
' Animation.frame_format ': ' PNG ',
' animation.html ': ' None ',
' Animation.html_args ': [],
' Animation.mencoder_args ': [],
' Animation.mencoder_path ': ' MEncoder ',
' Animation.writer ': ' FFmpeg ',
' Axes.autolimit_mode ': ' Data ',
' Axes.axisbelow ': ' Line ',
' Axes.edgecolor ': ' K ',
' Axes.facecolor ': ' W ',
' Axes.formatter.limits ': [-7, 7],
' Axes.formatter.min_exponent ': 0,
' Axes.formatter.offset_threshold ': 4,
' 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.hold ': None,
' Axes.labelcolor ': ' K ',
' Axes.labelpad ': 4.0,
' Axes.labelsize ': ' Medium ',
' Axes.labelweight ': ' Normal ',
' Axes.linewidth ': 0.8,
' Axes.prop_cycle ': cycler (' Color ', [' #1f77b4 ', ' #ff7f0e ', ' #2ca02c ', ' #d62728 ', ' #9467bd ', ' #8c564b ', ' #e377c2 ', '] 7f7f7f ', ' #bcbd22 ', ' #17becf '],
' Axes.spines.bottom ': True,
' Axes.spines.left ': True,
' Axes.spines.right ': True,
' Axes.spines.top ': True,
' Axes.titlepad ': 6.0,
' axes.titlesize ': ' Large ',
' Axes.titleweight ': ' Normal ',
' Axes.unicode_minus ': True,
' Axes.xmargin ': 0.05,
' Axes.ymargin ': 0.05,
' Axes3d.grid ': True,
' Backend ': ' Module://ipykernel.pylab.backend_inline ',
' Backend.qt4 ': ' PyQt4 ',
' Backend.qt5 ': ' PyQt5 ',
' Backend_fallback ': True,
' Boxplot.bootstrap ': None,
' Boxplot.boxprops.color ': ' K ',
' Boxplot.boxprops.linestyle ': '-',
' Boxplot.boxprops.linewidth ': 1.0,
' Boxplot.capprops.color ': ' K ',
' Boxplot.capprops.linestyle ': '-',
' Boxplot.capprops.linewidth ': 1.0,
' Boxplot.flierprops.color ': ' K ',
' Boxplot.flierprops.linestyle ': ' None ',
' Boxplot.flierprops.linewidth ': 1.0,
' Boxplot.flierprops.marker ': ' O ',
' Boxplot.flierprops.markeredgecolor ': ' K ',
' Boxplot.flierprops.markerfacecolor ': ' None ',
' Boxplot.flierprops.markersize ': 6.0,
' Boxplot.meanline ': False,
' Boxplot.meanprops.color ': ' C2 ',
' Boxplot.meanprops.linestyle ': '-',
' Boxplot.meanprops.linewidth ': 1.0,
' Boxplot.meanprops.marker ': ' ^ ',
' Boxplot.meanprops.markeredgecolor ': ' C2 ',
' Boxplot.meanprops.markerfacecolor ': ' C2 ',
' Boxplot.meanprops.markersize ': 6.0,
' Boxplot.medianprops.color ': ' C1 ',
' 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 ': ' K ',
' Boxplot.whiskerprops.linestyle ': '-',
' Boxplot.whiskerprops.linewidth ': 1.0,
' Boxplot.whiskers ': 1.5,
' Contour.corner_mask ': True,
' Contour.negative_linestyle ': ' Dashed ',
' DataPath ': ' C:\users\appdata\local\programs\python\python36\lib\site-packages\matplotlib\mpl-data ',
' Date.autoformatter.day ': '%y-%m-%d ',
' Date.autoformatter.hour ': '%m-%d%H ',
' Date.autoformatter.microsecond ': '%m:%s.%f ',
' Date.autoformatter.minute ': '%d%h:%m ',
' Date.autoformatter.month ': '%y-%m ',
' Date.autoformatter.second ': '%h:%m:%s ',
' Date.autoformatter.year ': '%Y ',
' Docstring.hardcopy ': False,
' Errorbar.capsize ': 0.0,
' Examples.directory ': ",
' Figure.autolayout ': False,
' figure.dpi ': 72.0,
' Figure.edgecolor ': (1, 1, 1, 0),
' Figure.facecolor ': (1, 1, 1, 0),
' Figure.figsize ': [6.0, 4.0],
' Figure.frameon ': True,
' figure.max_open_warning ': 20,
' Figure.subplot.bottom ': 0.125,
' Figure.subplot.hspace ': 0.2,
' Figure.subplot.left ': 0.125,
' Figure.subplot.right ': 0.9,
' Figure.subplot.top ': 0.88,
' Figure.subplot.wspace ': 0.2,
' figure.titlesize ': ' Large ',
' Figure.titleweight ': ' Normal ',
' Font.cursive ': [' Apple Chancery ',
' Textile ',
' Zapf Chancery ',
' Sand ',
' Script MT ',
' Felipa ',
' Cursive '],
' font.family ': [' Sans-serif '],
' Font.fantasy ': [' Comic Sans MS ',
' Chicago ',
' Charcoal ',
' Impactwestern ',
' Humor Sans ',
' XKCD ',
' Fantasy '],
' Font.monospace ': [' Dejavu Sans Mono ',
' Bitstream Vera Sans Mono ',
' Computer modern typewriter ',
' Andale Mono ',
' Nimbus Mono L ',
' Courier New ',
' Courier ',
' Fixed ',
' Terminal ',
' Monospace '],
' Font.sans-serif ': [' Tahoma '],
' 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 '],
' Font.Size ': 10.0,
' Font.stretch ': ' Normal ',
' Font.style ': ' Normal ',
' Font.variant ': ' Normal ',
' Font.weight ': ' Normal ',
' Grid.alpha ': 1.0,
' Grid.color ': ' #b0b0b0 ',
' Grid.linestyle ': '-',
' Grid.linewidth ': 0.8,
' Hatch.color ': ' K ',
' Hatch.linewidth ': 1.0,
' Hist.bins ': 10,
' Image.aspect ': ' Equal ',
' Image.cmap ': ' viridis ',
' Image.composite_image ': True,
' Image.interpolation ': ' Nearest ',
' Image.lut ': 256,
' Image.origin ': ' Upper ',
' Image.resample ': True,
' Interactive ': False,
' Keymap.all_axes ': [' a '],
' Keymap.back ': [' left ', ' C ', ' backspace '],
' Keymap.forward ': [' right ', ' V '],
' Keymap.fullscreen ': [' f ', ' ctrl+f '],
' Keymap.grid ': [' G '],
' Keymap.grid_minor ': [' G '],
' Keymap.home ': [' h ', ' r ', ' Home '],
' Keymap.pan ': [' P '],
' Keymap.quit ': [' ctrl+w ', ' cmd+w ', ' Q '],
' Keymap.quit_all ': [' W ', ' cmd+w ', ' Q '],
' Keymap.save ': [' s ', ' ctrl+s '],
' Keymap.xscale ': [' k ', ' L '],
' Keymap.yscale ': [' l '],
' Keymap.zoom ': [' O '],
' Legend.borderaxespad ': 0.5,
' Legend.borderpad ': 0.4,
' Legend.columnspacing ': 2.0,
' Legend.edgecolor ': ' 0.8 ',
' Legend.facecolor ': ' Inherit ',
' Legend.fancybox ': True,
' Legend.fontsize ': ' Medium ',
' Legend.framealpha ': 0.8,
' Legend.frameon ': True,
' Legend.handleheight ': 0.7,
' Legend.handlelength ': 2.0,
' Legend.handletextpad ': 0.8,
' legend.labelspacing ': 0.5,
' Legend.loc ': ' Best ',
' Legend.markerscale ': 1.0,
' Legend.numpoints ': 1,
' Legend.scatterpoints ': 1,
' Legend.shadow ': False,
' lines.antialiased ': True,
' Lines.color ': ' R ',
' Lines.dash_capstyle ': ' Butt ',
' Lines.dash_joinstyle ': ' Round ',
' Lines.dashdot_pattern ': [6.4, 1.6, 1.0, 1.6],
' Lines.dashed_pattern ': [3.7, 1.6],
' Lines.dotted_pattern ': [1.0, 1.65],
' Lines.linestyle ': '-',
' Lines.linewidth ': 3.0,
' Lines.marker ': ' None ',
' Lines.markeredgewidth ': 1.0,
' Lines.markersize ': 6.0,
' Lines.scale_dashes ': True,
' Lines.solid_capstyle ': ' Projecting ',
' Lines.solid_joinstyle ': ' Round ',
' Markers.fillstyle ': ' Full ',
' MATHTEXT.BF ': ' Sans:bold ',
' mathtext.cal ': ' Cursive ',
' Mathtext.default ': ' It ',
' mathtext.fallback_to_cm ': True,
' Mathtext.fontset ': ' Dejavusans ',
' mathtext.it ': ' Sans:italic ',
' mathtext.rm ': ' sans ',
' mathtext.sf ': ' sans ',
' Mathtext.tt ': ' monospace ',
' Nbagg.transparent ': True,
' patch.antialiased ': True,
' Patch.edgecolor ': ' K ',
' Patch.facecolor ': ' C0 ',
' Patch.force_edgecolor ': False,
' Patch.linewidth ': 1.0,
' Path.effects ': [],
' Path.simplify ': True,
' Path.simplify_threshold ': 0.1111111111111111,
' Path.sketch ': None,
' Path.snap ': True,
' Pdf.compression ': 6,
' Pdf.fonttype ': 3,
' Pdf.inheritcolor ': False,
' Pdf.use14corefonts ': False,
' Pgf.debug ': False,
' Pgf.preamble ': [],
' Pgf.rcfonts ': True,
' Pgf.texsystem ': ' Xelatex ',
' Plugins.directory ': '. Matplotlib_plugins ',
' Polaraxes.grid ': True,
' Ps.distiller.res ': 6000,
' Ps.fonttype ': 3,
' Ps.papersize ': ' Letter ',
' PS.USEAFM ': False,
' Ps.usedistiller ': False,
' Savefig.bbox ': None,
' Savefig.directory ': ' ~ ',
' savefig.dpi ': ' Figure ',
' Savefig.edgecolor ': ' W ',
' Savefig.facecolor ': ' W ',
' Savefig.format ': ' PNG ',
' Savefig.frameon ': True,
' Savefig.jpeg_quality ': 95,
' Savefig.orientation ': ' Portrait ',
' Savefig.pad_inches ': 0.1,
' Savefig.transparent ': False,
' Scatter.marker ': ' O ',
' Svg.fonttype ': ' Path ',
' Svg.hashsalt ': None,
' Svg.image_inline ': True,
' text.antialiased ': True,
' Text.color ': ' K ',
' text.hinting ': ' Auto ',
' Text.hinting_factor ': 8,
' Text.latex.preamble ': [],
' Text.latex.preview ': False,
' Text.latex.unicode ': False,
' Text.usetex ': False,
' TimeZone ': ' UTC ',
' Tk.window_focus ': False,
' toolbar ': ' Toolbar2 ',
' Verbose.fileo ': ' Sys.stdout ',
' Verbose.level ': ' Silent ',
' Webagg.open_in_browser ': True,
' Webagg.port ': 8988,
' Webagg.port_retries ': 50,
' Xtick.alignment ': ' Center ',
' Xtick.bottom ': True,
' Xtick.color ': ' K ',
' Xtick.direction ': ' Out ',
' Xtick.labelsize ': ' Medium ',
' Xtick.major.bottom ': True,
' Xtick.major.pad ': 3.5,
' Xtick.major.size ': 3.5,
' Xtick.major.top ': True,
' Xtick.major.width ': 0.8,
' Xtick.minor.bottom ': True,
' Xtick.minor.pad ': 3.4,
' Xtick.minor.size ': 2.0,
' Xtick.minor.top ': True,
' xtick.minor.visible ': False,
' Xtick.minor.width ': 0.6,
' Xtick.top ': False,
' Ytick.alignment ': ' Center_baseline ',
' Ytick.color ': ' K ',
' Ytick.direction ': ' Out ',
' Ytick.labelsize ': ' Medium ',
' Ytick.left ': True,
' Ytick.major.left ': True,
' Ytick.major.pad ': 3.5,
' Ytick.major.right ': True,
' Ytick.major.size ': 3.5,
' Ytick.major.width ': 0.8,
' Ytick.minor.left ': True,
' Ytick.minor.pad ': 3.4,
' Ytick.minor.right ': True,
' Ytick.minor.size ': 2.0,
' ytick.minor.visible ': False,
' Ytick.minor.width ': 0.6,
' Ytick.right ': False})
setting parameters by Rcparams

Import Matplotlib.pyplot as Plt
# make line red
plt.rcparams[' lines.color ' = ' r ' # make line
thick
PLT.R cparams[' lines.linewidth '] = ' 3 '

reset configuration to standard settings

Matplotlib.rcdefaults ()

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.