Commit 9186cc5398db5448b046b6f4fce2466b42d5ed3e

Authored by Rémi Emonet
1 parent e015f56cc3
Exists in master

CM7

Showing 32 changed files with 4199 additions and 8 deletions

chunks/doc-np-genfromtxt.md View file @ 9186cc5
  1 +## Charger des données avec `np.genfromtxt` {autodoc}
  2 +<div class='scrollatbottom'>
  3 +<ul>
  4 +<li>Premier paramètre : nom du fichier</li>
  5 +<li>Paramètre nommé <code>delimiter</code> : séparateur de colones (ex : <code>","</code>)
  6 +<li>Autres paramètres pour les cas plus avancés</li>
  7 +</ul>
  8 +
  9 +<div class='scroll'>
  10 +Python Library Documentation: function genfromtxt in numpy
  11 +
  12 +<dl><dt><a name="-numpy.genfromtxt"><strong>numpy.genfromtxt</strong></a> = genfromtxt(fname, dtype=&lt;class 'float'&gt;, comments='#', delimiter=None, skip_header=0, skip_footer=0, converters=None, missing_values=None, filling_values=None, usecols=None, names=None, excludelist=None, deletechars=None, replace_space='_', autostrip=False, case_sensitive=True, defaultfmt='f%i', unpack=None, usemask=False, loose=True, invalid_raise=True, max_rows=None)</dt><dd><tt>Load&nbsp;data&nbsp;from&nbsp;a&nbsp;text&nbsp;file,&nbsp;with&nbsp;missing&nbsp;values&nbsp;handled&nbsp;as&nbsp;specified.<br>
  13 +&nbsp;<br>
  14 +Each&nbsp;line&nbsp;past&nbsp;the&nbsp;first&nbsp;`skip_header`&nbsp;lines&nbsp;is&nbsp;split&nbsp;at&nbsp;the&nbsp;`delimiter`<br>
  15 +character,&nbsp;and&nbsp;characters&nbsp;following&nbsp;the&nbsp;`comments`&nbsp;character&nbsp;are&nbsp;discarded.<br>
  16 +&nbsp;<br>
  17 +Parameters<br>
  18 +----------<br>
  19 +fname&nbsp;:&nbsp;file,&nbsp;str,&nbsp;pathlib.Path,&nbsp;list&nbsp;of&nbsp;str,&nbsp;generator<br>
  20 +&nbsp;&nbsp;&nbsp;&nbsp;File,&nbsp;filename,&nbsp;list,&nbsp;or&nbsp;generator&nbsp;to&nbsp;read.&nbsp;&nbsp;If&nbsp;the&nbsp;filename<br>
  21 +&nbsp;&nbsp;&nbsp;&nbsp;extension&nbsp;is&nbsp;`.gz`&nbsp;or&nbsp;`.bz2`,&nbsp;the&nbsp;file&nbsp;is&nbsp;first&nbsp;decompressed.&nbsp;Note<br>
  22 +&nbsp;&nbsp;&nbsp;&nbsp;that&nbsp;generators&nbsp;must&nbsp;return&nbsp;byte&nbsp;strings&nbsp;in&nbsp;Python&nbsp;3k.&nbsp;&nbsp;The&nbsp;strings<br>
  23 +&nbsp;&nbsp;&nbsp;&nbsp;in&nbsp;a&nbsp;list&nbsp;or&nbsp;produced&nbsp;by&nbsp;a&nbsp;generator&nbsp;are&nbsp;treated&nbsp;as&nbsp;lines.<br>
  24 +dtype&nbsp;:&nbsp;dtype,&nbsp;optional<br>
  25 +&nbsp;&nbsp;&nbsp;&nbsp;Data&nbsp;type&nbsp;of&nbsp;the&nbsp;resulting&nbsp;array.<br>
  26 +&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;None,&nbsp;the&nbsp;dtypes&nbsp;will&nbsp;be&nbsp;determined&nbsp;by&nbsp;the&nbsp;contents&nbsp;of&nbsp;each<br>
  27 +&nbsp;&nbsp;&nbsp;&nbsp;column,&nbsp;individually.<br>
  28 +comments&nbsp;:&nbsp;str,&nbsp;optional<br>
  29 +&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;character&nbsp;used&nbsp;to&nbsp;indicate&nbsp;the&nbsp;start&nbsp;of&nbsp;a&nbsp;comment.<br>
  30 +&nbsp;&nbsp;&nbsp;&nbsp;All&nbsp;the&nbsp;characters&nbsp;occurring&nbsp;on&nbsp;a&nbsp;line&nbsp;after&nbsp;a&nbsp;comment&nbsp;are&nbsp;discarded<br>
  31 +delimiter&nbsp;:&nbsp;str,&nbsp;int,&nbsp;or&nbsp;sequence,&nbsp;optional<br>
  32 +&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;string&nbsp;used&nbsp;to&nbsp;separate&nbsp;values.&nbsp;&nbsp;By&nbsp;default,&nbsp;any&nbsp;consecutive<br>
  33 +&nbsp;&nbsp;&nbsp;&nbsp;whitespaces&nbsp;act&nbsp;as&nbsp;delimiter.&nbsp;&nbsp;An&nbsp;integer&nbsp;or&nbsp;sequence&nbsp;of&nbsp;integers<br>
  34 +&nbsp;&nbsp;&nbsp;&nbsp;can&nbsp;also&nbsp;be&nbsp;provided&nbsp;as&nbsp;width(s)&nbsp;of&nbsp;each&nbsp;field.<br>
  35 +skiprows&nbsp;:&nbsp;int,&nbsp;optional<br>
  36 +&nbsp;&nbsp;&nbsp;&nbsp;`skiprows`&nbsp;was&nbsp;removed&nbsp;in&nbsp;numpy&nbsp;1.10.&nbsp;Please&nbsp;use&nbsp;`skip_header`&nbsp;instead.<br>
  37 +skip_header&nbsp;:&nbsp;int,&nbsp;optional<br>
  38 +&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;number&nbsp;of&nbsp;lines&nbsp;to&nbsp;skip&nbsp;at&nbsp;the&nbsp;beginning&nbsp;of&nbsp;the&nbsp;file.<br>
  39 +skip_footer&nbsp;:&nbsp;int,&nbsp;optional<br>
  40 +&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;number&nbsp;of&nbsp;lines&nbsp;to&nbsp;skip&nbsp;at&nbsp;the&nbsp;end&nbsp;of&nbsp;the&nbsp;file.<br>
  41 +converters&nbsp;:&nbsp;variable,&nbsp;optional<br>
  42 +&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;set&nbsp;of&nbsp;functions&nbsp;that&nbsp;convert&nbsp;the&nbsp;data&nbsp;of&nbsp;a&nbsp;column&nbsp;to&nbsp;a&nbsp;value.<br>
  43 +&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;converters&nbsp;can&nbsp;also&nbsp;be&nbsp;used&nbsp;to&nbsp;provide&nbsp;a&nbsp;default&nbsp;value<br>
  44 +&nbsp;&nbsp;&nbsp;&nbsp;for&nbsp;missing&nbsp;data:&nbsp;``converters&nbsp;=&nbsp;{3:&nbsp;lambda&nbsp;s:&nbsp;float(s&nbsp;or&nbsp;0)}``.<br>
  45 +missing&nbsp;:&nbsp;variable,&nbsp;optional<br>
  46 +&nbsp;&nbsp;&nbsp;&nbsp;`missing`&nbsp;was&nbsp;removed&nbsp;in&nbsp;numpy&nbsp;1.10.&nbsp;Please&nbsp;use&nbsp;`missing_values`<br>
  47 +&nbsp;&nbsp;&nbsp;&nbsp;instead.<br>
  48 +missing_values&nbsp;:&nbsp;variable,&nbsp;optional<br>
  49 +&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;set&nbsp;of&nbsp;strings&nbsp;corresponding&nbsp;to&nbsp;missing&nbsp;data.<br>
  50 +filling_values&nbsp;:&nbsp;variable,&nbsp;optional<br>
  51 +&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;set&nbsp;of&nbsp;values&nbsp;to&nbsp;be&nbsp;used&nbsp;as&nbsp;default&nbsp;when&nbsp;the&nbsp;data&nbsp;are&nbsp;missing.<br>
  52 +usecols&nbsp;:&nbsp;sequence,&nbsp;optional<br>
  53 +&nbsp;&nbsp;&nbsp;&nbsp;Which&nbsp;columns&nbsp;to&nbsp;read,&nbsp;with&nbsp;0&nbsp;being&nbsp;the&nbsp;first.&nbsp;&nbsp;For&nbsp;example,<br>
  54 +&nbsp;&nbsp;&nbsp;&nbsp;``usecols&nbsp;=&nbsp;(1,&nbsp;4,&nbsp;5)``&nbsp;will&nbsp;extract&nbsp;the&nbsp;2nd,&nbsp;5th&nbsp;and&nbsp;6th&nbsp;columns.<br>
  55 +names&nbsp;:&nbsp;{None,&nbsp;True,&nbsp;str,&nbsp;sequence},&nbsp;optional<br>
  56 +&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;`names`&nbsp;is&nbsp;True,&nbsp;the&nbsp;field&nbsp;names&nbsp;are&nbsp;read&nbsp;from&nbsp;the&nbsp;first&nbsp;valid&nbsp;line<br>
  57 +&nbsp;&nbsp;&nbsp;&nbsp;after&nbsp;the&nbsp;first&nbsp;`skip_header`&nbsp;lines.<br>
  58 +&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;`names`&nbsp;is&nbsp;a&nbsp;sequence&nbsp;or&nbsp;a&nbsp;single-string&nbsp;of&nbsp;comma-separated&nbsp;names,<br>
  59 +&nbsp;&nbsp;&nbsp;&nbsp;the&nbsp;names&nbsp;will&nbsp;be&nbsp;used&nbsp;to&nbsp;define&nbsp;the&nbsp;field&nbsp;names&nbsp;in&nbsp;a&nbsp;structured&nbsp;dtype.<br>
  60 +&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;`names`&nbsp;is&nbsp;None,&nbsp;the&nbsp;names&nbsp;of&nbsp;the&nbsp;dtype&nbsp;fields&nbsp;will&nbsp;be&nbsp;used,&nbsp;if&nbsp;any.<br>
  61 +excludelist&nbsp;:&nbsp;sequence,&nbsp;optional<br>
  62 +&nbsp;&nbsp;&nbsp;&nbsp;A&nbsp;list&nbsp;of&nbsp;names&nbsp;to&nbsp;exclude.&nbsp;This&nbsp;list&nbsp;is&nbsp;appended&nbsp;to&nbsp;the&nbsp;default&nbsp;list<br>
  63 +&nbsp;&nbsp;&nbsp;&nbsp;['return','file','print'].&nbsp;Excluded&nbsp;names&nbsp;are&nbsp;appended&nbsp;an&nbsp;underscore:<br>
  64 +&nbsp;&nbsp;&nbsp;&nbsp;for&nbsp;example,&nbsp;`file`&nbsp;would&nbsp;become&nbsp;`file_`.<br>
  65 +deletechars&nbsp;:&nbsp;str,&nbsp;optional<br>
  66 +&nbsp;&nbsp;&nbsp;&nbsp;A&nbsp;string&nbsp;combining&nbsp;invalid&nbsp;characters&nbsp;that&nbsp;must&nbsp;be&nbsp;deleted&nbsp;from&nbsp;the<br>
  67 +&nbsp;&nbsp;&nbsp;&nbsp;names.<br>
  68 +defaultfmt&nbsp;:&nbsp;str,&nbsp;optional<br>
  69 +&nbsp;&nbsp;&nbsp;&nbsp;A&nbsp;format&nbsp;used&nbsp;to&nbsp;define&nbsp;default&nbsp;field&nbsp;names,&nbsp;such&nbsp;as&nbsp;"f%i"&nbsp;or&nbsp;"f_%02i".<br>
  70 +autostrip&nbsp;:&nbsp;bool,&nbsp;optional<br>
  71 +&nbsp;&nbsp;&nbsp;&nbsp;Whether&nbsp;to&nbsp;automatically&nbsp;strip&nbsp;white&nbsp;spaces&nbsp;from&nbsp;the&nbsp;variables.<br>
  72 +replace_space&nbsp;:&nbsp;char,&nbsp;optional<br>
  73 +&nbsp;&nbsp;&nbsp;&nbsp;Character(s)&nbsp;used&nbsp;in&nbsp;replacement&nbsp;of&nbsp;white&nbsp;spaces&nbsp;in&nbsp;the&nbsp;variables<br>
  74 +&nbsp;&nbsp;&nbsp;&nbsp;names.&nbsp;By&nbsp;default,&nbsp;use&nbsp;a&nbsp;'_'.<br>
  75 +case_sensitive&nbsp;:&nbsp;{True,&nbsp;False,&nbsp;'upper',&nbsp;'lower'},&nbsp;optional<br>
  76 +&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;True,&nbsp;field&nbsp;names&nbsp;are&nbsp;case&nbsp;sensitive.<br>
  77 +&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;False&nbsp;or&nbsp;'upper',&nbsp;field&nbsp;names&nbsp;are&nbsp;converted&nbsp;to&nbsp;upper&nbsp;case.<br>
  78 +&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;'lower',&nbsp;field&nbsp;names&nbsp;are&nbsp;converted&nbsp;to&nbsp;lower&nbsp;case.<br>
  79 +unpack&nbsp;:&nbsp;bool,&nbsp;optional<br>
  80 +&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;True,&nbsp;the&nbsp;returned&nbsp;array&nbsp;is&nbsp;transposed,&nbsp;so&nbsp;that&nbsp;arguments&nbsp;may&nbsp;be<br>
  81 +&nbsp;&nbsp;&nbsp;&nbsp;unpacked&nbsp;using&nbsp;``x,&nbsp;y,&nbsp;z&nbsp;=&nbsp;loadtxt(...)``<br>
  82 +usemask&nbsp;:&nbsp;bool,&nbsp;optional<br>
  83 +&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;True,&nbsp;return&nbsp;a&nbsp;masked&nbsp;array.<br>
  84 +&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;False,&nbsp;return&nbsp;a&nbsp;regular&nbsp;array.<br>
  85 +loose&nbsp;:&nbsp;bool,&nbsp;optional<br>
  86 +&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;True,&nbsp;do&nbsp;not&nbsp;raise&nbsp;errors&nbsp;for&nbsp;invalid&nbsp;values.<br>
  87 +invalid_raise&nbsp;:&nbsp;bool,&nbsp;optional<br>
  88 +&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;True,&nbsp;an&nbsp;exception&nbsp;is&nbsp;raised&nbsp;if&nbsp;an&nbsp;inconsistency&nbsp;is&nbsp;detected&nbsp;in&nbsp;the<br>
  89 +&nbsp;&nbsp;&nbsp;&nbsp;number&nbsp;of&nbsp;columns.<br>
  90 +&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;False,&nbsp;a&nbsp;warning&nbsp;is&nbsp;emitted&nbsp;and&nbsp;the&nbsp;offending&nbsp;lines&nbsp;are&nbsp;skipped.<br>
  91 +max_rows&nbsp;:&nbsp;int,&nbsp;&nbsp;optional<br>
  92 +&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;maximum&nbsp;number&nbsp;of&nbsp;rows&nbsp;to&nbsp;read.&nbsp;Must&nbsp;not&nbsp;be&nbsp;used&nbsp;with&nbsp;skip_footer<br>
  93 +&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;the&nbsp;same&nbsp;time.&nbsp;&nbsp;If&nbsp;given,&nbsp;the&nbsp;value&nbsp;must&nbsp;be&nbsp;at&nbsp;least&nbsp;1.&nbsp;Default&nbsp;is<br>
  94 +&nbsp;&nbsp;&nbsp;&nbsp;to&nbsp;read&nbsp;the&nbsp;entire&nbsp;file.<br>
  95 +&nbsp;<br>
  96 +&nbsp;&nbsp;&nbsp;&nbsp;..&nbsp;versionadded::&nbsp;1.10.0<br>
  97 +&nbsp;<br>
  98 +Returns<br>
  99 +-------<br>
  100 +out&nbsp;:&nbsp;ndarray<br>
  101 +&nbsp;&nbsp;&nbsp;&nbsp;Data&nbsp;read&nbsp;from&nbsp;the&nbsp;text&nbsp;file.&nbsp;If&nbsp;`usemask`&nbsp;is&nbsp;True,&nbsp;this&nbsp;is&nbsp;a<br>
  102 +&nbsp;&nbsp;&nbsp;&nbsp;masked&nbsp;array.<br>
  103 +&nbsp;<br>
  104 +See&nbsp;Also<br>
  105 +--------<br>
  106 +numpy.loadtxt&nbsp;:&nbsp;equivalent&nbsp;function&nbsp;when&nbsp;no&nbsp;data&nbsp;is&nbsp;missing.<br>
  107 +&nbsp;<br>
  108 +Notes<br>
  109 +-----<br>
  110 +*&nbsp;When&nbsp;spaces&nbsp;are&nbsp;used&nbsp;as&nbsp;delimiters,&nbsp;or&nbsp;when&nbsp;no&nbsp;delimiter&nbsp;has&nbsp;been&nbsp;given<br>
  111 +&nbsp;&nbsp;as&nbsp;input,&nbsp;there&nbsp;should&nbsp;not&nbsp;be&nbsp;any&nbsp;missing&nbsp;data&nbsp;between&nbsp;two&nbsp;fields.<br>
  112 +*&nbsp;When&nbsp;the&nbsp;variables&nbsp;are&nbsp;named&nbsp;(either&nbsp;by&nbsp;a&nbsp;flexible&nbsp;dtype&nbsp;or&nbsp;with&nbsp;`names`,<br>
  113 +&nbsp;&nbsp;there&nbsp;must&nbsp;not&nbsp;be&nbsp;any&nbsp;header&nbsp;in&nbsp;the&nbsp;file&nbsp;(else&nbsp;a&nbsp;ValueError<br>
  114 +&nbsp;&nbsp;exception&nbsp;is&nbsp;raised).<br>
  115 +*&nbsp;Individual&nbsp;values&nbsp;are&nbsp;not&nbsp;stripped&nbsp;of&nbsp;spaces&nbsp;by&nbsp;default.<br>
  116 +&nbsp;&nbsp;When&nbsp;using&nbsp;a&nbsp;custom&nbsp;converter,&nbsp;make&nbsp;sure&nbsp;the&nbsp;function&nbsp;does&nbsp;remove&nbsp;spaces.<br>
  117 +&nbsp;<br>
  118 +References<br>
  119 +----------<br>
  120 +..&nbsp;[1]&nbsp;NumPy&nbsp;User&nbsp;Guide,&nbsp;section&nbsp;`I/O&nbsp;with&nbsp;NumPy<br>
  121 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;<a href="http://docs.scipy.org/doc/numpy/user/basics.io.genfromtxt.html&gt;`_">http://docs.scipy.org/doc/numpy/user/basics.io.genfromtxt.html&gt;`_</a>.<br>
  122 +&nbsp;<br>
  123 +Examples<br>
  124 +---------<br>
  125 +&gt;&gt;&gt;&nbsp;from&nbsp;io&nbsp;import&nbsp;StringIO<br>
  126 +&gt;&gt;&gt;&nbsp;import&nbsp;numpy&nbsp;as&nbsp;np<br>
  127 +&nbsp;<br>
  128 +Comma&nbsp;delimited&nbsp;file&nbsp;with&nbsp;mixed&nbsp;dtype<br>
  129 +&nbsp;<br>
  130 +&gt;&gt;&gt;&nbsp;s&nbsp;=&nbsp;StringIO("1,1.3,abcde")<br>
  131 +&gt;&gt;&gt;&nbsp;data&nbsp;=&nbsp;np.genfromtxt(s,&nbsp;dtype=[('myint','i8'),('myfloat','f8'),<br>
  132 +...&nbsp;('mystring','S5')],&nbsp;delimiter=",")<br>
  133 +&gt;&gt;&gt;&nbsp;data<br>
  134 +array((1,&nbsp;1.3,&nbsp;'abcde'),<br>
  135 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dtype=[('myint',&nbsp;'&lt;i8'),&nbsp;('myfloat',&nbsp;'&lt;f8'),&nbsp;('mystring',&nbsp;'|S5')])<br>
  136 +&nbsp;<br>
  137 +Using&nbsp;dtype&nbsp;=&nbsp;None<br>
  138 +&nbsp;<br>
  139 +&gt;&gt;&gt;&nbsp;s.seek(0)&nbsp;#&nbsp;needed&nbsp;for&nbsp;StringIO&nbsp;example&nbsp;only<br>
  140 +&gt;&gt;&gt;&nbsp;data&nbsp;=&nbsp;np.genfromtxt(s,&nbsp;dtype=None,<br>
  141 +...&nbsp;names&nbsp;=&nbsp;['myint','myfloat','mystring'],&nbsp;delimiter=",")<br>
  142 +&gt;&gt;&gt;&nbsp;data<br>
  143 +array((1,&nbsp;1.3,&nbsp;'abcde'),<br>
  144 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dtype=[('myint',&nbsp;'&lt;i8'),&nbsp;('myfloat',&nbsp;'&lt;f8'),&nbsp;('mystring',&nbsp;'|S5')])<br>
  145 +&nbsp;<br>
  146 +Specifying&nbsp;dtype&nbsp;and&nbsp;names<br>
  147 +&nbsp;<br>
  148 +&gt;&gt;&gt;&nbsp;s.seek(0)<br>
  149 +&gt;&gt;&gt;&nbsp;data&nbsp;=&nbsp;np.genfromtxt(s,&nbsp;dtype="i8,f8,S5",<br>
  150 +...&nbsp;names=['myint','myfloat','mystring'],&nbsp;delimiter=",")<br>
  151 +&gt;&gt;&gt;&nbsp;data<br>
  152 +array((1,&nbsp;1.3,&nbsp;'abcde'),<br>
  153 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dtype=[('myint',&nbsp;'&lt;i8'),&nbsp;('myfloat',&nbsp;'&lt;f8'),&nbsp;('mystring',&nbsp;'|S5')])<br>
  154 +&nbsp;<br>
  155 +An&nbsp;example&nbsp;with&nbsp;fixed-width&nbsp;columns<br>
  156 +&nbsp;<br>
  157 +&gt;&gt;&gt;&nbsp;s&nbsp;=&nbsp;StringIO("11.3abcde")<br>
  158 +&gt;&gt;&gt;&nbsp;data&nbsp;=&nbsp;np.genfromtxt(s,&nbsp;dtype=None,&nbsp;names=['intvar','fltvar','strvar'],<br>
  159 +...&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;delimiter=[1,3,5])<br>
  160 +&gt;&gt;&gt;&nbsp;data<br>
  161 +array((1,&nbsp;1.3,&nbsp;'abcde'),<br>
  162 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dtype=[('intvar',&nbsp;'&lt;i8'),&nbsp;('fltvar',&nbsp;'&lt;f8'),&nbsp;('strvar',&nbsp;'|S5')])</tt></dd></dl>
  163 +
  164 +</div></div>
chunks/doc-np-mean.md View file @ 9186cc5
  1 +## Moyenne d'un tableau avec `np.mean` {autodoc}
  2 +<div class='scrollatbottom'>
  3 +<ul>
  4 +<li>Premier paramètre : tableau à traiter</li>
  5 +<li>Paramètre nommé <code>axis</code> : axe selon lequel moyenner</li>
  6 +<li>Paramètre nommé <code>keepdims</code> : conserve le nombre de dimensions (si <code>keepdims=True</code>) </li>
  7 +</ul>
  8 +
  9 +<div class='scroll'>
  10 +Python Library Documentation: function mean in numpy
  11 +
  12 +<dl><dt><a name="-numpy.mean"><strong>numpy.mean</strong></a> = mean(a, axis=None, dtype=None, out=None, keepdims=&lt;class 'numpy._globals._NoValue'&gt;)</dt><dd><tt>Compute&nbsp;the&nbsp;arithmetic&nbsp;mean&nbsp;along&nbsp;the&nbsp;specified&nbsp;axis.<br>
  13 +&nbsp;<br>
  14 +Returns&nbsp;the&nbsp;average&nbsp;of&nbsp;the&nbsp;array&nbsp;elements.&nbsp;&nbsp;The&nbsp;average&nbsp;is&nbsp;taken&nbsp;over<br>
  15 +the&nbsp;flattened&nbsp;array&nbsp;by&nbsp;default,&nbsp;otherwise&nbsp;over&nbsp;the&nbsp;specified&nbsp;axis.<br>
  16 +`float64`&nbsp;intermediate&nbsp;and&nbsp;return&nbsp;values&nbsp;are&nbsp;used&nbsp;for&nbsp;integer&nbsp;inputs.<br>
  17 +&nbsp;<br>
  18 +Parameters<br>
  19 +----------<br>
  20 +a&nbsp;:&nbsp;array_like<br>
  21 +&nbsp;&nbsp;&nbsp;&nbsp;Array&nbsp;containing&nbsp;numbers&nbsp;whose&nbsp;mean&nbsp;is&nbsp;desired.&nbsp;If&nbsp;`a`&nbsp;is&nbsp;not&nbsp;an<br>
  22 +&nbsp;&nbsp;&nbsp;&nbsp;array,&nbsp;a&nbsp;conversion&nbsp;is&nbsp;attempted.<br>
  23 +axis&nbsp;:&nbsp;None&nbsp;or&nbsp;int&nbsp;or&nbsp;tuple&nbsp;of&nbsp;ints,&nbsp;optional<br>
  24 +&nbsp;&nbsp;&nbsp;&nbsp;Axis&nbsp;or&nbsp;axes&nbsp;along&nbsp;which&nbsp;the&nbsp;means&nbsp;are&nbsp;computed.&nbsp;The&nbsp;default&nbsp;is&nbsp;to<br>
  25 +&nbsp;&nbsp;&nbsp;&nbsp;compute&nbsp;the&nbsp;mean&nbsp;of&nbsp;the&nbsp;flattened&nbsp;array.<br>
  26 +&nbsp;<br>
  27 +&nbsp;&nbsp;&nbsp;&nbsp;..&nbsp;versionadded::&nbsp;1.7.0<br>
  28 +&nbsp;<br>
  29 +&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;this&nbsp;is&nbsp;a&nbsp;tuple&nbsp;of&nbsp;ints,&nbsp;a&nbsp;mean&nbsp;is&nbsp;performed&nbsp;over&nbsp;multiple&nbsp;axes,<br>
  30 +&nbsp;&nbsp;&nbsp;&nbsp;instead&nbsp;of&nbsp;a&nbsp;single&nbsp;axis&nbsp;or&nbsp;all&nbsp;the&nbsp;axes&nbsp;as&nbsp;before.<br>
  31 +dtype&nbsp;:&nbsp;data-type,&nbsp;optional<br>
  32 +&nbsp;&nbsp;&nbsp;&nbsp;Type&nbsp;to&nbsp;use&nbsp;in&nbsp;computing&nbsp;the&nbsp;mean.&nbsp;&nbsp;For&nbsp;integer&nbsp;inputs,&nbsp;the&nbsp;default<br>
  33 +&nbsp;&nbsp;&nbsp;&nbsp;is&nbsp;`float64`;&nbsp;for&nbsp;floating&nbsp;point&nbsp;inputs,&nbsp;it&nbsp;is&nbsp;the&nbsp;same&nbsp;as&nbsp;the<br>
  34 +&nbsp;&nbsp;&nbsp;&nbsp;input&nbsp;dtype.<br>
  35 +out&nbsp;:&nbsp;ndarray,&nbsp;optional<br>
  36 +&nbsp;&nbsp;&nbsp;&nbsp;Alternate&nbsp;output&nbsp;array&nbsp;in&nbsp;which&nbsp;to&nbsp;place&nbsp;the&nbsp;result.&nbsp;&nbsp;The&nbsp;default<br>
  37 +&nbsp;&nbsp;&nbsp;&nbsp;is&nbsp;``None``;&nbsp;if&nbsp;provided,&nbsp;it&nbsp;must&nbsp;have&nbsp;the&nbsp;same&nbsp;shape&nbsp;as&nbsp;the<br>
  38 +&nbsp;&nbsp;&nbsp;&nbsp;expected&nbsp;output,&nbsp;but&nbsp;the&nbsp;type&nbsp;will&nbsp;be&nbsp;cast&nbsp;if&nbsp;necessary.<br>
  39 +&nbsp;&nbsp;&nbsp;&nbsp;See&nbsp;`doc.ufuncs`&nbsp;for&nbsp;details.<br>
  40 +&nbsp;<br>
  41 +keepdims&nbsp;:&nbsp;bool,&nbsp;optional<br>
  42 +&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;this&nbsp;is&nbsp;set&nbsp;to&nbsp;True,&nbsp;the&nbsp;axes&nbsp;which&nbsp;are&nbsp;reduced&nbsp;are&nbsp;left<br>
  43 +&nbsp;&nbsp;&nbsp;&nbsp;in&nbsp;the&nbsp;result&nbsp;as&nbsp;dimensions&nbsp;with&nbsp;size&nbsp;one.&nbsp;With&nbsp;this&nbsp;option,<br>
  44 +&nbsp;&nbsp;&nbsp;&nbsp;the&nbsp;result&nbsp;will&nbsp;broadcast&nbsp;correctly&nbsp;against&nbsp;the&nbsp;input&nbsp;array.<br>
  45 +&nbsp;<br>
  46 +&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;the&nbsp;default&nbsp;value&nbsp;is&nbsp;passed,&nbsp;then&nbsp;`keepdims`&nbsp;will&nbsp;not&nbsp;be<br>
  47 +&nbsp;&nbsp;&nbsp;&nbsp;passed&nbsp;through&nbsp;to&nbsp;the&nbsp;`mean`&nbsp;method&nbsp;of&nbsp;sub-classes&nbsp;of<br>
  48 +&nbsp;&nbsp;&nbsp;&nbsp;`ndarray`,&nbsp;however&nbsp;any&nbsp;non-default&nbsp;value&nbsp;will&nbsp;be.&nbsp;&nbsp;If&nbsp;the<br>
  49 +&nbsp;&nbsp;&nbsp;&nbsp;sub-classes&nbsp;`sum`&nbsp;method&nbsp;does&nbsp;not&nbsp;implement&nbsp;`keepdims`&nbsp;any<br>
  50 +&nbsp;&nbsp;&nbsp;&nbsp;exceptions&nbsp;will&nbsp;be&nbsp;raised.<br>
  51 +&nbsp;<br>
  52 +Returns<br>
  53 +-------<br>
  54 +m&nbsp;:&nbsp;ndarray,&nbsp;see&nbsp;dtype&nbsp;parameter&nbsp;above<br>
  55 +&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;`out=None`,&nbsp;returns&nbsp;a&nbsp;new&nbsp;array&nbsp;containing&nbsp;the&nbsp;mean&nbsp;values,<br>
  56 +&nbsp;&nbsp;&nbsp;&nbsp;otherwise&nbsp;a&nbsp;reference&nbsp;to&nbsp;the&nbsp;output&nbsp;array&nbsp;is&nbsp;returned.<br>
  57 +&nbsp;<br>
  58 +See&nbsp;Also<br>
  59 +--------<br>
  60 +average&nbsp;:&nbsp;Weighted&nbsp;average<br>
  61 +std,&nbsp;var,&nbsp;nanmean,&nbsp;nanstd,&nbsp;nanvar<br>
  62 +&nbsp;<br>
  63 +Notes<br>
  64 +-----<br>
  65 +The&nbsp;arithmetic&nbsp;mean&nbsp;is&nbsp;the&nbsp;sum&nbsp;of&nbsp;the&nbsp;elements&nbsp;along&nbsp;the&nbsp;axis&nbsp;divided<br>
  66 +by&nbsp;the&nbsp;number&nbsp;of&nbsp;elements.<br>
  67 +&nbsp;<br>
  68 +Note&nbsp;that&nbsp;for&nbsp;floating-point&nbsp;input,&nbsp;the&nbsp;mean&nbsp;is&nbsp;computed&nbsp;using&nbsp;the<br>
  69 +same&nbsp;precision&nbsp;the&nbsp;input&nbsp;has.&nbsp;&nbsp;Depending&nbsp;on&nbsp;the&nbsp;input&nbsp;data,&nbsp;this&nbsp;can<br>
  70 +cause&nbsp;the&nbsp;results&nbsp;to&nbsp;be&nbsp;inaccurate,&nbsp;especially&nbsp;for&nbsp;`float32`&nbsp;(see<br>
  71 +example&nbsp;below).&nbsp;&nbsp;Specifying&nbsp;a&nbsp;higher-precision&nbsp;accumulator&nbsp;using&nbsp;the<br>
  72 +`dtype`&nbsp;keyword&nbsp;can&nbsp;alleviate&nbsp;this&nbsp;issue.<br>
  73 +&nbsp;<br>
  74 +By&nbsp;default,&nbsp;`float16`&nbsp;results&nbsp;are&nbsp;computed&nbsp;using&nbsp;`float32`&nbsp;intermediates<br>
  75 +for&nbsp;extra&nbsp;precision.<br>
  76 +&nbsp;<br>
  77 +Examples<br>
  78 +--------<br>
  79 +&gt;&gt;&gt;&nbsp;a&nbsp;=&nbsp;np.array([[1,&nbsp;2],&nbsp;[3,&nbsp;4]])<br>
  80 +&gt;&gt;&gt;&nbsp;np.mean(a)<br>
  81 +2.5<br>
  82 +&gt;&gt;&gt;&nbsp;np.mean(a,&nbsp;axis=0)<br>
  83 +array([&nbsp;2.,&nbsp;&nbsp;3.])<br>
  84 +&gt;&gt;&gt;&nbsp;np.mean(a,&nbsp;axis=1)<br>
  85 +array([&nbsp;1.5,&nbsp;&nbsp;3.5])<br>
  86 +&nbsp;<br>
  87 +In&nbsp;single&nbsp;precision,&nbsp;`mean`&nbsp;can&nbsp;be&nbsp;inaccurate:<br>
  88 +&nbsp;<br>
  89 +&gt;&gt;&gt;&nbsp;a&nbsp;=&nbsp;np.zeros((2,&nbsp;512*512),&nbsp;dtype=np.float32)<br>
  90 +&gt;&gt;&gt;&nbsp;a[0,&nbsp;:]&nbsp;=&nbsp;1.0<br>
  91 +&gt;&gt;&gt;&nbsp;a[1,&nbsp;:]&nbsp;=&nbsp;0.1<br>
  92 +&gt;&gt;&gt;&nbsp;np.mean(a)<br>
  93 +0.54999924<br>
  94 +&nbsp;<br>
  95 +Computing&nbsp;the&nbsp;mean&nbsp;in&nbsp;float64&nbsp;is&nbsp;more&nbsp;accurate:<br>
  96 +&nbsp;<br>
  97 +&gt;&gt;&gt;&nbsp;np.mean(a,&nbsp;dtype=np.float64)<br>
  98 +0.55000000074505806</tt></dd></dl>
  99 +
  100 +</div></div>
chunks/doc-plt-annotate.md View file @ 9186cc5
  1 +## Annoter un point avec `plt.annotate` {autodoc}
  2 +<div class='scrollatbottom'>
  3 +<ul>
  4 +<li>Paramètre 1 : texte à afficher (chaîne de caractères)</li>
  5 +<li>Paramètre 2 : paire (2-uplet) position "x,y" du point à annoter</li>
  6 +<li>Paramètre 3 : paire (2-uplet) position "x,y" du texte</li>
  7 +<li>Paramètres nommés intéressants : <code>arrowprops=dict(arrowstyle= "->")</code> (pour tracer une flêche), <code>xycoords</code> (repère pour les coordonnées du point annoté), <code>textcoords</code> (repère pour les coordonnées du texte)</li>
  8 +</ul>
  9 +
  10 +<div class='scroll'>
  11 +Python Library Documentation: function annotate in matplotlib.pyplot
  12 +
  13 +<dl><dt><a name="-matplotlib.pyplot.annotate"><strong>matplotlib.pyplot.annotate</strong></a> = annotate(*args, **kwargs)</dt><dd><tt>Create&nbsp;an&nbsp;annotation:&nbsp;a&nbsp;piece&nbsp;of&nbsp;text&nbsp;referring&nbsp;to&nbsp;a&nbsp;data<br>
  14 +point.<br>
  15 +&nbsp;<br>
  16 +Parameters<br>
  17 +----------<br>
  18 +s&nbsp;:&nbsp;string<br>
  19 +&nbsp;&nbsp;&nbsp;&nbsp;label<br>
  20 +&nbsp;<br>
  21 +xy&nbsp;:&nbsp;(x,&nbsp;y)<br>
  22 +&nbsp;&nbsp;&nbsp;&nbsp;position&nbsp;of&nbsp;element&nbsp;to&nbsp;annotate.&nbsp;See&nbsp;*xycoords*&nbsp;to&nbsp;control&nbsp;what<br>
  23 +&nbsp;&nbsp;&nbsp;&nbsp;coordinate&nbsp;system&nbsp;this&nbsp;value&nbsp;is&nbsp;interpretated&nbsp;in.<br>
  24 +&nbsp;<br>
  25 +xytext&nbsp;:&nbsp;(x,&nbsp;y)&nbsp;,&nbsp;optional,&nbsp;default:&nbsp;None<br>
  26 +&nbsp;&nbsp;&nbsp;&nbsp;position&nbsp;of&nbsp;the&nbsp;label&nbsp;`s`.&nbsp;See&nbsp;*textcoords*&nbsp;to&nbsp;control&nbsp;what<br>
  27 +&nbsp;&nbsp;&nbsp;&nbsp;coordinate&nbsp;system&nbsp;this&nbsp;value&nbsp;is&nbsp;interpreted&nbsp;in.<br>
  28 +&nbsp;<br>
  29 +xycoords&nbsp;:&nbsp;string,&nbsp;optional,&nbsp;default:&nbsp;"data"<br>
  30 +&nbsp;&nbsp;&nbsp;&nbsp;string&nbsp;that&nbsp;indicates&nbsp;what&nbsp;type&nbsp;of&nbsp;coordinates&nbsp;`xy`&nbsp;is.&nbsp;Examples:<br>
  31 +&nbsp;&nbsp;&nbsp;&nbsp;"figure&nbsp;points",&nbsp;"figure&nbsp;pixels",&nbsp;"figure&nbsp;fraction",&nbsp;"axes<br>
  32 +&nbsp;&nbsp;&nbsp;&nbsp;points",&nbsp;....&nbsp;See&nbsp;`matplotlib.text.Annotation`&nbsp;for&nbsp;more&nbsp;details.<br>
  33 +&nbsp;<br>
  34 +textcoords&nbsp;:&nbsp;string,&nbsp;optional,&nbsp;default:&nbsp;None<br>
  35 +&nbsp;&nbsp;&nbsp;&nbsp;string&nbsp;that&nbsp;indicates&nbsp;what&nbsp;type&nbsp;of&nbsp;coordinates&nbsp;`text`&nbsp;is.&nbsp;Examples:<br>
  36 +&nbsp;&nbsp;&nbsp;&nbsp;"figure&nbsp;points",&nbsp;"figure&nbsp;pixels",&nbsp;"figure&nbsp;fraction",&nbsp;"axes<br>
  37 +&nbsp;&nbsp;&nbsp;&nbsp;points",&nbsp;....&nbsp;See&nbsp;`matplotlib.text.Annotation`&nbsp;for&nbsp;more&nbsp;details.<br>
  38 +&nbsp;<br>
  39 +arrowprops&nbsp;:&nbsp;`matplotlib.lines.Line2D`&nbsp;properties,&nbsp;optional<br>
  40 +&nbsp;&nbsp;&nbsp;&nbsp;Dictionary&nbsp;of&nbsp;line&nbsp;properties&nbsp;for&nbsp;the&nbsp;arrow&nbsp;that&nbsp;connects<br>
  41 +&nbsp;&nbsp;&nbsp;&nbsp;the&nbsp;annotation&nbsp;to&nbsp;the&nbsp;point.&nbsp;If&nbsp;the&nbsp;dictionnary&nbsp;has&nbsp;a&nbsp;key<br>
  42 +&nbsp;&nbsp;&nbsp;&nbsp;`arrowstyle`,&nbsp;a&nbsp;`~matplotlib.patches.FancyArrowPatch`<br>
  43 +&nbsp;&nbsp;&nbsp;&nbsp;instance&nbsp;is&nbsp;created&nbsp;and&nbsp;drawn.&nbsp;&nbsp;See<br>
  44 +&nbsp;&nbsp;&nbsp;&nbsp;`matplotlib.text.Annotation`&nbsp;for&nbsp;more&nbsp;details&nbsp;on&nbsp;valid<br>
  45 +&nbsp;&nbsp;&nbsp;&nbsp;options.&nbsp;Default&nbsp;is&nbsp;None.<br>
  46 +&nbsp;<br>
  47 +Returns<br>
  48 +-------<br>
  49 +a&nbsp;:&nbsp;`~matplotlib.text.Annotation`<br>
  50 +&nbsp;<br>
  51 +&nbsp;<br>
  52 +Notes<br>
  53 +-----<br>
  54 +&nbsp;<br>
  55 +*arrowprops*,&nbsp;if&nbsp;not&nbsp;*None*,&nbsp;is&nbsp;a&nbsp;dictionary&nbsp;of&nbsp;line&nbsp;properties<br>
  56 +(see&nbsp;:class:`matplotlib.lines.Line2D`)&nbsp;for&nbsp;the&nbsp;arrow&nbsp;that&nbsp;connects<br>
  57 +annotation&nbsp;to&nbsp;the&nbsp;point.<br>
  58 +&nbsp;<br>
  59 +If&nbsp;the&nbsp;dictionary&nbsp;has&nbsp;a&nbsp;key&nbsp;*arrowstyle*,&nbsp;a<br>
  60 +`~matplotlib.patches.FancyArrowPatch`&nbsp;instance&nbsp;is&nbsp;created&nbsp;with<br>
  61 +the&nbsp;given&nbsp;dictionary&nbsp;and&nbsp;is&nbsp;drawn.&nbsp;Otherwise,&nbsp;a<br>
  62 +`~matplotlib.patches.YAArrow`&nbsp;patch&nbsp;instance&nbsp;is&nbsp;created&nbsp;and<br>
  63 +drawn.&nbsp;Valid&nbsp;keys&nbsp;for&nbsp;`~matplotlib.patches.YAArrow`&nbsp;are:<br>
  64 +&nbsp;<br>
  65 +&nbsp;<br>
  66 +=========&nbsp;&nbsp;&nbsp;===========================================================<br>
  67 +Key&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Description<br>
  68 +=========&nbsp;&nbsp;&nbsp;===========================================================<br>
  69 +width&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;the&nbsp;width&nbsp;of&nbsp;the&nbsp;arrow&nbsp;in&nbsp;points<br>
  70 +frac&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;the&nbsp;fraction&nbsp;of&nbsp;the&nbsp;arrow&nbsp;length&nbsp;occupied&nbsp;by&nbsp;the&nbsp;head<br>
  71 +headwidth&nbsp;&nbsp;&nbsp;the&nbsp;width&nbsp;of&nbsp;the&nbsp;base&nbsp;of&nbsp;the&nbsp;arrow&nbsp;head&nbsp;in&nbsp;points<br>
  72 +shrink&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;oftentimes&nbsp;it&nbsp;is&nbsp;convenient&nbsp;to&nbsp;have&nbsp;the&nbsp;arrowtip<br>
  73 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;and&nbsp;base&nbsp;a&nbsp;bit&nbsp;away&nbsp;from&nbsp;the&nbsp;text&nbsp;and&nbsp;point&nbsp;being<br>
  74 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;annotated.&nbsp;&nbsp;If&nbsp;*d*&nbsp;is&nbsp;the&nbsp;distance&nbsp;between&nbsp;the&nbsp;text&nbsp;and<br>
  75 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;annotated&nbsp;point,&nbsp;shrink&nbsp;will&nbsp;shorten&nbsp;the&nbsp;arrow&nbsp;so&nbsp;the&nbsp;tip<br>
  76 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;and&nbsp;base&nbsp;are&nbsp;shink&nbsp;percent&nbsp;of&nbsp;the&nbsp;distance&nbsp;*d*&nbsp;away&nbsp;from<br>
  77 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;the&nbsp;endpoints.&nbsp;&nbsp;i.e.,&nbsp;``shrink=0.05&nbsp;is&nbsp;5%``<br>
  78 +?&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;any&nbsp;key&nbsp;for&nbsp;:class:`matplotlib.patches.polygon`<br>
  79 +=========&nbsp;&nbsp;&nbsp;===========================================================<br>
  80 +&nbsp;<br>
  81 +&nbsp;<br>
  82 +Valid&nbsp;keys&nbsp;for&nbsp;`~matplotlib.patches.FancyArrowPatch`&nbsp;are:<br>
  83 +&nbsp;<br>
  84 +&nbsp;<br>
  85 +===============&nbsp;&nbsp;======================================================<br>
  86 +Key&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Description<br>
  87 +===============&nbsp;&nbsp;======================================================<br>
  88 +arrowstyle&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;the&nbsp;arrow&nbsp;style<br>
  89 +connectionstyle&nbsp;&nbsp;the&nbsp;connection&nbsp;style<br>
  90 +relpos&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;default&nbsp;is&nbsp;(0.5,&nbsp;0.5)<br>
  91 +patchA&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;default&nbsp;is&nbsp;bounding&nbsp;box&nbsp;of&nbsp;the&nbsp;text<br>
  92 +patchB&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;default&nbsp;is&nbsp;None<br>
  93 +shrinkA&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;default&nbsp;is&nbsp;2&nbsp;points<br>
  94 +shrinkB&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;default&nbsp;is&nbsp;2&nbsp;points<br>
  95 +mutation_scale&nbsp;&nbsp;&nbsp;default&nbsp;is&nbsp;text&nbsp;size&nbsp;(in&nbsp;points)<br>
  96 +mutation_aspect&nbsp;&nbsp;default&nbsp;is&nbsp;1.<br>
  97 +?&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;any&nbsp;key&nbsp;for&nbsp;:class:`matplotlib.patches.PathPatch`<br>
  98 +===============&nbsp;&nbsp;======================================================<br>
  99 +&nbsp;<br>
  100 +&nbsp;<br>
  101 +*xycoords*&nbsp;and&nbsp;*textcoords*&nbsp;are&nbsp;strings&nbsp;that&nbsp;indicate&nbsp;the<br>
  102 +coordinates&nbsp;of&nbsp;*xy*&nbsp;and&nbsp;*xytext*,&nbsp;and&nbsp;may&nbsp;be&nbsp;one&nbsp;of&nbsp;the<br>
  103 +following&nbsp;values:<br>
  104 +&nbsp;<br>
  105 +=================&nbsp;&nbsp;&nbsp;===================================================<br>
  106 +Property&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Description<br>
  107 +=================&nbsp;&nbsp;&nbsp;===================================================<br>
  108 +'figure&nbsp;points'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;points&nbsp;from&nbsp;the&nbsp;lower&nbsp;left&nbsp;corner&nbsp;of&nbsp;the&nbsp;figure<br>
  109 +'figure&nbsp;pixels'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pixels&nbsp;from&nbsp;the&nbsp;lower&nbsp;left&nbsp;corner&nbsp;of&nbsp;the&nbsp;figure<br>
  110 +'figure&nbsp;fraction'&nbsp;&nbsp;&nbsp;0,0&nbsp;is&nbsp;lower&nbsp;left&nbsp;of&nbsp;figure&nbsp;and&nbsp;1,1&nbsp;is&nbsp;upper&nbsp;right<br>
  111 +'axes&nbsp;points'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;points&nbsp;from&nbsp;lower&nbsp;left&nbsp;corner&nbsp;of&nbsp;axes<br>
  112 +'axes&nbsp;pixels'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pixels&nbsp;from&nbsp;lower&nbsp;left&nbsp;corner&nbsp;of&nbsp;axes<br>
  113 +'axes&nbsp;fraction'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0,0&nbsp;is&nbsp;lower&nbsp;left&nbsp;of&nbsp;axes&nbsp;and&nbsp;1,1&nbsp;is&nbsp;upper&nbsp;right<br>
  114 +'data'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;use&nbsp;the&nbsp;coordinate&nbsp;system&nbsp;of&nbsp;the&nbsp;object&nbsp;being<br>
  115 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;annotated&nbsp;(default)<br>
  116 +'offset&nbsp;points'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Specify&nbsp;an&nbsp;offset&nbsp;(in&nbsp;points)&nbsp;from&nbsp;the&nbsp;*xy*&nbsp;value<br>
  117 +&nbsp;<br>
  118 +'polar'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;you&nbsp;can&nbsp;specify&nbsp;*theta*,&nbsp;*r*&nbsp;for&nbsp;the&nbsp;annotation,<br>
  119 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;even&nbsp;in&nbsp;cartesian&nbsp;plots.&nbsp;&nbsp;Note&nbsp;that&nbsp;if&nbsp;you<br>
  120 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;are&nbsp;using&nbsp;a&nbsp;polar&nbsp;axes,&nbsp;you&nbsp;do&nbsp;not&nbsp;need<br>
  121 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;to&nbsp;specify&nbsp;polar&nbsp;for&nbsp;the&nbsp;coordinate<br>
  122 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;system&nbsp;since&nbsp;that&nbsp;is&nbsp;the&nbsp;native&nbsp;"data"&nbsp;coordinate<br>
  123 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;system.<br>
  124 +=================&nbsp;&nbsp;&nbsp;===================================================<br>
  125 +&nbsp;<br>
  126 +If&nbsp;a&nbsp;'points'&nbsp;or&nbsp;'pixels'&nbsp;option&nbsp;is&nbsp;specified,&nbsp;values&nbsp;will&nbsp;be<br>
  127 +added&nbsp;to&nbsp;the&nbsp;bottom-left&nbsp;and&nbsp;if&nbsp;negative,&nbsp;values&nbsp;will&nbsp;be<br>
  128 +subtracted&nbsp;from&nbsp;the&nbsp;top-right.&nbsp;&nbsp;e.g.::<br>
  129 +&nbsp;<br>
  130 +&nbsp;&nbsp;#&nbsp;10&nbsp;points&nbsp;to&nbsp;the&nbsp;right&nbsp;of&nbsp;the&nbsp;left&nbsp;border&nbsp;of&nbsp;the&nbsp;axes&nbsp;and<br>
  131 +&nbsp;&nbsp;#&nbsp;5&nbsp;points&nbsp;below&nbsp;the&nbsp;top&nbsp;border<br>
  132 +&nbsp;&nbsp;xy=(10,-5),&nbsp;xycoords='axes&nbsp;points'<br>
  133 +&nbsp;<br>
  134 +You&nbsp;may&nbsp;use&nbsp;an&nbsp;instance&nbsp;of<br>
  135 +:class:`~matplotlib.transforms.Transform`&nbsp;or<br>
  136 +:class:`~matplotlib.artist.Artist`.&nbsp;See<br>
  137 +:ref:`plotting-guide-annotation`&nbsp;for&nbsp;more&nbsp;details.<br>
  138 +&nbsp;<br>
  139 +The&nbsp;*annotation_clip*&nbsp;attribute&nbsp;controls&nbsp;the&nbsp;visibility&nbsp;of&nbsp;the<br>
  140 +annotation&nbsp;when&nbsp;it&nbsp;goes&nbsp;outside&nbsp;the&nbsp;axes&nbsp;area.&nbsp;If&nbsp;`True`,&nbsp;the<br>
  141 +annotation&nbsp;will&nbsp;only&nbsp;be&nbsp;drawn&nbsp;when&nbsp;the&nbsp;*xy*&nbsp;is&nbsp;inside&nbsp;the<br>
  142 +axes.&nbsp;If&nbsp;`False`,&nbsp;the&nbsp;annotation&nbsp;will&nbsp;always&nbsp;be&nbsp;drawn<br>
  143 +regardless&nbsp;of&nbsp;its&nbsp;position.&nbsp;&nbsp;The&nbsp;default&nbsp;is&nbsp;`None`,&nbsp;which<br>
  144 +behave&nbsp;as&nbsp;`True`&nbsp;only&nbsp;if&nbsp;*xycoords*&nbsp;is&nbsp;"data".<br>
  145 +&nbsp;<br>
  146 +Additional&nbsp;kwargs&nbsp;are&nbsp;`~matplotlib.text.Text`&nbsp;properties:<br>
  147 +&nbsp;<br>
  148 +&nbsp;&nbsp;agg_filter:&nbsp;unknown<br>
  149 +&nbsp;&nbsp;alpha:&nbsp;float&nbsp;(0.0&nbsp;transparent&nbsp;through&nbsp;1.0&nbsp;opaque)&nbsp;<br>
  150 +&nbsp;&nbsp;animated:&nbsp;[True&nbsp;|&nbsp;False]&nbsp;<br>
  151 +&nbsp;&nbsp;axes:&nbsp;an&nbsp;:class:`~matplotlib.axes.Axes`&nbsp;instance&nbsp;<br>
  152 +&nbsp;&nbsp;backgroundcolor:&nbsp;any&nbsp;matplotlib&nbsp;color&nbsp;<br>
  153 +&nbsp;&nbsp;bbox:&nbsp;FancyBboxPatch&nbsp;prop&nbsp;dict&nbsp;<br>
  154 +&nbsp;&nbsp;clip_box:&nbsp;a&nbsp;:class:`matplotlib.transforms.Bbox`&nbsp;instance&nbsp;<br>
  155 +&nbsp;&nbsp;clip_on:&nbsp;[True&nbsp;|&nbsp;False]&nbsp;<br>
  156 +&nbsp;&nbsp;clip_path:&nbsp;[&nbsp;(:class:`~matplotlib.path.Path`,&nbsp;:class:`~matplotlib.transforms.Transform`)&nbsp;|&nbsp;:class:`~matplotlib.patches.Patch`&nbsp;|&nbsp;None&nbsp;]&nbsp;<br>
  157 +&nbsp;&nbsp;color:&nbsp;any&nbsp;matplotlib&nbsp;color&nbsp;<br>
  158 +&nbsp;&nbsp;contains:&nbsp;a&nbsp;callable&nbsp;function&nbsp;<br>
  159 +&nbsp;&nbsp;family&nbsp;or&nbsp;name&nbsp;or&nbsp;fontfamily&nbsp;or&nbsp;fontname:&nbsp;[FONTNAME&nbsp;|&nbsp;'serif'&nbsp;|&nbsp;'sans-serif'&nbsp;|&nbsp;'cursive'&nbsp;|&nbsp;'fantasy'&nbsp;|&nbsp;'monospace'&nbsp;]&nbsp;<br>
  160 +&nbsp;&nbsp;figure:&nbsp;a&nbsp;:class:`matplotlib.figure.Figure`&nbsp;instance&nbsp;<br>
  161 +&nbsp;&nbsp;fontproperties&nbsp;or&nbsp;font_properties:&nbsp;a&nbsp;:class:`matplotlib.font_manager.FontProperties`&nbsp;instance&nbsp;<br>
  162 +&nbsp;&nbsp;gid:&nbsp;an&nbsp;id&nbsp;string&nbsp;<br>
  163 +&nbsp;&nbsp;horizontalalignment&nbsp;or&nbsp;ha:&nbsp;[&nbsp;'center'&nbsp;|&nbsp;'right'&nbsp;|&nbsp;'left'&nbsp;]&nbsp;<br>
  164 +&nbsp;&nbsp;label:&nbsp;string&nbsp;or&nbsp;anything&nbsp;printable&nbsp;with&nbsp;'%s'&nbsp;conversion.&nbsp;<br>
  165 +&nbsp;&nbsp;linespacing:&nbsp;float&nbsp;(multiple&nbsp;of&nbsp;font&nbsp;size)&nbsp;<br>
  166 +&nbsp;&nbsp;multialignment:&nbsp;['left'&nbsp;|&nbsp;'right'&nbsp;|&nbsp;'center'&nbsp;]&nbsp;<br>
  167 +&nbsp;&nbsp;path_effects:&nbsp;unknown<br>
  168 +&nbsp;&nbsp;picker:&nbsp;[None|float|boolean|callable]&nbsp;<br>
  169 +&nbsp;&nbsp;position:&nbsp;(x,y)&nbsp;<br>
  170 +&nbsp;&nbsp;rasterized:&nbsp;[True&nbsp;|&nbsp;False&nbsp;|&nbsp;None]&nbsp;<br>
  171 +&nbsp;&nbsp;rotation:&nbsp;[&nbsp;angle&nbsp;in&nbsp;degrees&nbsp;|&nbsp;'vertical'&nbsp;|&nbsp;'horizontal'&nbsp;]&nbsp;<br>
  172 +&nbsp;&nbsp;rotation_mode:&nbsp;unknown<br>
  173 +&nbsp;&nbsp;size&nbsp;or&nbsp;fontsize:&nbsp;[size&nbsp;in&nbsp;points&nbsp;|&nbsp;'xx-small'&nbsp;|&nbsp;'x-small'&nbsp;|&nbsp;'small'&nbsp;|&nbsp;'medium'&nbsp;|&nbsp;'large'&nbsp;|&nbsp;'x-large'&nbsp;|&nbsp;'xx-large'&nbsp;]&nbsp;<br>
  174 +&nbsp;&nbsp;sketch_params:&nbsp;unknown<br>
  175 +&nbsp;&nbsp;snap:&nbsp;unknown<br>
  176 +&nbsp;&nbsp;stretch&nbsp;or&nbsp;fontstretch:&nbsp;[a&nbsp;numeric&nbsp;value&nbsp;in&nbsp;range&nbsp;0-1000&nbsp;|&nbsp;'ultra-condensed'&nbsp;|&nbsp;'extra-condensed'&nbsp;|&nbsp;'condensed'&nbsp;|&nbsp;'semi-condensed'&nbsp;|&nbsp;'normal'&nbsp;|&nbsp;'semi-expanded'&nbsp;|&nbsp;'expanded'&nbsp;|&nbsp;'extra-expanded'&nbsp;|&nbsp;'ultra-expanded'&nbsp;]&nbsp;<br>
  177 +&nbsp;&nbsp;style&nbsp;or&nbsp;fontstyle:&nbsp;[&nbsp;'normal'&nbsp;|&nbsp;'italic'&nbsp;|&nbsp;'oblique']&nbsp;<br>
  178 +&nbsp;&nbsp;text:&nbsp;string&nbsp;or&nbsp;anything&nbsp;printable&nbsp;with&nbsp;'%s'&nbsp;conversion.&nbsp;<br>
  179 +&nbsp;&nbsp;transform:&nbsp;:class:`~matplotlib.transforms.Transform`&nbsp;instance&nbsp;<br>
  180 +&nbsp;&nbsp;url:&nbsp;a&nbsp;url&nbsp;string&nbsp;<br>
  181 +&nbsp;&nbsp;usetex:&nbsp;unknown<br>
  182 +&nbsp;&nbsp;variant&nbsp;or&nbsp;fontvariant:&nbsp;[&nbsp;'normal'&nbsp;|&nbsp;'small-caps'&nbsp;]&nbsp;<br>
  183 +&nbsp;&nbsp;verticalalignment&nbsp;or&nbsp;va&nbsp;or&nbsp;ma:&nbsp;[&nbsp;'center'&nbsp;|&nbsp;'top'&nbsp;|&nbsp;'bottom'&nbsp;|&nbsp;'baseline'&nbsp;]&nbsp;<br>
  184 +&nbsp;&nbsp;visible:&nbsp;[True&nbsp;|&nbsp;False]&nbsp;<br>
  185 +&nbsp;&nbsp;weight&nbsp;or&nbsp;fontweight:&nbsp;[a&nbsp;numeric&nbsp;value&nbsp;in&nbsp;range&nbsp;0-1000&nbsp;|&nbsp;'ultralight'&nbsp;|&nbsp;'light'&nbsp;|&nbsp;'normal'&nbsp;|&nbsp;'regular'&nbsp;|&nbsp;'book'&nbsp;|&nbsp;'medium'&nbsp;|&nbsp;'roman'&nbsp;|&nbsp;'semibold'&nbsp;|&nbsp;'demibold'&nbsp;|&nbsp;'demi'&nbsp;|&nbsp;'bold'&nbsp;|&nbsp;'heavy'&nbsp;|&nbsp;'extra&nbsp;bold'&nbsp;|&nbsp;'black'&nbsp;]&nbsp;<br>
  186 +&nbsp;&nbsp;wrap:&nbsp;unknown<br>
  187 +&nbsp;&nbsp;x:&nbsp;float&nbsp;<br>
  188 +&nbsp;&nbsp;y:&nbsp;float&nbsp;<br>
  189 +&nbsp;&nbsp;zorder:&nbsp;any&nbsp;number&nbsp;<br>
  190 +&nbsp;<br>
  191 +Examples<br>
  192 +--------<br>
  193 +&nbsp;<br>
  194 +..&nbsp;plot::&nbsp;mpl_examples/pylab_examples/annotation_demo2.py</tt></dd></dl>
  195 +
  196 +</div></div>
chunks/doc-plt-bar.md View file @ 9186cc5
  1 +## Tracer un diagramme en barres avec `plt.bar` {autodoc}
  2 +<div class='scrollatbottom'>
  3 +<ul>
  4 +<li>Paramètre 1 : liste/tableau des positions horizontales (gauche de chaque barre)</li>
  5 +<li>Paramètre 2 : liste/tableau des hauteurs (valeur verticale)</li>
  6 +<li>Paramètre nommé <code>width</code> : largeur de l'ensemble des barres</li>
  7 +</ul>
  8 +
  9 +<div class='scroll'>
  10 +Python Library Documentation: function bar in matplotlib.pyplot
  11 +
  12 +<dl><dt><a name="-matplotlib.pyplot.bar"><strong>matplotlib.pyplot.bar</strong></a> = bar(left, height, width=0.8, bottom=None, hold=None, data=None, **kwargs)</dt><dd><tt>Make&nbsp;a&nbsp;bar&nbsp;plot.<br>
  13 +&nbsp;<br>
  14 +Make&nbsp;a&nbsp;bar&nbsp;plot&nbsp;with&nbsp;rectangles&nbsp;bounded&nbsp;by:<br>
  15 +&nbsp;<br>
  16 +&nbsp;&nbsp;`left`,&nbsp;`left`&nbsp;+&nbsp;`width`,&nbsp;`bottom`,&nbsp;`bottom`&nbsp;+&nbsp;`height`<br>
  17 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(left,&nbsp;right,&nbsp;bottom&nbsp;and&nbsp;top&nbsp;edges)<br>
  18 +&nbsp;<br>
  19 +Parameters<br>
  20 +----------<br>
  21 +left&nbsp;:&nbsp;sequence&nbsp;of&nbsp;scalars<br>
  22 +&nbsp;&nbsp;&nbsp;&nbsp;the&nbsp;x&nbsp;coordinates&nbsp;of&nbsp;the&nbsp;left&nbsp;sides&nbsp;of&nbsp;the&nbsp;bars<br>
  23 +&nbsp;<br>
  24 +height&nbsp;:&nbsp;sequence&nbsp;of&nbsp;scalars<br>
  25 +&nbsp;&nbsp;&nbsp;&nbsp;the&nbsp;heights&nbsp;of&nbsp;the&nbsp;bars<br>
  26 +&nbsp;<br>
  27 +width&nbsp;:&nbsp;scalar&nbsp;or&nbsp;array-like,&nbsp;optional<br>
  28 +&nbsp;&nbsp;&nbsp;&nbsp;the&nbsp;width(s)&nbsp;of&nbsp;the&nbsp;bars<br>
  29 +&nbsp;&nbsp;&nbsp;&nbsp;default:&nbsp;0.8<br>
  30 +&nbsp;<br>
  31 +bottom&nbsp;:&nbsp;scalar&nbsp;or&nbsp;array-like,&nbsp;optional<br>
  32 +&nbsp;&nbsp;&nbsp;&nbsp;the&nbsp;y&nbsp;coordinate(s)&nbsp;of&nbsp;the&nbsp;bars<br>
  33 +&nbsp;&nbsp;&nbsp;&nbsp;default:&nbsp;None<br>
  34 +&nbsp;<br>
  35 +color&nbsp;:&nbsp;scalar&nbsp;or&nbsp;array-like,&nbsp;optional<br>
  36 +&nbsp;&nbsp;&nbsp;&nbsp;the&nbsp;colors&nbsp;of&nbsp;the&nbsp;bar&nbsp;faces<br>
  37 +&nbsp;<br>
  38 +edgecolor&nbsp;:&nbsp;scalar&nbsp;or&nbsp;array-like,&nbsp;optional<br>
  39 +&nbsp;&nbsp;&nbsp;&nbsp;the&nbsp;colors&nbsp;of&nbsp;the&nbsp;bar&nbsp;edges<br>
  40 +&nbsp;<br>
  41 +linewidth&nbsp;:&nbsp;scalar&nbsp;or&nbsp;array-like,&nbsp;optional<br>
  42 +&nbsp;&nbsp;&nbsp;&nbsp;width&nbsp;of&nbsp;bar&nbsp;edge(s).&nbsp;If&nbsp;None,&nbsp;use&nbsp;default<br>
  43 +&nbsp;&nbsp;&nbsp;&nbsp;linewidth;&nbsp;If&nbsp;0,&nbsp;don't&nbsp;draw&nbsp;edges.<br>
  44 +&nbsp;&nbsp;&nbsp;&nbsp;default:&nbsp;None<br>
  45 +&nbsp;<br>
  46 +tick_label&nbsp;:&nbsp;string&nbsp;or&nbsp;array-like,&nbsp;optional<br>
  47 +&nbsp;&nbsp;&nbsp;&nbsp;the&nbsp;tick&nbsp;labels&nbsp;of&nbsp;the&nbsp;bars<br>
  48 +&nbsp;&nbsp;&nbsp;&nbsp;default:&nbsp;None<br>
  49 +&nbsp;<br>
  50 +xerr&nbsp;:&nbsp;scalar&nbsp;or&nbsp;array-like,&nbsp;optional<br>
  51 +&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;not&nbsp;None,&nbsp;will&nbsp;be&nbsp;used&nbsp;to&nbsp;generate&nbsp;errorbar(s)&nbsp;on&nbsp;the&nbsp;bar&nbsp;chart<br>
  52 +&nbsp;&nbsp;&nbsp;&nbsp;default:&nbsp;None<br>
  53 +&nbsp;<br>
  54 +yerr&nbsp;:&nbsp;scalar&nbsp;or&nbsp;array-like,&nbsp;optional<br>
  55 +&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;not&nbsp;None,&nbsp;will&nbsp;be&nbsp;used&nbsp;to&nbsp;generate&nbsp;errorbar(s)&nbsp;on&nbsp;the&nbsp;bar&nbsp;chart<br>
  56 +&nbsp;&nbsp;&nbsp;&nbsp;default:&nbsp;None<br>
  57 +&nbsp;<br>
  58 +ecolor&nbsp;:&nbsp;scalar&nbsp;or&nbsp;array-like,&nbsp;optional<br>
  59 +&nbsp;&nbsp;&nbsp;&nbsp;specifies&nbsp;the&nbsp;color&nbsp;of&nbsp;errorbar(s)<br>
  60 +&nbsp;&nbsp;&nbsp;&nbsp;default:&nbsp;None<br>
  61 +&nbsp;<br>
  62 +capsize&nbsp;:&nbsp;scalar,&nbsp;optional<br>
  63 +&nbsp;&nbsp;&nbsp;determines&nbsp;the&nbsp;length&nbsp;in&nbsp;points&nbsp;of&nbsp;the&nbsp;error&nbsp;bar&nbsp;caps<br>
  64 +&nbsp;&nbsp;&nbsp;default:&nbsp;None,&nbsp;which&nbsp;will&nbsp;take&nbsp;the&nbsp;value&nbsp;from&nbsp;the<br>
  65 +&nbsp;&nbsp;&nbsp;``errorbar.capsize``&nbsp;:data:`rcParam&lt;matplotlib.rcParams&gt;`.<br>
  66 +&nbsp;<br>
  67 +error_kw&nbsp;:&nbsp;dict,&nbsp;optional<br>
  68 +&nbsp;&nbsp;&nbsp;&nbsp;dictionary&nbsp;of&nbsp;kwargs&nbsp;to&nbsp;be&nbsp;passed&nbsp;to&nbsp;errorbar&nbsp;method.&nbsp;*ecolor*&nbsp;and<br>
  69 +&nbsp;&nbsp;&nbsp;&nbsp;*capsize*&nbsp;may&nbsp;be&nbsp;specified&nbsp;here&nbsp;rather&nbsp;than&nbsp;as&nbsp;independent&nbsp;kwargs.<br>
  70 +&nbsp;<br>
  71 +align&nbsp;:&nbsp;{'edge',&nbsp;&nbsp;'center'},&nbsp;optional<br>
  72 +&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;'edge',&nbsp;aligns&nbsp;bars&nbsp;by&nbsp;their&nbsp;left&nbsp;edges&nbsp;(for&nbsp;vertical&nbsp;bars)&nbsp;and<br>
  73 +&nbsp;&nbsp;&nbsp;&nbsp;by&nbsp;their&nbsp;bottom&nbsp;edges&nbsp;(for&nbsp;horizontal&nbsp;bars).&nbsp;If&nbsp;'center',&nbsp;interpret<br>
  74 +&nbsp;&nbsp;&nbsp;&nbsp;the&nbsp;`left`&nbsp;argument&nbsp;as&nbsp;the&nbsp;coordinates&nbsp;of&nbsp;the&nbsp;centers&nbsp;of&nbsp;the&nbsp;bars.<br>
  75 +&nbsp;&nbsp;&nbsp;&nbsp;To&nbsp;align&nbsp;on&nbsp;the&nbsp;align&nbsp;bars&nbsp;on&nbsp;the&nbsp;right&nbsp;edge&nbsp;pass&nbsp;a&nbsp;negative<br>
  76 +&nbsp;&nbsp;&nbsp;&nbsp;`width`.<br>
  77 +&nbsp;<br>
  78 +orientation&nbsp;:&nbsp;{'vertical',&nbsp;&nbsp;'horizontal'},&nbsp;optional<br>
  79 +&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;orientation&nbsp;of&nbsp;the&nbsp;bars.<br>
  80 +&nbsp;<br>
  81 +log&nbsp;:&nbsp;boolean,&nbsp;optional<br>
  82 +&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;true,&nbsp;sets&nbsp;the&nbsp;axis&nbsp;to&nbsp;be&nbsp;log&nbsp;scale.<br>
  83 +&nbsp;&nbsp;&nbsp;&nbsp;default:&nbsp;False<br>
  84 +&nbsp;<br>
  85 +Returns<br>
  86 +-------<br>
  87 +bars&nbsp;:&nbsp;matplotlib.container.BarContainer<br>
  88 +&nbsp;&nbsp;&nbsp;&nbsp;Container&nbsp;with&nbsp;all&nbsp;of&nbsp;the&nbsp;bars&nbsp;+&nbsp;errorbars<br>
  89 +&nbsp;<br>
  90 +Notes<br>
  91 +-----<br>
  92 +The&nbsp;optional&nbsp;arguments&nbsp;`color`,&nbsp;`edgecolor`,&nbsp;`linewidth`,<br>
  93 +`xerr`,&nbsp;and&nbsp;`yerr`&nbsp;can&nbsp;be&nbsp;either&nbsp;scalars&nbsp;or&nbsp;sequences&nbsp;of<br>
  94 +length&nbsp;equal&nbsp;to&nbsp;the&nbsp;number&nbsp;of&nbsp;bars.&nbsp;&nbsp;This&nbsp;enables&nbsp;you&nbsp;to&nbsp;use<br>
  95 +bar&nbsp;as&nbsp;the&nbsp;basis&nbsp;for&nbsp;stacked&nbsp;bar&nbsp;charts,&nbsp;or&nbsp;candlestick&nbsp;plots.<br>
  96 +Detail:&nbsp;`xerr`&nbsp;and&nbsp;`yerr`&nbsp;are&nbsp;passed&nbsp;directly&nbsp;to<br>
  97 +:meth:`errorbar`,&nbsp;so&nbsp;they&nbsp;can&nbsp;also&nbsp;have&nbsp;shape&nbsp;2xN&nbsp;for<br>
  98 +independent&nbsp;specification&nbsp;of&nbsp;lower&nbsp;and&nbsp;upper&nbsp;errors.<br>
  99 +&nbsp;<br>
  100 +Other&nbsp;optional&nbsp;kwargs:<br>
  101 +&nbsp;<br>
  102 +&nbsp;&nbsp;agg_filter:&nbsp;unknown<br>
  103 +&nbsp;&nbsp;alpha:&nbsp;float&nbsp;or&nbsp;None&nbsp;<br>
  104 +&nbsp;&nbsp;animated:&nbsp;[True&nbsp;|&nbsp;False]&nbsp;<br>
  105 +&nbsp;&nbsp;antialiased&nbsp;or&nbsp;aa:&nbsp;[True&nbsp;|&nbsp;False]&nbsp;&nbsp;or&nbsp;None&nbsp;for&nbsp;default&nbsp;<br>
  106 +&nbsp;&nbsp;axes:&nbsp;an&nbsp;:class:`~matplotlib.axes.Axes`&nbsp;instance&nbsp;<br>
  107 +&nbsp;&nbsp;capstyle:&nbsp;['butt'&nbsp;|&nbsp;'round'&nbsp;|&nbsp;'projecting']&nbsp;<br>
  108 +&nbsp;&nbsp;clip_box:&nbsp;a&nbsp;:class:`matplotlib.transforms.Bbox`&nbsp;instance&nbsp;<br>
  109 +&nbsp;&nbsp;clip_on:&nbsp;[True&nbsp;|&nbsp;False]&nbsp;<br>
  110 +&nbsp;&nbsp;clip_path:&nbsp;[&nbsp;(:class:`~matplotlib.path.Path`,&nbsp;:class:`~matplotlib.transforms.Transform`)&nbsp;|&nbsp;:class:`~matplotlib.patches.Patch`&nbsp;|&nbsp;None&nbsp;]&nbsp;<br>
  111 +&nbsp;&nbsp;color:&nbsp;matplotlib&nbsp;color&nbsp;spec<br>
  112 +&nbsp;&nbsp;contains:&nbsp;a&nbsp;callable&nbsp;function&nbsp;<br>
  113 +&nbsp;&nbsp;edgecolor&nbsp;or&nbsp;ec:&nbsp;mpl&nbsp;color&nbsp;spec,&nbsp;or&nbsp;None&nbsp;for&nbsp;default,&nbsp;or&nbsp;'none'&nbsp;for&nbsp;no&nbsp;color&nbsp;<br>
  114 +&nbsp;&nbsp;facecolor&nbsp;or&nbsp;fc:&nbsp;mpl&nbsp;color&nbsp;spec,&nbsp;or&nbsp;None&nbsp;for&nbsp;default,&nbsp;or&nbsp;'none'&nbsp;for&nbsp;no&nbsp;color&nbsp;<br>
  115 +&nbsp;&nbsp;figure:&nbsp;a&nbsp;:class:`matplotlib.figure.Figure`&nbsp;instance&nbsp;<br>
  116 +&nbsp;&nbsp;fill:&nbsp;[True&nbsp;|&nbsp;False]&nbsp;<br>
  117 +&nbsp;&nbsp;gid:&nbsp;an&nbsp;id&nbsp;string&nbsp;<br>
  118 +&nbsp;&nbsp;hatch:&nbsp;['/'&nbsp;|&nbsp;'\\'&nbsp;|&nbsp;'|'&nbsp;|&nbsp;'-'&nbsp;|&nbsp;'+'&nbsp;|&nbsp;'x'&nbsp;|&nbsp;'o'&nbsp;|&nbsp;'O'&nbsp;|&nbsp;'.'&nbsp;|&nbsp;'*']&nbsp;<br>
  119 +&nbsp;&nbsp;joinstyle:&nbsp;['miter'&nbsp;|&nbsp;'round'&nbsp;|&nbsp;'bevel']&nbsp;<br>
  120 +&nbsp;&nbsp;label:&nbsp;string&nbsp;or&nbsp;anything&nbsp;printable&nbsp;with&nbsp;'%s'&nbsp;conversion.&nbsp;<br>
  121 +&nbsp;&nbsp;linestyle&nbsp;or&nbsp;ls:&nbsp;['solid'&nbsp;|&nbsp;'dashed',&nbsp;'dashdot',&nbsp;'dotted'&nbsp;|&nbsp;(offset,&nbsp;on-off-dash-seq)&nbsp;|&nbsp;``'-'``&nbsp;|&nbsp;``'--'``&nbsp;|&nbsp;``'-.'``&nbsp;|&nbsp;``':'``&nbsp;|&nbsp;``'None'``&nbsp;|&nbsp;``'&nbsp;'``&nbsp;|&nbsp;``''``]<br>
  122 +&nbsp;&nbsp;linewidth&nbsp;or&nbsp;lw:&nbsp;float&nbsp;or&nbsp;None&nbsp;for&nbsp;default&nbsp;<br>
  123 +&nbsp;&nbsp;path_effects:&nbsp;unknown<br>
  124 +&nbsp;&nbsp;picker:&nbsp;[None|float|boolean|callable]&nbsp;<br>
  125 +&nbsp;&nbsp;rasterized:&nbsp;[True&nbsp;|&nbsp;False&nbsp;|&nbsp;None]&nbsp;<br>
  126 +&nbsp;&nbsp;sketch_params:&nbsp;unknown<br>
  127 +&nbsp;&nbsp;snap:&nbsp;unknown<br>
  128 +&nbsp;&nbsp;transform:&nbsp;:class:`~matplotlib.transforms.Transform`&nbsp;instance&nbsp;<br>
  129 +&nbsp;&nbsp;url:&nbsp;a&nbsp;url&nbsp;string&nbsp;<br>
  130 +&nbsp;&nbsp;visible:&nbsp;[True&nbsp;|&nbsp;False]&nbsp;<br>
  131 +&nbsp;&nbsp;zorder:&nbsp;any&nbsp;number&nbsp;<br>
  132 +&nbsp;<br>
  133 +See&nbsp;also<br>
  134 +--------<br>
  135 +barh:&nbsp;Plot&nbsp;a&nbsp;horizontal&nbsp;bar&nbsp;plot.<br>
  136 +&nbsp;<br>
  137 +Examples<br>
  138 +--------<br>
  139 +&nbsp;<br>
  140 +**Example:**&nbsp;A&nbsp;stacked&nbsp;bar&nbsp;chart.<br>
  141 +&nbsp;<br>
  142 +..&nbsp;plot::&nbsp;mpl_examples/pylab_examples/bar_stacked.py<br>
  143 +&nbsp;<br>
  144 +Notes<br>
  145 +-----<br>
  146 +&nbsp;<br>
  147 +In&nbsp;addition&nbsp;to&nbsp;the&nbsp;above&nbsp;described&nbsp;arguments,&nbsp;this&nbsp;function&nbsp;can&nbsp;take&nbsp;a<br>
  148 +**data**&nbsp;keyword&nbsp;argument.&nbsp;If&nbsp;such&nbsp;a&nbsp;**data**&nbsp;argument&nbsp;is&nbsp;given,&nbsp;the<br>
  149 +following&nbsp;arguments&nbsp;are&nbsp;replaced&nbsp;by&nbsp;**data[&lt;arg&gt;]**:<br>
  150 +&nbsp;<br>
  151 +*&nbsp;All&nbsp;arguments&nbsp;with&nbsp;the&nbsp;following&nbsp;names:&nbsp;'bottom',&nbsp;'ecolor',&nbsp;'width',&nbsp;'height',&nbsp;'linewidth',&nbsp;'color',&nbsp;'tick_label',&nbsp;'yerr',&nbsp;'left',&nbsp;'edgecolor',&nbsp;'xerr'.<br>
  152 +&nbsp;<br>
  153 +&nbsp;<br>
  154 +&nbsp;<br>
  155 +&nbsp;<br>
  156 +Additional&nbsp;kwargs:&nbsp;hold&nbsp;=&nbsp;[True|False]&nbsp;overrides&nbsp;default&nbsp;hold&nbsp;state</tt></dd></dl>
  157 +
  158 +</div></div>
chunks/doc-plt-barh.md View file @ 9186cc5
  1 +## … barres horizontales avec `plt.barh` {autodoc}
  2 +<div class='scrollatbottom'>
  3 +<ul>
  4 +<li>Paramètre 1 : liste/tableau des positions verticale (bas de chaque barre)</li>
  5 +<li>Paramètre 2 : liste/tableau des largeur (valeur horizontale)</li>
  6 +<li>Paramètre nommé <code>height</code> : hauteur de l'ensemble des barres</li>
  7 +</ul>
  8 +
  9 +<div class='scroll'>
  10 +Python Library Documentation: function barh in matplotlib.pyplot
  11 +
  12 +<dl><dt><a name="-matplotlib.pyplot.barh"><strong>matplotlib.pyplot.barh</strong></a> = barh(bottom, width, height=0.8, left=None, hold=None, **kwargs)</dt><dd><tt>Make&nbsp;a&nbsp;horizontal&nbsp;bar&nbsp;plot.<br>
  13 +&nbsp;<br>
  14 +Make&nbsp;a&nbsp;horizontal&nbsp;bar&nbsp;plot&nbsp;with&nbsp;rectangles&nbsp;bounded&nbsp;by:<br>
  15 +&nbsp;<br>
  16 +&nbsp;&nbsp;`left`,&nbsp;`left`&nbsp;+&nbsp;`width`,&nbsp;`bottom`,&nbsp;`bottom`&nbsp;+&nbsp;`height`<br>
  17 +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(left,&nbsp;right,&nbsp;bottom&nbsp;and&nbsp;top&nbsp;edges)<br>
  18 +&nbsp;<br>
  19 +`bottom`,&nbsp;`width`,&nbsp;`height`,&nbsp;and&nbsp;`left`&nbsp;can&nbsp;be&nbsp;either&nbsp;scalars<br>
  20 +or&nbsp;sequences<br>
  21 +&nbsp;<br>
  22 +Parameters<br>
  23 +----------<br>
  24 +bottom&nbsp;:&nbsp;scalar&nbsp;or&nbsp;array-like<br>
  25 +&nbsp;&nbsp;&nbsp;&nbsp;the&nbsp;y&nbsp;coordinate(s)&nbsp;of&nbsp;the&nbsp;bars<br>
  26 +&nbsp;<br>
  27 +width&nbsp;:&nbsp;scalar&nbsp;or&nbsp;array-like<br>
  28 +&nbsp;&nbsp;&nbsp;&nbsp;the&nbsp;width(s)&nbsp;of&nbsp;the&nbsp;bars<br>
  29 +&nbsp;<br>
  30 +height&nbsp;:&nbsp;sequence&nbsp;of&nbsp;scalars,&nbsp;optional,&nbsp;default:&nbsp;0.8<br>
  31 +&nbsp;&nbsp;&nbsp;&nbsp;the&nbsp;heights&nbsp;of&nbsp;the&nbsp;bars<br>
  32 +&nbsp;<br>
  33 +left&nbsp;:&nbsp;sequence&nbsp;of&nbsp;scalars<br>
  34 +&nbsp;&nbsp;&nbsp;&nbsp;the&nbsp;x&nbsp;coordinates&nbsp;of&nbsp;the&nbsp;left&nbsp;sides&nbsp;of&nbsp;the&nbsp;bars<br>
  35 +&nbsp;<br>
  36 +Returns<br>
  37 +--------<br>
  38 +`matplotlib.patches.Rectangle`&nbsp;instances.<br>
  39 +&nbsp;<br>
  40 +Other&nbsp;parameters<br>
  41 +----------------<br>
  42 +color&nbsp;:&nbsp;scalar&nbsp;or&nbsp;array-like,&nbsp;optional<br>
  43 +&nbsp;&nbsp;&nbsp;&nbsp;the&nbsp;colors&nbsp;of&nbsp;the&nbsp;bars<br>
  44 +&nbsp;<br>
  45 +edgecolor&nbsp;:&nbsp;scalar&nbsp;or&nbsp;array-like,&nbsp;optional<br>
  46 +&nbsp;&nbsp;&nbsp;&nbsp;the&nbsp;colors&nbsp;of&nbsp;the&nbsp;bar&nbsp;edges<br>
  47 +&nbsp;<br>
  48 +linewidth&nbsp;:&nbsp;scalar&nbsp;or&nbsp;array-like,&nbsp;optional,&nbsp;default:&nbsp;None<br>
  49 +&nbsp;&nbsp;&nbsp;&nbsp;width&nbsp;of&nbsp;bar&nbsp;edge(s).&nbsp;If&nbsp;None,&nbsp;use&nbsp;default<br>
  50 +&nbsp;&nbsp;&nbsp;&nbsp;linewidth;&nbsp;If&nbsp;0,&nbsp;don't&nbsp;draw&nbsp;edges.<br>
  51 +&nbsp;<br>
  52 +tick_label&nbsp;:&nbsp;string&nbsp;or&nbsp;array-like,&nbsp;optional,&nbsp;default:&nbsp;None<br>
  53 +&nbsp;&nbsp;&nbsp;&nbsp;the&nbsp;tick&nbsp;labels&nbsp;of&nbsp;the&nbsp;bars<br>
  54 +&nbsp;<br>
  55 +xerr&nbsp;:&nbsp;scalar&nbsp;or&nbsp;array-like,&nbsp;optional,&nbsp;default:&nbsp;None<br>
  56 +&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;not&nbsp;None,&nbsp;will&nbsp;be&nbsp;used&nbsp;to&nbsp;generate&nbsp;errorbar(s)&nbsp;on&nbsp;the&nbsp;bar&nbsp;chart<br>
  57 +&nbsp;<br>
  58 +yerr&nbsp;:&nbsp;scalar&nbsp;or&nbsp;array-like,&nbsp;optional,&nbsp;default:&nbsp;None<br>
  59 +&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;not&nbsp;None,&nbsp;will&nbsp;be&nbsp;used&nbsp;to&nbsp;generate&nbsp;errorbar(s)&nbsp;on&nbsp;the&nbsp;bar&nbsp;chart<br>
  60 +&nbsp;<br>
  61 +ecolor&nbsp;:&nbsp;scalar&nbsp;or&nbsp;array-like,&nbsp;optional,&nbsp;default:&nbsp;None<br>
  62 +&nbsp;&nbsp;&nbsp;&nbsp;specifies&nbsp;the&nbsp;color&nbsp;of&nbsp;errorbar(s)<br>
  63 +&nbsp;<br>
  64 +capsize&nbsp;:&nbsp;scalar,&nbsp;optional<br>
  65 +&nbsp;&nbsp;&nbsp;determines&nbsp;the&nbsp;length&nbsp;in&nbsp;points&nbsp;of&nbsp;the&nbsp;error&nbsp;bar&nbsp;caps<br>
  66 +&nbsp;&nbsp;&nbsp;default:&nbsp;None,&nbsp;which&nbsp;will&nbsp;take&nbsp;the&nbsp;value&nbsp;from&nbsp;the<br>
  67 +&nbsp;&nbsp;&nbsp;``errorbar.capsize``&nbsp;:data:`rcParam&lt;matplotlib.rcParams&gt;`.<br>
  68 +&nbsp;<br>
  69 +error_kw&nbsp;:<br>
  70 +&nbsp;&nbsp;&nbsp;&nbsp;dictionary&nbsp;of&nbsp;kwargs&nbsp;to&nbsp;be&nbsp;passed&nbsp;to&nbsp;errorbar&nbsp;method.&nbsp;`ecolor`&nbsp;and<br>
  71 +&nbsp;&nbsp;&nbsp;&nbsp;`capsize`&nbsp;may&nbsp;be&nbsp;specified&nbsp;here&nbsp;rather&nbsp;than&nbsp;as&nbsp;independent&nbsp;kwargs.<br>
  72 +&nbsp;<br>
  73 +align&nbsp;:&nbsp;['edge'&nbsp;|&nbsp;'center'],&nbsp;optional,&nbsp;default:&nbsp;'edge'<br>
  74 +&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;`edge`,&nbsp;aligns&nbsp;bars&nbsp;by&nbsp;their&nbsp;left&nbsp;edges&nbsp;(for&nbsp;vertical&nbsp;bars)&nbsp;and<br>
  75 +&nbsp;&nbsp;&nbsp;&nbsp;by&nbsp;their&nbsp;bottom&nbsp;edges&nbsp;(for&nbsp;horizontal&nbsp;bars).&nbsp;If&nbsp;`center`,&nbsp;interpret<br>
  76 +&nbsp;&nbsp;&nbsp;&nbsp;the&nbsp;`left`&nbsp;argument&nbsp;as&nbsp;the&nbsp;coordinates&nbsp;of&nbsp;the&nbsp;centers&nbsp;of&nbsp;the&nbsp;bars.<br>
  77 +&nbsp;<br>
  78 +log&nbsp;:&nbsp;boolean,&nbsp;optional,&nbsp;default:&nbsp;False<br>
  79 +&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;true,&nbsp;sets&nbsp;the&nbsp;axis&nbsp;to&nbsp;be&nbsp;log&nbsp;scale<br>
  80 +&nbsp;<br>
  81 +Notes<br>
  82 +-----<br>
  83 +The&nbsp;optional&nbsp;arguments&nbsp;`color`,&nbsp;`edgecolor`,&nbsp;`linewidth`,<br>
  84 +`xerr`,&nbsp;and&nbsp;`yerr`&nbsp;can&nbsp;be&nbsp;either&nbsp;scalars&nbsp;or&nbsp;sequences&nbsp;of<br>
  85 +length&nbsp;equal&nbsp;to&nbsp;the&nbsp;number&nbsp;of&nbsp;bars.&nbsp;&nbsp;This&nbsp;enables&nbsp;you&nbsp;to&nbsp;use<br>
  86 +bar&nbsp;as&nbsp;the&nbsp;basis&nbsp;for&nbsp;stacked&nbsp;bar&nbsp;charts,&nbsp;or&nbsp;candlestick&nbsp;plots.<br>
  87 +Detail:&nbsp;`xerr`&nbsp;and&nbsp;`yerr`&nbsp;are&nbsp;passed&nbsp;directly&nbsp;to<br>
  88 +:meth:`errorbar`,&nbsp;so&nbsp;they&nbsp;can&nbsp;also&nbsp;have&nbsp;shape&nbsp;2xN&nbsp;for<br>
  89 +independent&nbsp;specification&nbsp;of&nbsp;lower&nbsp;and&nbsp;upper&nbsp;errors.<br>
  90 +&nbsp;<br>
  91 +Other&nbsp;optional&nbsp;kwargs:<br>
  92 +&nbsp;<br>
  93 +&nbsp;&nbsp;agg_filter:&nbsp;unknown<br>
  94 +&nbsp;&nbsp;alpha:&nbsp;float&nbsp;or&nbsp;None&nbsp;<br>
  95 +&nbsp;&nbsp;animated:&nbsp;[True&nbsp;|&nbsp;False]&nbsp;<br>
  96 +&nbsp;&nbsp;antialiased&nbsp;or&nbsp;aa:&nbsp;[True&nbsp;|&nbsp;False]&nbsp;&nbsp;or&nbsp;None&nbsp;for&nbsp;default&nbsp;<br>
  97 +&nbsp;&nbsp;axes:&nbsp;an&nbsp;:class:`~matplotlib.axes.Axes`&nbsp;instance&nbsp;<br>
  98 +&nbsp;&nbsp;capstyle:&nbsp;['butt'&nbsp;|&nbsp;'round'&nbsp;|&nbsp;'projecting']&nbsp;<br>
  99 +&nbsp;&nbsp;clip_box:&nbsp;a&nbsp;:class:`matplotlib.transforms.Bbox`&nbsp;instance&nbsp;<br>
  100 +&nbsp;&nbsp;clip_on:&nbsp;[True&nbsp;|&nbsp;False]&nbsp;<br>
  101 +&nbsp;&nbsp;clip_path:&nbsp;[&nbsp;(:class:`~matplotlib.path.Path`,&nbsp;:class:`~matplotlib.transforms.Transform`)&nbsp;|&nbsp;:class:`~matplotlib.patches.Patch`&nbsp;|&nbsp;None&nbsp;]&nbsp;<br>
  102 +&nbsp;&nbsp;color:&nbsp;matplotlib&nbsp;color&nbsp;spec<br>
  103 +&nbsp;&nbsp;contains:&nbsp;a&nbsp;callable&nbsp;function&nbsp;<br>
  104 +&nbsp;&nbsp;edgecolor&nbsp;or&nbsp;ec:&nbsp;mpl&nbsp;color&nbsp;spec,&nbsp;or&nbsp;None&nbsp;for&nbsp;default,&nbsp;or&nbsp;'none'&nbsp;for&nbsp;no&nbsp;color&nbsp;<br>
  105 +&nbsp;&nbsp;facecolor&nbsp;or&nbsp;fc:&nbsp;mpl&nbsp;color&nbsp;spec,&nbsp;or&nbsp;None&nbsp;for&nbsp;default,&nbsp;or&nbsp;'none'&nbsp;for&nbsp;no&nbsp;color&nbsp;<br>
  106 +&nbsp;&nbsp;figure:&nbsp;a&nbsp;:class:`matplotlib.figure.Figure`&nbsp;instance&nbsp;<br>
  107 +&nbsp;&nbsp;fill:&nbsp;[True&nbsp;|&nbsp;False]&nbsp;<br>
  108 +&nbsp;&nbsp;gid:&nbsp;an&nbsp;id&nbsp;string&nbsp;<br>
  109 +&nbsp;&nbsp;hatch:&nbsp;['/'&nbsp;|&nbsp;'\\'&nbsp;|&nbsp;'|'&nbsp;|&nbsp;'-'&nbsp;|&nbsp;'+'&nbsp;|&nbsp;'x'&nbsp;|&nbsp;'o'&nbsp;|&nbsp;'O'&nbsp;|&nbsp;'.'&nbsp;|&nbsp;'*']&nbsp;<br>
  110 +&nbsp;&nbsp;joinstyle:&nbsp;['miter'&nbsp;|&nbsp;'round'&nbsp;|&nbsp;'bevel']&nbsp;<br>
  111 +&nbsp;&nbsp;label:&nbsp;string&nbsp;or&nbsp;anything&nbsp;printable&nbsp;with&nbsp;'%s'&nbsp;conversion.&nbsp;<br>
  112 +&nbsp;&nbsp;linestyle&nbsp;or&nbsp;ls:&nbsp;['solid'&nbsp;|&nbsp;'dashed',&nbsp;'dashdot',&nbsp;'dotted'&nbsp;|&nbsp;(offset,&nbsp;on-off-dash-seq)&nbsp;|&nbsp;``'-'``&nbsp;|&nbsp;``'--'``&nbsp;|&nbsp;``'-.'``&nbsp;|&nbsp;``':'``&nbsp;|&nbsp;``'None'``&nbsp;|&nbsp;``'&nbsp;'``&nbsp;|&nbsp;``''``]<br>
  113 +&nbsp;&nbsp;linewidth&nbsp;or&nbsp;lw:&nbsp;float&nbsp;or&nbsp;None&nbsp;for&nbsp;default&nbsp;<br>
  114 +&nbsp;&nbsp;path_effects:&nbsp;unknown<br>
  115 +&nbsp;&nbsp;picker:&nbsp;[None|float|boolean|callable]&nbsp;<br>
  116 +&nbsp;&nbsp;rasterized:&nbsp;[True&nbsp;|&nbsp;False&nbsp;|&nbsp;None]&nbsp;<br>
  117 +&nbsp;&nbsp;sketch_params:&nbsp;unknown<br>
  118 +&nbsp;&nbsp;snap:&nbsp;unknown<br>
  119 +&nbsp;&nbsp;transform:&nbsp;:class:`~matplotlib.transforms.Transform`&nbsp;instance&nbsp;<br>
  120 +&nbsp;&nbsp;url:&nbsp;a&nbsp;url&nbsp;string&nbsp;<br>
  121 +&nbsp;&nbsp;visible:&nbsp;[True&nbsp;|&nbsp;False]&nbsp;<br>
  122 +&nbsp;&nbsp;zorder:&nbsp;any&nbsp;number&nbsp;<br>
  123 +&nbsp;<br>
  124 +See&nbsp;also<br>
  125 +--------<br>
  126 +bar:&nbsp;Plot&nbsp;a&nbsp;vertical&nbsp;bar&nbsp;plot.<br>
  127 +&nbsp;<br>
  128 +&nbsp;<br>
  129 +&nbsp;<br>
  130 +Additional&nbsp;kwargs:&nbsp;hold&nbsp;=&nbsp;[True|False]&nbsp;overrides&nbsp;default&nbsp;hold&nbsp;state</tt></dd></dl>
  131 +
  132 +</div></div>
chunks/doc-plt-contour.md View file @ 9186cc5
  1 +## Tr. des lignes de niveau avec `plt.contour` {autodoc}
  2 +<div class='scrollatbottom'>
  3 +<ul>
  4 +<li>Plusieurs combinaisons de paramètres possibles
  5 +<ul>
  6 +<li>soit un tableau 2D de valeurs "z"</li>
  7 +<li>soit 3 tableaux 1D/1D/2D (ou 2D/2D/2D) de valeurs "x", "y", "z" (pour donner les positions sur les axes x et y)</li>
  8 +<li>dans les deux cas, optionellement en plus, une liste des valeurs des lignes de niveaux</li>
  9 +</ul>
  10 +</li>
  11 +<li>Paramètres nommés intéressants : <code>extent</code> (bornes x et y), <code>cmap</code> (couleurs), <code>alpha</code> (opacité), <code>norm</code> (normalisation des "z")</li>
  12 +</ul>
  13 +
  14 +
  15 +<div class='scroll'>
  16 +Python Library Documentation: function contour in matplotlib.pyplot
  17 +
  18 +<dl><dt><a name="-matplotlib.pyplot.contour"><strong>matplotlib.pyplot.contour</strong></a> = contour(*args, **kwargs)</dt><dd><tt>Plot&nbsp;contours.<br>
  19 +&nbsp;<br>
  20 +:func:`~matplotlib.pyplot.contour`&nbsp;and<br>
  21 +:func:`~matplotlib.pyplot.contourf`&nbsp;draw&nbsp;contour&nbsp;lines&nbsp;and<br>
  22 +filled&nbsp;contours,&nbsp;respectively.&nbsp;&nbsp;Except&nbsp;as&nbsp;noted,&nbsp;function<br>
  23 +signatures&nbsp;and&nbsp;return&nbsp;values&nbsp;are&nbsp;the&nbsp;same&nbsp;for&nbsp;both&nbsp;versions.<br>
  24 +&nbsp;<br>
  25 +:func:`~matplotlib.pyplot.contourf`&nbsp;differs&nbsp;from&nbsp;the&nbsp;MATLAB<br>
  26 +version&nbsp;in&nbsp;that&nbsp;it&nbsp;does&nbsp;not&nbsp;draw&nbsp;the&nbsp;polygon&nbsp;edges.<br>
  27 +To&nbsp;draw&nbsp;edges,&nbsp;add&nbsp;line&nbsp;contours&nbsp;with<br>
  28 +calls&nbsp;to&nbsp;:func:`~matplotlib.pyplot.contour`.<br>
  29 +&nbsp;<br>
  30 +&nbsp;<br>
  31 +Call&nbsp;signatures::<br>
  32 +&nbsp;<br>
  33 +&nbsp;&nbsp;contour(Z)<br>
  34 +&nbsp;<br>
  35 +make&nbsp;a&nbsp;contour&nbsp;plot&nbsp;of&nbsp;an&nbsp;array&nbsp;*Z*.&nbsp;The&nbsp;level&nbsp;values&nbsp;are&nbsp;chosen<br>
  36 +automatically.<br>
  37 +&nbsp;<br>
  38 +::<br>
  39 +&nbsp;<br>
  40 +&nbsp;&nbsp;contour(X,Y,Z)<br>
  41 +&nbsp;<br>
  42 +*X*,&nbsp;*Y*&nbsp;specify&nbsp;the&nbsp;(x,&nbsp;y)&nbsp;coordinates&nbsp;of&nbsp;the&nbsp;surface<br>
  43 +&nbsp;<br>
  44 +::<br>
  45 +&nbsp;<br>
  46 +&nbsp;&nbsp;contour(Z,N)<br>
  47 +&nbsp;&nbsp;contour(X,Y,Z,N)<br>
  48 +&nbsp;<br>
  49 +contour&nbsp;up&nbsp;to&nbsp;*N*&nbsp;automatically-chosen&nbsp;levels.<br>
  50 +&nbsp;<br>
  51 +::<br>
  52 +&nbsp;<br>
  53 +&nbsp;&nbsp;contour(Z,V)<br>
  54 +&nbsp;&nbsp;contour(X,Y,Z,V)<br>
  55 +&nbsp;<br>
  56 +draw&nbsp;contour&nbsp;lines&nbsp;at&nbsp;the&nbsp;values&nbsp;specified&nbsp;in&nbsp;sequence&nbsp;*V*,<br>
  57 +which&nbsp;must&nbsp;be&nbsp;in&nbsp;increasing&nbsp;order.<br>
  58 +&nbsp;<br>
  59 +::<br>
  60 +&nbsp;<br>
  61 +&nbsp;&nbsp;contourf(...,&nbsp;V)<br>
  62 +&nbsp;<br>
  63 +fill&nbsp;the&nbsp;``len(V)-1``&nbsp;regions&nbsp;between&nbsp;the&nbsp;values&nbsp;in&nbsp;*V*,<br>
  64 +which&nbsp;must&nbsp;be&nbsp;in&nbsp;increasing&nbsp;order.<br>
  65 +&nbsp;<br>
  66 +::<br>
  67 +&nbsp;<br>
  68 +&nbsp;&nbsp;contour(Z,&nbsp;**kwargs)<br>
  69 +&nbsp;<br>
  70 +Use&nbsp;keyword&nbsp;args&nbsp;to&nbsp;control&nbsp;colors,&nbsp;linewidth,&nbsp;origin,&nbsp;cmap&nbsp;...&nbsp;see<br>
  71 +below&nbsp;for&nbsp;more&nbsp;details.<br>
  72 +&nbsp;<br>
  73 +*X*&nbsp;and&nbsp;*Y*&nbsp;must&nbsp;both&nbsp;be&nbsp;2-D&nbsp;with&nbsp;the&nbsp;same&nbsp;shape&nbsp;as&nbsp;*Z*,&nbsp;or&nbsp;they<br>
  74 +must&nbsp;both&nbsp;be&nbsp;1-D&nbsp;such&nbsp;that&nbsp;``len(X)``&nbsp;is&nbsp;the&nbsp;number&nbsp;of&nbsp;columns&nbsp;in<br>
  75 +*Z*&nbsp;and&nbsp;``len(Y)``&nbsp;is&nbsp;the&nbsp;number&nbsp;of&nbsp;rows&nbsp;in&nbsp;*Z*.<br>
  76 +&nbsp;<br>
  77 +``C&nbsp;=&nbsp;contour(...)``&nbsp;returns&nbsp;a<br>
  78 +:class:`~matplotlib.contour.QuadContourSet`&nbsp;object.<br>
  79 +&nbsp;<br>
  80 +Optional&nbsp;keyword&nbsp;arguments:<br>
  81 +&nbsp;<br>
  82 +&nbsp;&nbsp;*corner_mask*:&nbsp;[&nbsp;*True*&nbsp;|&nbsp;*False*&nbsp;|&nbsp;'legacy'&nbsp;]<br>
  83 +&nbsp;&nbsp;&nbsp;&nbsp;Enable/disable&nbsp;corner&nbsp;masking,&nbsp;which&nbsp;only&nbsp;has&nbsp;an&nbsp;effect&nbsp;if&nbsp;*Z*&nbsp;is<br>
  84 +&nbsp;&nbsp;&nbsp;&nbsp;a&nbsp;masked&nbsp;array.&nbsp;&nbsp;If&nbsp;*False*,&nbsp;any&nbsp;quad&nbsp;touching&nbsp;a&nbsp;masked&nbsp;point&nbsp;is<br>
  85 +&nbsp;&nbsp;&nbsp;&nbsp;masked&nbsp;out.&nbsp;&nbsp;If&nbsp;*True*,&nbsp;only&nbsp;the&nbsp;triangular&nbsp;corners&nbsp;of&nbsp;quads<br>
  86 +&nbsp;&nbsp;&nbsp;&nbsp;nearest&nbsp;those&nbsp;points&nbsp;are&nbsp;always&nbsp;masked&nbsp;out,&nbsp;other&nbsp;triangular<br>
  87 +&nbsp;&nbsp;&nbsp;&nbsp;corners&nbsp;comprising&nbsp;three&nbsp;unmasked&nbsp;points&nbsp;are&nbsp;contoured&nbsp;as&nbsp;usual.<br>
  88 +&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;'legacy',&nbsp;the&nbsp;old&nbsp;contouring&nbsp;algorithm&nbsp;is&nbsp;used,&nbsp;which&nbsp;is<br>
  89 +&nbsp;&nbsp;&nbsp;&nbsp;equivalent&nbsp;to&nbsp;*False*&nbsp;and&nbsp;is&nbsp;deprecated,&nbsp;only&nbsp;remaining&nbsp;whilst&nbsp;the<br>
  90 +&nbsp;&nbsp;&nbsp;&nbsp;new&nbsp;algorithm&nbsp;is&nbsp;tested&nbsp;fully.<br>
  91 +&nbsp;<br>
  92 +&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;not&nbsp;specified,&nbsp;the&nbsp;default&nbsp;is&nbsp;taken&nbsp;from<br>
  93 +&nbsp;&nbsp;&nbsp;&nbsp;rcParams['contour.corner_mask'],&nbsp;which&nbsp;is&nbsp;True&nbsp;unless&nbsp;it&nbsp;has<br>
  94 +&nbsp;&nbsp;&nbsp;&nbsp;been&nbsp;modified.<br>
  95 +&nbsp;<br>
  96 +&nbsp;&nbsp;*colors*:&nbsp;[&nbsp;*None*&nbsp;|&nbsp;string&nbsp;|&nbsp;(mpl_colors)&nbsp;]<br>
  97 +&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;*None*,&nbsp;the&nbsp;colormap&nbsp;specified&nbsp;by&nbsp;cmap&nbsp;will&nbsp;be&nbsp;used.<br>
  98 +&nbsp;<br>
  99 +&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;a&nbsp;string,&nbsp;like&nbsp;'r'&nbsp;or&nbsp;'red',&nbsp;all&nbsp;levels&nbsp;will&nbsp;be&nbsp;plotted&nbsp;in&nbsp;this<br>
  100 +&nbsp;&nbsp;&nbsp;&nbsp;color.<br>
  101 +&nbsp;<br>
  102 +&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;a&nbsp;tuple&nbsp;of&nbsp;matplotlib&nbsp;color&nbsp;args&nbsp;(string,&nbsp;float,&nbsp;rgb,&nbsp;etc),<br>
  103 +&nbsp;&nbsp;&nbsp;&nbsp;different&nbsp;levels&nbsp;will&nbsp;be&nbsp;plotted&nbsp;in&nbsp;different&nbsp;colors&nbsp;in&nbsp;the&nbsp;order<br>
  104 +&nbsp;&nbsp;&nbsp;&nbsp;specified.<br>
  105 +&nbsp;<br>
  106 +&nbsp;&nbsp;*alpha*:&nbsp;float<br>
  107 +&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;alpha&nbsp;blending&nbsp;value<br>
  108 +&nbsp;<br>
  109 +&nbsp;&nbsp;*cmap*:&nbsp;[&nbsp;*None*&nbsp;|&nbsp;Colormap&nbsp;]<br>
  110 +&nbsp;&nbsp;&nbsp;&nbsp;A&nbsp;cm&nbsp;:class:`~matplotlib.colors.Colormap`&nbsp;instance&nbsp;or<br>
  111 +&nbsp;&nbsp;&nbsp;&nbsp;*None*.&nbsp;If&nbsp;*cmap*&nbsp;is&nbsp;*None*&nbsp;and&nbsp;*colors*&nbsp;is&nbsp;*None*,&nbsp;a<br>
  112 +&nbsp;&nbsp;&nbsp;&nbsp;default&nbsp;Colormap&nbsp;is&nbsp;used.<br>
  113 +&nbsp;<br>
  114 +&nbsp;&nbsp;*norm*:&nbsp;[&nbsp;*None*&nbsp;|&nbsp;Normalize&nbsp;]<br>
  115 +&nbsp;&nbsp;&nbsp;&nbsp;A&nbsp;:class:`matplotlib.colors.Normalize`&nbsp;instance&nbsp;for<br>
  116 +&nbsp;&nbsp;&nbsp;&nbsp;scaling&nbsp;data&nbsp;values&nbsp;to&nbsp;colors.&nbsp;If&nbsp;*norm*&nbsp;is&nbsp;*None*&nbsp;and<br>
  117 +&nbsp;&nbsp;&nbsp;&nbsp;*colors*&nbsp;is&nbsp;*None*,&nbsp;the&nbsp;default&nbsp;linear&nbsp;scaling&nbsp;is&nbsp;used.<br>
  118 +&nbsp;<br>
  119 +&nbsp;&nbsp;*vmin*,&nbsp;*vmax*:&nbsp;[&nbsp;*None*&nbsp;|&nbsp;scalar&nbsp;]<br>
  120 +&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;not&nbsp;*None*,&nbsp;either&nbsp;or&nbsp;both&nbsp;of&nbsp;these&nbsp;values&nbsp;will&nbsp;be<br>
  121 +&nbsp;&nbsp;&nbsp;&nbsp;supplied&nbsp;to&nbsp;the&nbsp;:class:`matplotlib.colors.Normalize`<br>
  122 +&nbsp;&nbsp;&nbsp;&nbsp;instance,&nbsp;overriding&nbsp;the&nbsp;default&nbsp;color&nbsp;scaling&nbsp;based&nbsp;on<br>
  123 +&nbsp;&nbsp;&nbsp;&nbsp;*levels*.<br>
  124 +&nbsp;<br>
  125 +&nbsp;&nbsp;*levels*:&nbsp;[level0,&nbsp;level1,&nbsp;...,&nbsp;leveln]<br>
  126 +&nbsp;&nbsp;&nbsp;&nbsp;A&nbsp;list&nbsp;of&nbsp;floating&nbsp;point&nbsp;numbers&nbsp;indicating&nbsp;the&nbsp;level<br>
  127 +&nbsp;&nbsp;&nbsp;&nbsp;curves&nbsp;to&nbsp;draw,&nbsp;in&nbsp;increasing&nbsp;order;&nbsp;e.g.,&nbsp;to&nbsp;draw&nbsp;just<br>
  128 +&nbsp;&nbsp;&nbsp;&nbsp;the&nbsp;zero&nbsp;contour&nbsp;pass&nbsp;``levels=[0]``<br>
  129 +&nbsp;<br>
  130 +&nbsp;&nbsp;*origin*:&nbsp;[&nbsp;*None*&nbsp;|&nbsp;'upper'&nbsp;|&nbsp;'lower'&nbsp;|&nbsp;'image'&nbsp;]<br>
  131 +&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;*None*,&nbsp;the&nbsp;first&nbsp;value&nbsp;of&nbsp;*Z*&nbsp;will&nbsp;correspond&nbsp;to&nbsp;the<br>
  132 +&nbsp;&nbsp;&nbsp;&nbsp;lower&nbsp;left&nbsp;corner,&nbsp;location&nbsp;(0,0).&nbsp;If&nbsp;'image',&nbsp;the&nbsp;rc<br>
  133 +&nbsp;&nbsp;&nbsp;&nbsp;value&nbsp;for&nbsp;``image.origin``&nbsp;will&nbsp;be&nbsp;used.<br>
  134 +&nbsp;<br>
  135 +&nbsp;&nbsp;&nbsp;&nbsp;This&nbsp;keyword&nbsp;is&nbsp;not&nbsp;active&nbsp;if&nbsp;*X*&nbsp;and&nbsp;*Y*&nbsp;are&nbsp;specified&nbsp;in<br>
  136 +&nbsp;&nbsp;&nbsp;&nbsp;the&nbsp;call&nbsp;to&nbsp;contour.<br>
  137 +&nbsp;<br>
  138 +&nbsp;&nbsp;*extent*:&nbsp;[&nbsp;*None*&nbsp;|&nbsp;(x0,x1,y0,y1)&nbsp;]<br>
  139 +&nbsp;<br>
  140 +&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;*origin*&nbsp;is&nbsp;not&nbsp;*None*,&nbsp;then&nbsp;*extent*&nbsp;is&nbsp;interpreted&nbsp;as<br>
  141 +&nbsp;&nbsp;&nbsp;&nbsp;in&nbsp;:func:`matplotlib.pyplot.imshow`:&nbsp;it&nbsp;gives&nbsp;the&nbsp;outer<br>
  142 +&nbsp;&nbsp;&nbsp;&nbsp;pixel&nbsp;boundaries.&nbsp;In&nbsp;this&nbsp;case,&nbsp;the&nbsp;position&nbsp;of&nbsp;Z[0,0]<br>
  143 +&nbsp;&nbsp;&nbsp;&nbsp;is&nbsp;the&nbsp;center&nbsp;of&nbsp;the&nbsp;pixel,&nbsp;not&nbsp;a&nbsp;corner.&nbsp;If&nbsp;*origin*&nbsp;is<br>
  144 +&nbsp;&nbsp;&nbsp;&nbsp;*None*,&nbsp;then&nbsp;(*x0*,&nbsp;*y0*)&nbsp;is&nbsp;the&nbsp;position&nbsp;of&nbsp;Z[0,0],&nbsp;and<br>
  145 +&nbsp;&nbsp;&nbsp;&nbsp;(*x1*,&nbsp;*y1*)&nbsp;is&nbsp;the&nbsp;position&nbsp;of&nbsp;Z[-1,-1].<br>
  146 +&nbsp;<br>
  147 +&nbsp;&nbsp;&nbsp;&nbsp;This&nbsp;keyword&nbsp;is&nbsp;not&nbsp;active&nbsp;if&nbsp;*X*&nbsp;and&nbsp;*Y*&nbsp;are&nbsp;specified&nbsp;in<br>
  148 +&nbsp;&nbsp;&nbsp;&nbsp;the&nbsp;call&nbsp;to&nbsp;contour.<br>
  149 +&nbsp;<br>
  150 +&nbsp;&nbsp;*locator*:&nbsp;[&nbsp;*None*&nbsp;|&nbsp;ticker.Locator&nbsp;subclass&nbsp;]<br>
  151 +&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;*locator*&nbsp;is&nbsp;*None*,&nbsp;the&nbsp;default<br>
  152 +&nbsp;&nbsp;&nbsp;&nbsp;:class:`~matplotlib.ticker.MaxNLocator`&nbsp;is&nbsp;used.&nbsp;The<br>
  153 +&nbsp;&nbsp;&nbsp;&nbsp;locator&nbsp;is&nbsp;used&nbsp;to&nbsp;determine&nbsp;the&nbsp;contour&nbsp;levels&nbsp;if&nbsp;they<br>
  154 +&nbsp;&nbsp;&nbsp;&nbsp;are&nbsp;not&nbsp;given&nbsp;explicitly&nbsp;via&nbsp;the&nbsp;*V*&nbsp;argument.<br>
  155 +&nbsp;<br>
  156 +&nbsp;&nbsp;*extend*:&nbsp;[&nbsp;'neither'&nbsp;|&nbsp;'both'&nbsp;|&nbsp;'min'&nbsp;|&nbsp;'max'&nbsp;]<br>
  157 +&nbsp;&nbsp;&nbsp;&nbsp;Unless&nbsp;this&nbsp;is&nbsp;'neither',&nbsp;contour&nbsp;levels&nbsp;are&nbsp;automatically<br>
  158 +&nbsp;&nbsp;&nbsp;&nbsp;added&nbsp;to&nbsp;one&nbsp;or&nbsp;both&nbsp;ends&nbsp;of&nbsp;the&nbsp;range&nbsp;so&nbsp;that&nbsp;all&nbsp;data<br>
  159 +&nbsp;&nbsp;&nbsp;&nbsp;are&nbsp;included.&nbsp;These&nbsp;added&nbsp;ranges&nbsp;are&nbsp;then&nbsp;mapped&nbsp;to&nbsp;the<br>
  160 +&nbsp;&nbsp;&nbsp;&nbsp;special&nbsp;colormap&nbsp;values&nbsp;which&nbsp;default&nbsp;to&nbsp;the&nbsp;ends&nbsp;of&nbsp;the<br>
  161 +&nbsp;&nbsp;&nbsp;&nbsp;colormap&nbsp;range,&nbsp;but&nbsp;can&nbsp;be&nbsp;set&nbsp;via<br>
  162 +&nbsp;&nbsp;&nbsp;&nbsp;:meth:`matplotlib.colors.Colormap.set_under`&nbsp;and<br>
  163 +&nbsp;&nbsp;&nbsp;&nbsp;:meth:`matplotlib.colors.Colormap.set_over`&nbsp;methods.<br>
  164 +&nbsp;<br>
  165 +&nbsp;&nbsp;*xunits*,&nbsp;*yunits*:&nbsp;[&nbsp;*None*&nbsp;|&nbsp;registered&nbsp;units&nbsp;]<br>
  166 +&nbsp;&nbsp;&nbsp;&nbsp;Override&nbsp;axis&nbsp;units&nbsp;by&nbsp;specifying&nbsp;an&nbsp;instance&nbsp;of&nbsp;a<br>
  167 +&nbsp;&nbsp;&nbsp;&nbsp;:class:`matplotlib.units.ConversionInterface`.<br>
  168 +&nbsp;<br>
  169 +&nbsp;&nbsp;*antialiased*:&nbsp;[&nbsp;*True*&nbsp;|&nbsp;*False*&nbsp;]<br>
  170 +&nbsp;&nbsp;&nbsp;&nbsp;enable&nbsp;antialiasing,&nbsp;overriding&nbsp;the&nbsp;defaults.&nbsp;&nbsp;For<br>
  171 +&nbsp;&nbsp;&nbsp;&nbsp;filled&nbsp;contours,&nbsp;the&nbsp;default&nbsp;is&nbsp;*True*.&nbsp;&nbsp;For&nbsp;line&nbsp;contours,<br>
  172 +&nbsp;&nbsp;&nbsp;&nbsp;it&nbsp;is&nbsp;taken&nbsp;from&nbsp;rcParams['lines.antialiased'].<br>
  173 +&nbsp;<br>
  174 +&nbsp;&nbsp;*nchunk*:&nbsp;[&nbsp;0&nbsp;|&nbsp;integer&nbsp;]<br>
  175 +&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;0,&nbsp;no&nbsp;subdivision&nbsp;of&nbsp;the&nbsp;domain.&nbsp;&nbsp;Specify&nbsp;a&nbsp;positive&nbsp;integer&nbsp;to<br>
  176 +&nbsp;&nbsp;&nbsp;&nbsp;divide&nbsp;the&nbsp;domain&nbsp;into&nbsp;subdomains&nbsp;of&nbsp;*nchunk*&nbsp;by&nbsp;*nchunk*&nbsp;quads.<br>
  177 +&nbsp;&nbsp;&nbsp;&nbsp;Chunking&nbsp;reduces&nbsp;the&nbsp;maximum&nbsp;length&nbsp;of&nbsp;polygons&nbsp;generated&nbsp;by&nbsp;the<br>
  178 +&nbsp;&nbsp;&nbsp;&nbsp;contouring&nbsp;algorithm&nbsp;which&nbsp;reduces&nbsp;the&nbsp;rendering&nbsp;workload&nbsp;passed<br>
  179 +&nbsp;&nbsp;&nbsp;&nbsp;on&nbsp;to&nbsp;the&nbsp;backend&nbsp;and&nbsp;also&nbsp;requires&nbsp;slightly&nbsp;less&nbsp;RAM.&nbsp;&nbsp;It&nbsp;can<br>
  180 +&nbsp;&nbsp;&nbsp;&nbsp;however&nbsp;introduce&nbsp;rendering&nbsp;artifacts&nbsp;at&nbsp;chunk&nbsp;boundaries&nbsp;depending<br>
  181 +&nbsp;&nbsp;&nbsp;&nbsp;on&nbsp;the&nbsp;backend,&nbsp;the&nbsp;*antialiased*&nbsp;flag&nbsp;and&nbsp;value&nbsp;of&nbsp;*alpha*.<br>
  182 +&nbsp;<br>
  183 +contour-only&nbsp;keyword&nbsp;arguments:<br>
  184 +&nbsp;<br>
  185 +&nbsp;&nbsp;*linewidths*:&nbsp;[&nbsp;*None*&nbsp;|&nbsp;number&nbsp;|&nbsp;tuple&nbsp;of&nbsp;numbers&nbsp;]<br>
  186 +&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;*linewidths*&nbsp;is&nbsp;*None*,&nbsp;the&nbsp;default&nbsp;width&nbsp;in<br>
  187 +&nbsp;&nbsp;&nbsp;&nbsp;``lines.linewidth``&nbsp;in&nbsp;``matplotlibrc``&nbsp;is&nbsp;used.<br>
  188 +&nbsp;<br>
  189 +&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;a&nbsp;number,&nbsp;all&nbsp;levels&nbsp;will&nbsp;be&nbsp;plotted&nbsp;with&nbsp;this&nbsp;linewidth.<br>
  190 +&nbsp;<br>
  191 +&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;a&nbsp;tuple,&nbsp;different&nbsp;levels&nbsp;will&nbsp;be&nbsp;plotted&nbsp;with&nbsp;different<br>
  192 +&nbsp;&nbsp;&nbsp;&nbsp;linewidths&nbsp;in&nbsp;the&nbsp;order&nbsp;specified.<br>
  193 +&nbsp;<br>
  194 +&nbsp;&nbsp;*linestyles*:&nbsp;[&nbsp;*None*&nbsp;|&nbsp;'solid'&nbsp;|&nbsp;'dashed'&nbsp;|&nbsp;'dashdot'&nbsp;|&nbsp;'dotted'&nbsp;]<br>
  195 +&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;*linestyles*&nbsp;is&nbsp;*None*,&nbsp;the&nbsp;default&nbsp;is&nbsp;'solid'&nbsp;unless<br>
  196 +&nbsp;&nbsp;&nbsp;&nbsp;the&nbsp;lines&nbsp;are&nbsp;monochrome.&nbsp;&nbsp;In&nbsp;that&nbsp;case,&nbsp;negative<br>
  197 +&nbsp;&nbsp;&nbsp;&nbsp;contours&nbsp;will&nbsp;take&nbsp;their&nbsp;linestyle&nbsp;from&nbsp;the&nbsp;``matplotlibrc``<br>
  198 +&nbsp;&nbsp;&nbsp;&nbsp;``contour.negative_linestyle``&nbsp;setting.<br>
  199 +&nbsp;<br>
  200 +&nbsp;&nbsp;&nbsp;&nbsp;*linestyles*&nbsp;can&nbsp;also&nbsp;be&nbsp;an&nbsp;iterable&nbsp;of&nbsp;the&nbsp;above&nbsp;strings<br>
  201 +&nbsp;&nbsp;&nbsp;&nbsp;specifying&nbsp;a&nbsp;set&nbsp;of&nbsp;linestyles&nbsp;to&nbsp;be&nbsp;used.&nbsp;If&nbsp;this<br>
  202 +&nbsp;&nbsp;&nbsp;&nbsp;iterable&nbsp;is&nbsp;shorter&nbsp;than&nbsp;the&nbsp;number&nbsp;of&nbsp;contour&nbsp;levels<br>
  203 +&nbsp;&nbsp;&nbsp;&nbsp;it&nbsp;will&nbsp;be&nbsp;repeated&nbsp;as&nbsp;necessary.<br>
  204 +&nbsp;<br>
  205 +contourf-only&nbsp;keyword&nbsp;arguments:<br>
  206 +&nbsp;<br>
  207 +&nbsp;&nbsp;*hatches*:<br>
  208 +&nbsp;&nbsp;&nbsp;&nbsp;A&nbsp;list&nbsp;of&nbsp;cross&nbsp;hatch&nbsp;patterns&nbsp;to&nbsp;use&nbsp;on&nbsp;the&nbsp;filled&nbsp;areas.<br>
  209 +&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;None,&nbsp;no&nbsp;hatching&nbsp;will&nbsp;be&nbsp;added&nbsp;to&nbsp;the&nbsp;contour.<br>
  210 +&nbsp;&nbsp;&nbsp;&nbsp;Hatching&nbsp;is&nbsp;supported&nbsp;in&nbsp;the&nbsp;PostScript,&nbsp;PDF,&nbsp;SVG&nbsp;and&nbsp;Agg<br>
  211 +&nbsp;&nbsp;&nbsp;&nbsp;backends&nbsp;only.<br>
  212 +&nbsp;<br>
  213 +&nbsp;<br>
  214 +Note:&nbsp;contourf&nbsp;fills&nbsp;intervals&nbsp;that&nbsp;are&nbsp;closed&nbsp;at&nbsp;the&nbsp;top;&nbsp;that<br>
  215 +is,&nbsp;for&nbsp;boundaries&nbsp;*z1*&nbsp;and&nbsp;*z2*,&nbsp;the&nbsp;filled&nbsp;region&nbsp;is::<br>
  216 +&nbsp;<br>
  217 +&nbsp;&nbsp;&nbsp;&nbsp;z1&nbsp;&lt;&nbsp;z&nbsp;&lt;=&nbsp;z2<br>
  218 +&nbsp;<br>
  219 +There&nbsp;is&nbsp;one&nbsp;exception:&nbsp;if&nbsp;the&nbsp;lowest&nbsp;boundary&nbsp;coincides&nbsp;with<br>
  220 +the&nbsp;minimum&nbsp;value&nbsp;of&nbsp;the&nbsp;*z*&nbsp;array,&nbsp;then&nbsp;that&nbsp;minimum&nbsp;value<br>
  221 +will&nbsp;be&nbsp;included&nbsp;in&nbsp;the&nbsp;lowest&nbsp;interval.<br>
  222 +&nbsp;<br>
  223 +**Examples:**<br>
  224 +&nbsp;<br>
  225 +..&nbsp;plot::&nbsp;mpl_examples/pylab_examples/contour_demo.py<br>
  226 +&nbsp;<br>
  227 +..&nbsp;plot::&nbsp;mpl_examples/pylab_examples/contourf_demo.py<br>
  228 +&nbsp;<br>
  229 +..&nbsp;plot::&nbsp;mpl_examples/pylab_examples/contour_corner_mask.py<br>
  230 +&nbsp;<br>
  231 +&nbsp;<br>
  232 +&nbsp;<br>
  233 +Additional&nbsp;kwargs:&nbsp;hold&nbsp;=&nbsp;[True|False]&nbsp;overrides&nbsp;default&nbsp;hold&nbsp;state</tt></dd></dl>
  234 +
  235 +</div></div>
chunks/doc-plt-contourf.md View file @ 9186cc5
  1 +## … et en remplissant, avec `plt.contourf` {autodoc}
  2 +<div class='scrollatbottom'>
  3 +<ul>
  4 +<li>idem</li>
  5 +</ul>
  6 +
  7 +<div class='scroll'>
  8 +Python Library Documentation: function contourf in matplotlib.pyplot
  9 +