├── LICENSE ├── README.md ├── matplotlibrc ├── test.png ├── test.py ├── test2.png └── test2.py /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Benjamin Barad 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | matplotlibrc 2 | ====================== 3 | ## The matplotlibrc file works somewhat differently in recent matplotlib versions, so use this file with caution. An update will come soon™. 4 | 5 | ## Summary: 6 | 7 | ![example_image](test.png) 8 | 9 | ![example_image_2](test2.png) 10 | 11 | This matplotlibrc provides a quick starting point so that any plotting you do with matplotlib looks nice off the bat. It includes font sizing, nice formatting of subscripted and superscripted text (with mathtext), a better color wheel, high-dpi defaults, a pretty grid, outward-facing tickmarks, and nicer line bend handling. 12 | 13 | Unfortunately, the ticks by default are on the outside of all 4 sides, which I am not a huge fan of. This can only be solved with code within the script (below). 14 | 15 | The title also correspondingly hangs too low with the new, larger font. To fix this, declare "y=1.08" as an argument when making your title. I also recommend adding some padding around the labels with "labelpad=10" 16 | 17 | Examples of these changes are below as well as in the test script which generates the image at the top of this readme. 18 | 19 | ## Example usage: 20 | 21 | This script will work with any matplotlib as long as it is in the right place (see Conditions to Run) but I recommend the following additional bits in your plotting script: 22 | 23 | ```python 24 | ax.yaxis.set_ticks_position('left') # this one is optional but I still recommend it... 25 | ax.xaxis.set_ticks_position('bottom') 26 | ax.set_title("Title goes here", y=1.05) 27 | ax.set_ylabel("Ylabel Goes Here", labelpad=10) 28 | ax.set_xlabel("XLabel goes here",labelpad=10) 29 | ``` 30 | 31 | Additionally, you should probably mess with the formatting for error bars but I don't have a recommended setting for this... Please contribute if you find one! 32 | 33 | ## Conditions to run: 34 | 35 | Copy the `matplotlibrc` file to `~/.matplotlib/matplotlibrc`. 36 | 37 | If you feel fancy, you can run: 38 | 39 | ```bash 40 | ln -s ./matplotlibrc ~/.matplotlib/matplotlibrc 41 | ``` 42 | 43 | ### Software requirements: 44 | 45 | ``` 46 | python==2.7.8 47 | matplotlib==1.3.1 48 | ``` 49 | 50 | ### Citations 51 | I shamelessly copied the color wheel from Stephen Few's book [Show me the Numbers](http://www.amazon.com/Show-Me-Numbers-Designing-Enlighten/dp/0970601972/ref=sr_1_1?s=books&ie=UTF8&qid=1376149971&sr=1-1&keywords=show+me+the+numbers) 52 | -------------------------------------------------------------------------------- /matplotlibrc: -------------------------------------------------------------------------------- 1 | ### MATPLOTLIBRC FORMAT 2 | # 3 | # This file is best viewed in a editor which supports python mode 4 | # syntax highlighting. Blank lines, or lines starting with a comment 5 | # symbol, are ignored, as are trailing comments. Other lines must 6 | # have the format 7 | # key : val # optional comment 8 | # 9 | # Colors: for the color values below, you can either use - a 10 | # matplotlib color string, such as r, k, or b - an rgb tuple, such as 11 | # (1.0, 0.5, 0.0) - a hex string, such as ff00ff or #ff00ff - a scalar 12 | # grayscale intensity such as 0.75 - a legal html color name, eg red, 13 | # blue, darkslategray 14 | 15 | #### CONFIGURATION BEGINS HERE 16 | 17 | # the default backend; one of GTK GTKAgg GTKCairo GTK3Agg GTK3Cairo 18 | # CocoaAgg MacOSX Qt4Agg TkAgg WX WXAgg Agg Cairo GDK PS PDF SVG 19 | # Template 20 | # You can also deploy your own backend outside of matplotlib by 21 | # referring to the module name (which must be in the PYTHONPATH) as 22 | # 'module://my_backend' 23 | backend : tkagg 24 | 25 | # If you are using the Qt4Agg backend, you can choose here 26 | # to use the PyQt4 bindings or the newer PySide bindings to 27 | # the underlying Qt4 toolkit. 28 | # backend.qt4 : PyQt4 # PyQt4 | PySide 29 | 30 | # Note that this can be overridden by the environment variable 31 | # QT_API used by Enthought Tool Suite (ETS); valid values are 32 | # "pyqt" and "pyside". The "pyqt" setting has the side effect of 33 | # forcing the use of Version 2 API for QString and QVariant. 34 | 35 | # The port to use for the web server in the WebAgg backend. 36 | webagg.port : 8888 37 | 38 | # If webagg.port is unavailable, a number of other random ports will 39 | # be tried until one that is available is found. 40 | webagg.port_retries : 50 41 | 42 | # When True, open the webbrowser to the plot that is shown 43 | webagg.open_in_browser : True 44 | 45 | # if you are running pyplot inside a GUI and your backend choice 46 | # conflicts, we will automatically try to find a compatible one for 47 | # you if backend_fallback is True 48 | backend_fallback: True 49 | 50 | # interactive : True 51 | #toolbar : toolbar2 # None | toolbar2 ("classic" is deprecated) 52 | #timezone : UTC # a pytz timezone string, eg US/Central or Europe/Paris 53 | 54 | # Where your matplotlib data lives if you installed to a non-default 55 | # location. This is where the matplotlib fonts, bitmaps, etc reside 56 | #datapath : /home/jdhunter/mpldata 57 | 58 | 59 | ### LINES 60 | # See http://matplotlib.org/api/artist_api.html#module-matplotlib.lines for more 61 | # information on line properties. 62 | lines.linewidth : 2.0 # line width in points 63 | lines.linestyle : - # solid line 64 | lines.color : black # has no affect on plot(); see axes.color_cycle 65 | lines.marker : None # the default marker 66 | lines.markeredgewidth : 0.0 # the line width around the marker symbol 67 | lines.markersize : 6.0 # markersize, in points 68 | #lines.dash_joinstyle : miter # miter|round|bevel 69 | #lines.dash_capstyle : butt # butt|round|projecting 70 | lines.solid_joinstyle : round # miter|round|bevel 71 | lines.solid_capstyle : round # butt|round|projecting 72 | lines.antialiased : True # render lines in antialised (no jaggies) 73 | 74 | ### PATCHES 75 | # Patches are graphical objects that fill 2D space, like polygons or 76 | # circles. See 77 | # http://matplotlib.org/api/artist_api.html#module-matplotlib.patches 78 | # information on patch properties 79 | patch.linewidth : 1.0 # edge width in points 80 | patch.facecolor : 0.75 81 | patch.edgecolor : 0.5 82 | patch.antialiased : True # render patches in antialised (no jaggies) 83 | 84 | ### FONT 85 | # 86 | # font properties used by text.Text. See 87 | # http://matplotlib.org/api/font_manager_api.html for more 88 | # information on font properties. The 6 font properties used for font 89 | # matching are given below with their default values. 90 | # 91 | # The font.family property has five values: 'serif' (e.g., Times), 92 | # 'sans-serif' (e.g., Helvetica), 'cursive' (e.g., Zapf-Chancery), 93 | # 'fantasy' (e.g., Western), and 'monospace' (e.g., Courier). Each of 94 | # these font families has a default list of font names in decreasing 95 | # order of priority associated with them. When text.usetex is False, 96 | # font.family may also be one or more concrete font names. 97 | # 98 | # The font.style property has three values: normal (or roman), italic 99 | # or oblique. The oblique style will be used for italic, if it is not 100 | # present. 101 | # 102 | # The font.variant property has two values: normal or small-caps. For 103 | # TrueType fonts, which are scalable fonts, small-caps is equivalent 104 | # to using a font size of 'smaller', or about 83% of the current font 105 | # size. 106 | # 107 | # The font.weight property has effectively 13 values: normal, bold, 108 | # bolder, lighter, 100, 200, 300, ..., 900. Normal is the same as 109 | # 400, and bold is 700. bolder and lighter are relative values with 110 | # respect to the current weight. 111 | # 112 | # The font.stretch property has 11 values: ultra-condensed, 113 | # extra-condensed, condensed, semi-condensed, normal, semi-expanded, 114 | # expanded, extra-expanded, ultra-expanded, wider, and narrower. This 115 | # property is not currently implemented. 116 | # 117 | # The font.size property is the default font size for text, given in pts. 118 | # 12pt is the standard value. 119 | # 120 | font.family : sans-serif 121 | font.style : normal 122 | font.variant : normal 123 | font.weight : medium 124 | font.stretch : normal 125 | # note that font.size controls default text sizes. To configure 126 | # special text sizes tick labels, axes, labels, title, etc, see the rc 127 | # settings for axes and ticks. Special text sizes can be defined 128 | # relative to font.size, using the following values: xx-small, x-small, 129 | # small, medium, large, x-large, xx-large, larger, or smaller 130 | font.size : 12.0 131 | font.serif : Times, Palatino, New Century Schoolbook, Bookman, Computer Modern Roman 132 | font.sans-serif : Arial, Helvetica, Avant Garde, Computer Modern Sans serif 133 | font.cursive : Zapf Chancery, Sand, cursive 134 | font.fantasy : Comic Sans MS, Chicago, Charcoal, Impact, Western, fantasy 135 | font.monospace : Source Code Pro, Courier, Computer Modern Typewriter 136 | 137 | ### TEXT 138 | # text properties used by text.Text. See 139 | # http://matplotlib.org/api/artist_api.html#module-matplotlib.text for more 140 | # information on text properties 141 | 142 | text.color : black 143 | 144 | ### LaTeX customizations. See http://www.scipy.org/Wiki/Cookbook/Matplotlib/UsingTex 145 | text.usetex : False # use latex for all text handling. The following fonts 146 | # are supported through the usual rc parameter settings: 147 | # new century schoolbook, bookman, times, palatino, 148 | # zapf chancery, charter, serif, sans-serif, helvetica, 149 | # avant garde, courier, monospace, computer modern roman, 150 | # computer modern sans serif, computer modern typewriter 151 | # If another font is desired which can loaded using the 152 | # LaTeX \usepackage command, please inquire at the 153 | # matplotlib mailing list 154 | #text.latex.unicode : False # use "ucs" and "inputenc" LaTeX packages for handling 155 | # unicode strings. 156 | #text.latex.preamble : # IMPROPER USE OF THIS FEATURE WILL LEAD TO LATEX FAILURES 157 | # AND IS THEREFORE UNSUPPORTED. PLEASE DO NOT ASK FOR HELP 158 | # IF THIS FEATURE DOES NOT DO WHAT YOU EXPECT IT TO. 159 | # preamble is a comma separated list of LaTeX statements 160 | # that are included in the LaTeX document preamble. 161 | # An example: 162 | # text.latex.preamble : \usepackage{bm},\usepackage{euler} 163 | # The following packages are always loaded with usetex, so 164 | # beware of package collisions: color, geometry, graphicx, 165 | # type1cm, textcomp. Adobe Postscript (PSSNFS) font packages 166 | # may also be loaded, depending on your font settings 167 | 168 | # text.dvipnghack : True # some versions of dvipng don't handle alpha 169 | # channel properly. Use True to correct 170 | # and flush ~/.matplotlib/tex.cache 171 | # before testing and False to force 172 | # correction off. None will try and 173 | # guess based on your dvipng version 174 | 175 | # text.hinting : 'auto' # May be one of the following: 176 | # 'none': Perform no hinting 177 | # 'auto': Use freetype's autohinter 178 | # 'native': Use the hinting information in the 179 | # font file, if available, and if your 180 | # freetype library supports it 181 | # 'either': Use the native hinting information, 182 | # or the autohinter if none is available. 183 | # For backward compatibility, this value may also be 184 | # True === 'auto' or False === 'none'. 185 | # text.hinting_factor : 16 # Specifies the amount of softness for hinting in the 186 | # horizontal direction. A value of 1 will hint to full 187 | # pixels. A value of 2 will hint to half pixels etc. 188 | 189 | #text.antialiased : True # If True (default), the text will be antialiased. 190 | # This only affects the Agg backend. 191 | 192 | # The following settings allow you to select the fonts in math mode. 193 | # They map from a TeX font name to a fontconfig font pattern. 194 | # These settings are only used if mathtext.fontset is 'custom'. 195 | # Note that this "custom" mode is unsupported and may go away in the 196 | # future. 197 | #mathtext.cal : cursive 198 | #mathtext.rm : serif 199 | #mathtext.tt : monospace 200 | #mathtext.it : serif:italic 201 | #mathtext.bf : serif:bold 202 | #mathtext.sf : sans 203 | #mathtext.fontset : cm # Should be 'cm' (Computer Modern), 'stix', 204 | # 'stixsans' or 'custom' 205 | #mathtext.fallback_to_cm : True # When True, use symbols from the Computer Modern 206 | # fonts when a symbol can not be found in one of 207 | # the custom math fonts. 208 | 209 | mathtext.default : regular # The default font to use for math. 210 | # Can be any of the LaTeX font names, including 211 | # the special name "regular" for the same font 212 | # used in regular text. 213 | 214 | ### AXES 215 | # default face and edge color, default tick sizes, 216 | # default fontsizes for ticklabels, and so on. See 217 | # http://matplotlib.org/api/axes_api.html#module-matplotlib.axes 218 | #axes.hold : True # whether to clear the axes by default on 219 | axes.facecolor : white # axes background color 220 | #axes.edgecolor : black # axes edge color 221 | #axes.linewidth : 1.0 # edge linewidth 222 | axes.grid : True # display grid or not 223 | axes.titlesize : 24.0 # fontsize of the axes title 224 | axes.labelsize : 18.0 # fontsize of the x any y labels 225 | #axes.labelweight : normal # weight of the x and y labels 226 | #axes.labelcolor : black 227 | axes.axisbelow : True # whether axis gridlines and ticks are below 228 | # the axes elements (lines, text, etc) 229 | axes.formatter.limits : -7, 7 # use scientific notation if log10 230 | # of the axis range is smaller than the 231 | # first or larger than the second 232 | #axes.formatter.use_locale : False # When True, format tick labels 233 | # according to the user's locale. 234 | # For example, use ',' as a decimal 235 | # separator in the fr_FR locale. 236 | axes.formatter.use_mathtext : True # When True, use mathtext for scientific 237 | # notation. 238 | #axes.unicode_minus : True # use unicode for the minus symbol 239 | # rather than hyphen. See 240 | # http://en.wikipedia.org/wiki/Plus_and_minus_signs#Character_codes 241 | axes.color_cycle : 5DA5DA, FAA43A, 60BD68, F17CB0, B2912F, B276B2, DECF3F, F15854, 4D4D4D 242 | # 5DA5DA (blue) 243 | # FAA43A (orange) 244 | # 60BD68 (green) 245 | # F17CB0 (pink) 246 | # B2912F (brown) 247 | # B276B2 (purple) 248 | # DECF3F (yellow) 249 | # F15854 (red) 250 | # 4D4D4D (gray) 251 | 252 | axes.xmargin : 0 # x margin. See `axes.Axes.margins` 253 | axes.ymargin : 0 # y margin See `axes.Axes.margins` 254 | 255 | polaraxes.grid : True # display grid on polar axes 256 | #axes3d.grid : True # display grid on 3d axes 257 | 258 | ### TICKS 259 | # see http://matplotlib.org/api/axis_api.html#matplotlib.axis.Tick 260 | xtick.major.size : 4 # major tick size in points 261 | xtick.minor.size : 2 # minor tick size in points 262 | xtick.major.width : 1 # major tick width in points 263 | xtick.minor.width : 1 # minor tick width in points 264 | xtick.major.pad : 6 # distance to major tick label in points 265 | #xtick.minor.pad : 4 # distance to the minor tick label in points 266 | #xtick.color : k # color of the tick labels 267 | #xtick.labelsize : medium # fontsize of the tick labels 268 | xtick.direction : out # direction: in, out, or inout 269 | 270 | ytick.major.size : 4 # major tick size in points 271 | ytick.minor.size : 2 # minor tick size in points 272 | ytick.major.width : 1 # major tick width in points 273 | ytick.minor.width : 1 # minor tick width in points 274 | ytick.major.pad : 6 # distance to major tick label in points 275 | #ytick.minor.pad : 4 # distance to the minor tick label in points 276 | #ytick.color : k # color of the tick labels 277 | #ytick.labelsize : medium # fontsize of the tick labels 278 | ytick.direction : out # direction: in, out, or inout 279 | 280 | 281 | ### GRIDS 282 | grid.color : 0.7 # grid color 283 | grid.linestyle : solid 284 | # grid.linewidth : 0.5 # in points 285 | grid.alpha : 0.2 # transparency, between 0.0 and 1.0 286 | 287 | ### Legend 288 | #legend.fancybox : False # if True, use a rounded box for the 289 | # legend, else a rectangle 290 | #legend.isaxes : True 291 | #legend.numpoints : 2 # the number of points in the legend line 292 | #legend.fontsize : large 293 | #legend.borderpad : 0.5 # border whitespace in fontsize units 294 | #legend.markerscale : 1.0 # the relative size of legend markers vs. original 295 | # the following dimensions are in axes coords 296 | #legend.labelspacing : 0.5 # the vertical space between the legend entries in fraction of fontsize 297 | #legend.handlelength : 2. # the length of the legend lines in fraction of fontsize 298 | #legend.handleheight : 0.7 # the height of the legend handle in fraction of fontsize 299 | #legend.handletextpad : 0.8 # the space between the legend line and legend text in fraction of fontsize 300 | #legend.borderaxespad : 0.5 # the border between the axes and legend edge in fraction of fontsize 301 | #legend.columnspacing : 2. # the border between the axes and legend edge in fraction of fontsize 302 | #legend.shadow : False 303 | #legend.frameon : True # whether or not to draw a frame around legend 304 | #legend.scatterpoints : 3 # number of scatter points 305 | 306 | ### FIGURE 307 | # See http://matplotlib.org/api/figure_api.html#matplotlib.figure.Figure 308 | figure.figsize : 8, 6 # figure size in inches 309 | figure.dpi : 150 # figure dots per inch 310 | figure.facecolor : white # figure facecolor; 0.75 is scalar gray 311 | #figure.edgecolor : white # figure edgecolor 312 | figure.autolayout : True # When True, automatically adjust subplot 313 | # parameters to make the plot fit the figure 314 | figure.max_open_warning : 40 # The maximum number of figures to open through 315 | # the pyplot interface before emitting a warning. 316 | # If less than one this feature is disabled. 317 | 318 | # The figure subplot parameters. All dimensions are a fraction of the 319 | # figure width or height 320 | #figure.subplot.left : 0.125 # the left side of the subplots of the figure 321 | #figure.subplot.right : 0.9 # the right side of the subplots of the figure 322 | #figure.subplot.bottom : 0.1 # the bottom of the subplots of the figure 323 | #figure.subplot.top : 0.9 # the top of the subplots of the figure 324 | #figure.subplot.wspace : 0.2 # the amount of width reserved for blank space between subplots 325 | #figure.subplot.hspace : 0.2 # the amount of height reserved for white space between subplots 326 | 327 | ### IMAGES 328 | #image.aspect : equal # equal | auto | a number 329 | #image.interpolation : bilinear # see help(imshow) for options 330 | #image.cmap : jet # gray | jet etc... 331 | #image.lut : 256 # the size of the colormap lookup table 332 | #image.origin : upper # lower | upper 333 | #image.resample : False 334 | 335 | ### CONTOUR PLOTS 336 | #contour.negative_linestyle : dashed # dashed | solid 337 | 338 | ### Agg rendering 339 | ### Warning: experimental, 2008/10/10 340 | #agg.path.chunksize : 0 # 0 to disable; values in the range 341 | # 10000 to 100000 can improve speed slightly 342 | # and prevent an Agg rendering failure 343 | # when plotting very large data sets, 344 | # especially if they are very gappy. 345 | # It may cause minor artifacts, though. 346 | # A value of 20000 is probably a good 347 | # starting point. 348 | ### SAVING FIGURES 349 | #path.simplify : True # When True, simplify paths by removing "invisible" 350 | # points to reduce file size and increase rendering 351 | # speed 352 | #path.simplify_threshold : 0.1 # The threshold of similarity below which 353 | # vertices will be removed in the simplification 354 | # process 355 | #path.snap : True # When True, rectilinear axis-aligned paths will be snapped to 356 | # the nearest pixel when certain criteria are met. When False, 357 | # paths will never be snapped. 358 | #path.sketch : None # May be none, or a 3-tuple of the form (scale, length, 359 | # randomness). 360 | # *scale* is the amplitude of the wiggle 361 | # perpendicular to the line (in pixels). *length* 362 | # is the length of the wiggle along the line (in 363 | # pixels). *randomness* is the factor by which 364 | # the length is randomly scaled. 365 | 366 | # the default savefig params can be different from the display params 367 | # e.g., you may want a higher resolution, or to make the figure 368 | # background white 369 | savefig.dpi : 300 # figure dots per inch 370 | savefig.format : svg # png, ps, pdf, svg 371 | savefig.bbox : tight # 'tight' or 'standard'. 372 | savefig.pad_inches : 0.1 # Padding to be used when bbox is set to 'tight' 373 | savefig.jpeg_quality: 95 # when a jpeg is saved, the default quality parameter. 374 | 375 | # Set the verbose flags. This controls how much information 376 | # matplotlib gives you at runtime and where it goes. The verbosity 377 | # levels are: silent, helpful, debug, debug-annoying. Any level is 378 | # inclusive of all the levels below it. If your setting is "debug", 379 | # you'll get all the debug and helpful messages. When submitting 380 | # problems to the mailing-list, please set verbose to "helpful" or "debug" 381 | # and paste the output into your report. 382 | # 383 | # The "fileo" gives the destination for any calls to verbose.report. 384 | # These objects can a filename, or a filehandle like sys.stdout. 385 | # 386 | # You can override the rc default verbosity from the command line by 387 | # giving the flags --verbose-LEVEL where LEVEL is one of the legal 388 | # levels, eg --verbose-helpful. 389 | # 390 | # You can access the verbose instance in your code 391 | # from matplotlib import verbose. 392 | verbose.level : helpful # one of silent, helpful, debug, debug-annoying 393 | verbose.fileo : sys.stdout # a log filename, sys.stdout or sys.stderr 394 | 395 | # Event keys to interact with figures/plots via keyboard. 396 | # Customize these settings according to your needs. 397 | # Leave the field(s) empty if you don't need a key-map. (i.e., fullscreen : '') 398 | 399 | #keymap.fullscreen : f # toggling 400 | #keymap.home : h, r, home # home or reset mnemonic 401 | #keymap.back : left, c, backspace # forward / backward keys to enable 402 | #keymap.forward : right, v # left handed quick navigation 403 | #keymap.pan : p # pan mnemonic 404 | #keymap.zoom : o # zoom mnemonic 405 | #keymap.save : s # saving current figure 406 | #keymap.quit : ctrl+w, cmd+w # close the current figure 407 | #keymap.grid : g # switching on/off a grid in current axes 408 | #keymap.yscale : l # toggle scaling of y-axes ('log'/'linear') 409 | #keymap.xscale : L, k # toggle scaling of x-axes ('log'/'linear') 410 | #keymap.all_axes : a # enable all axes 411 | 412 | # Control location of examples data files 413 | #examples.directory : '' # directory to look in for custom installation 414 | 415 | ###ANIMATION settings 416 | #animation.writer : ffmpeg # MovieWriter 'backend' to use 417 | #animation.codec : mp4 # Codec to use for writing movie 418 | #animation.bitrate: -1 # Controls size/quality tradeoff for movie. 419 | # -1 implies let utility auto-determine 420 | #animation.frame_format: 'png' # Controls frame format used by temp files 421 | #animation.ffmpeg_path: 'ffmpeg' # Path to ffmpeg binary. Without full path 422 | # $PATH is searched 423 | #animation.ffmpeg_args: '' # Additional arguments to pass to ffmpeg 424 | #animation.avconv_path: 'avconv' # Path to avconv binary. Without full path 425 | # $PATH is searched 426 | #animation.avconv_args: '' # Additional arguments to pass to avconv 427 | #animation.mencoder_path: 'mencoder' 428 | # Path to mencoder binary. Without full path 429 | # $PATH is searched 430 | #animation.mencoder_args: '' # Additional arguments to pass to mencoder 431 | -------------------------------------------------------------------------------- /test.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bbarad/matplotlibrc/fa9798f7db50a338f72e16910064f28f5f361e7f/test.png -------------------------------------------------------------------------------- /test.py: -------------------------------------------------------------------------------- 1 | import matplotlib 2 | import matplotlib.pyplot as plt 3 | 4 | data = [220,14.2,150,400,420] 5 | error = [10, 1, 20, 60, 10] 6 | x = [i + .5 for i in range(5)] 7 | colors = ['#5DA5DA', '#FAA43A', '#60BD68', '#F17CB0', '#B2912F'] 8 | 9 | fig, ax = plt.subplots() 10 | bar = ax.bar(x, data, 0.8, align="center", yerr=error) 11 | plot = ax.plot(x, data) 12 | ax.set_xticks(x) 13 | ax.set_xticklabels(('wt', 'N23PP', 'N23PP/PEKN', 'PEKN', 'N23PP/PEKN/L28F')) 14 | ax.set_title(r"Everything in the document can use m$\alpha$th language", y=1.05) 15 | ax.set_ylabel(r"Rate (s$^{-1}$)", labelpad=10) 16 | ax.set_xlabel("Mutant",labelpad=10) 17 | ax.yaxis.set_ticks_position('left') 18 | ax.xaxis.set_ticks_position('bottom') 19 | plt.savefig('test.svg') 20 | plt.show() 21 | -------------------------------------------------------------------------------- /test2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bbarad/matplotlibrc/fa9798f7db50a338f72e16910064f28f5f361e7f/test2.png -------------------------------------------------------------------------------- /test2.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import matplotlib 3 | import matplotlib.pyplot as plt 4 | 5 | x=np.arange(0,5,.01) 6 | fig, ax = plt.subplots() 7 | for i in range(10): 8 | y = [np.sin(datum**2+i/10.0) for datum in x] 9 | ax.plot(x, y) 10 | ax.yaxis.set_ticks_position('left') 11 | ax.xaxis.set_ticks_position('bottom') 12 | ax.set_title("The new color cycle is a little prettier by default", y=1.05) 13 | ax.set_ylabel(r"$sin(x^{2}+\lambda{})$", labelpad=5) 14 | ax.set_xlabel(r"x", labelpad=5) 15 | plt.savefig('test2.svg') 16 | plt.show() 17 | --------------------------------------------------------------------------------