未验证 提交 fc726334 编写于 作者: 飞龙 提交者: GitHub

Merge pull request #32 from cancan233/master

update 48,49,50,51,52 zh version
# seaborn.plotting_context
```py
```python
seaborn.plotting_context(context=None, font_scale=1, rc=None)
```
以dict形式返回参数,用以缩放图形的元素。
Return a parameter dict to scale elements of the figure.
This affects things like the size of the labels, lines, and other elements of the plot, but not the overall style. The base context is “notebook”, and the other contexts are “paper”, “talk”, and “poster”, which are version of the notebook parameters scaled by .8, 1.3, and 1.6, respectively.
This function returns an object that can be used in a `with` statement to temporarily change the context parameters.
这些参数可以影响诸如标签大小,线条和绘图的其他元素,但不会影响整体样式。基础文本时"notebook",和其他文本"paper","talk"和"poster",它们分别是0.8,1.3和1.6的notebook参数版本。
参数:`context`:dict, None, or one of {paper, notebook, talk, poster}
该函数返回一个对象,该对象可以在`with`语句中使用,临时改变文本参数。
> A dictionary of parameters or the name of a preconfigured set.
参数:`context`:dict, None 或者是{paper, notebook, talk, poster}其中一个
`font_scale`:float, optional
> 参数集或者是预设集合的名字
> Separate scaling factor to independently scale the size of the font elements.
`font_scale`:浮点数,可选
`rc`:dict, optional
> 单独的缩放因子可以独立缩放字体元素大小
> Parameter mappings to override the values in the preset seaborn context dictionaries. This only updates parameters that are considered part of the context definition.
`rc`:dict,可选
> 参数映射以覆盖预设的seaborn的文本字典中的值。这只更新被视为文本定义的一部分的参数。
也可参见
See also
设置matplotlib参数以调整绘图元素返回定义图形样式的参数的dict,定义绘图的调色板。
set the matplotlib parameters to scale plot elementsreturn a dict of parameters defining a figure styledefine the color palette for a plot
示例:
Examples
```py
```python
>>> c = plotting_context("poster")
```
```py
```python
>>> c = plotting_context("notebook", font_scale=1.5)
```
```py
```python
>>> c = plotting_context("talk", rc={"lines.linewidth": 2})
```
```py
```python
>>> import matplotlib.pyplot as plt
>>> with plotting_context("paper"):
... f, ax = plt.subplots()
... ax.plot(x, y)
```
# seaborn.set_context
```py
```python
seaborn.set_context(context=None, font_scale=1, rc=None)
```
Set the plotting context parameters.
设置绘图文本参数。
This affects things like the size of the labels, lines, and other elements of the plot, but not the overall style. The base context is “notebook”, and the other contexts are “paper”, “talk”, and “poster”, which are version of the notebook parameters scaled by .8, 1.3, and 1.6, respectively.
这些参数可以影响诸如标签大小,线条和绘图的其他元素,但不会影响整体样式。基础文本时"notebook",和其他文本"paper","talk"和"poster",它们分别是0.8,1.3和1.6的notebook参数版本。
参数:`context`:dict, None, or one of {paper, notebook, talk, poster}
参数:`context`:dict, None 或者是{paper, notebook, talk, poster}其中一个
> A dictionary of parameters or the name of a preconfigured set.
> 参数集或者是预设集合的名字
`font_scale`float, optional
`font_scale`浮点数,可选
> Separate scaling factor to independently scale the size of the font elements.
> 单独的缩放因子可以独立缩放字体元素大小
`rc`:dict, optional
`rc`:dict,可选
> Parameter mappings to override the values in the preset seaborn context dictionaries. This only updates parameters that are considered part of the context definition.
> 参数映射以覆盖预设的seaborn的上下文字典中的值。这只更新被视为上下文定义的一部分的参数。
也可参见
返回一个rc参数的字典,或者在`with`语句中使用临时设置context.set图样式的默认为数字的默认调色板
See also
示例
return a dictionary of rc parameters, or use in a `with` statement to temporarily set the context.set the default parameters for figure styleset the default color palette for figures
Examples
```py
```python
>>> set_context("paper")
```
```py
```python
>>> set_context("talk", font_scale=1.4)
```
```py
```python
>>> set_context("talk", rc={"lines.linewidth": 2})
```
# seaborn.set_color_codes
```py
```python
seaborn.set_color_codes(palette='deep')
```
Change how matplotlib color shorthands are interpreted.
改变matplotlib颜色缩写词的解释方式。
Calling this will change how shorthand codes like “b” or “g” are interpreted by matplotlib in subsequent plots.
调用此方法将改变matplotlib在后续图表中解释缩写词,例如"b"或"g"的方式。
参数:`palette`:{deep, muted, pastel, dark, bright, colorblind}
参数: `palette`: {deep, muted, pastel, dark, bright, colorblind}
> Named seaborn palette to use as the source of colors.
> 预命名的seaborn调色板,用作颜色的来源
参见
可以通过高级seaborn样式管理器设置颜色代码。也可以通过设置matplotlib颜色循环功能设置颜色代码。
See also
示例:
Color codes can be set through the high-level seaborn style manager.Color codes can also be set through the function that sets the matplotlib color cycle.
将matplotlib颜色代码映射到默认的seaborn调色板。
Examples
Map matplotlib color codes to the default seaborn palette.
```py
```python
>>> import matplotlib.pyplot as plt
>>> import seaborn as sns; sns.set()
>>> sns.set_color_codes()
>>> _ = plt.plot([0, 1], color="r")
```
![http://seaborn.pydata.org/_images/seaborn-set_color_codes-1.png](img/f7331a33eaedf9eae59191642f7a64e4.jpg)
Use a different seaborn palette.
使用不同的seaborn调色板
```py
```python
>>> sns.set_color_codes("dark")
>>> _ = plt.plot([0, 1], color="g")
>>> _ = plt.plot([0, 2], color="m")
```
![http://seaborn.pydata.org/_images/seaborn-set_color_codes-2.png](img/35544ecf6de962c91ab860527035f39f.jpg)
# seaborn.reset_defaults
```py
```python
seaborn.reset_defaults()
```
```
Restore all RC params to default settings.
\ No newline at end of file
重置所有RC设置至默认设置。
\ No newline at end of file
# seaborn.reset_orig
```py
```python
seaborn.reset_orig()
```
Restore all RC params to original settings (respects custom rc).
\ No newline at end of file
将所有RC参数恢复为最初设置(相对于自定义rc而言)。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册