未验证 提交 d1104c2a 编写于 作者: C Cancan 提交者: GitHub

add 48 to 52 zh version

上级 3c2337a5
# 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.
参数:`context`:dict, None, or one of {paper, notebook, talk, poster}
这些参数可以影响诸如标签大小,线条和绘图的其他元素,但不会影响整体样式。基础文本时"notebook",和其他文本"paper","talk"和"poster",它们分别是0.8,1.3和1.6的notebook参数版本。
> A dictionary of parameters or the name of a preconfigured set.
该函数返回一个对象,该对象可以在`with`语句中使用,临时改变文本参数。
`font_scale`:float, optional
参数:`context`:dict, None 或者是{paper, notebook, talk, poster}其中一个
> Separate scaling factor to independently scale the size of the font elements.
> 参数集或者是预设集合的名字
`rc`:dict, optional
`font_scale`:浮点数,可选
> 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
也可参见
set the matplotlib parameters to scale plot elementsreturn a dict of parameters defining a figure styledefine the color palette for a plot
设置matplotlib参数以调整绘图元素返回定义图形样式的参数的dict,定义绘图的调色板。
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)
... f, ax = plt.subplots()
... ax.plot(x, y)
```
```
\ No newline at end of file
# seaborn.set_context
```py
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.
参数:`context`:dict, None, or one of {paper, notebook, talk, poster}
> A dictionary of parameters or the name of a preconfigured set.
`font_scale`:float, optional
> Separate scaling factor to independently scale the size of the font elements.
`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.
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
>>> set_context("paper")
```
```py
>>> set_context("talk", font_scale=1.4)
```
```py
>>> set_context("talk", rc={"lines.linewidth": 2})
```
\ No newline at end of file
# seaborn.set_context
```python
seaborn.set_context(context=None, font_scale=1, rc=None)
```
设置绘图文本参数。
这些参数可以影响诸如标签大小,线条和绘图的其他元素,但不会影响整体样式。基础文本时"notebook",和其他文本"paper","talk"和"poster",它们分别是0.8,1.3和1.6的notebook参数版本。
参数:`context`:dict, None 或者是{paper, notebook, talk, poster}其中一个
> 参数集或者是预设集合的名字
`font_scale`:浮点数,可选
> 单独的缩放因子可以独立缩放字体元素大小
`rc`:dict,可选
> 参数映射以覆盖预设的seaborn的上下文字典中的值。这只更新被视为上下文定义的一部分的参数。
也可参见
返回一个rc参数的字典,或者在`with`语句中使用临时设置context.set图样式的默认为数字的默认调色板
示例
```python
>>> set_context("paper")
```
```python
>>> set_context("talk", font_scale=1.4)
```
```python
>>> set_context("talk", rc={"lines.linewidth": 2})
```
# seaborn.set_color_codes
```py
seaborn.set_color_codes(palette='deep')
```
Change how matplotlib color shorthands are interpreted.
Calling this will change how shorthand codes like “b” or “g” are interpreted by matplotlib in subsequent plots.
参数:`palette`:{deep, muted, pastel, dark, bright, colorblind}
> Named seaborn palette to use as the source of colors.
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.
Examples
Map matplotlib color codes to the default seaborn palette.
```py
>>> 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.
```py
>>> 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)
\ No newline at end of file
# seaborn.set_color_codes
```python
seaborn.set_color_codes(palette='deep')
```
改变matplotlib颜色缩写词的解释方式。
调用此方法将改变matplotlib在后续图表中解释缩写词,例如"b"或"g"的方式。
参数: `palette`: {deep, muted, pastel, dark, bright, colorblind}
> 预命名的seaborn调色板,用作颜色的来源
参见
可以通过高级seaborn样式管理器设置颜色代码。也可以通过设置matplotlib颜色循环功能设置颜色代码。
示例:
将matplotlib颜色代码映射到默认的seaborn调色板。
```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)
使用不同的seaborn调色板
```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
seaborn.reset_defaults()
```
Restore all RC params to default settings.
\ No newline at end of file
# seaborn.reset_defaults
```python
seaborn.reset_defaults()
```
重置所有RC设置至默认设置。
\ No newline at end of file
# seaborn.reset_orig
```py
seaborn.reset_orig()
```
Restore all RC params to original settings (respects custom rc).
\ No newline at end of file
# seaborn.reset_orig
```python
seaborn.reset_orig()
```
将所有RC参数恢复为最初设置(相对于自定义rc而言)。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册