本文簡要介紹 python 語言中 matplotlib.colors.TwoSlopeNorm
的用法。
-
基礎:
Normalize
使用設定的中心規範化數據。
在映射概念中心周圍變化率不相等的數據時很有用,例如,範圍從 -2 到 4 的數據,其中 0 為中點。
- 參數:
- vcenter 浮點數
-
在規範化中定義
0.5
的數據值。 - vmin 浮點數,可選
-
在規範化中定義
0.0
的數據值。默認為數據集的最小值。 - vmax 浮點數,可選
-
在規範化中定義
1.0
的數據值。默認為數據集的最大值。
例子
這將數據值 -4000 映射到 0.、0 到 0.5 和 +10000 到 1.0;之間的數據是線性插值的:
>>> import matplotlib.colors as mcolors >>> offset = mcolors.TwoSlopeNorm(vmin=-4000., vcenter=0., vmax=10000) >>> data = [-4000., -2000., 0., 2500., 5000., 7500., 10000.] >>> offset(data) array([0., 0.25, 0.5, 0.625, 0.75, 0.875, 1.0])
用法
class matplotlib.colors.TwoSlopeNorm(vcenter, vmin=None, vmax=None)
相關用法
- Python matplotlib ToolManager.toolmanager_disconnect用法及代碼示例
- Python matplotlib Text.set_bbox用法及代碼示例
- Python matplotlib TexManager.get_rgba用法及代碼示例
- Python matplotlib TextToPath.get_text_path用法及代碼示例
- Python matplotlib TriMesh.sticky_edges用法及代碼示例
- Python matplotlib Table.edges用法及代碼示例
- Python matplotlib TextPath用法及代碼示例
- Python matplotlib TriMesh.set_hatch用法及代碼示例
- Python matplotlib Transform.__sub__用法及代碼示例
- Python matplotlib Table.set_fontsize用法及代碼示例
- Python matplotlib axvspan用法及代碼示例
- Python matplotlib Axes.get_legend_handles_labels用法及代碼示例
- Python matplotlib AbstractMovieWriter用法及代碼示例
- Python matplotlib triplot用法及代碼示例
- Python matplotlib StarPolygonCollection.set_hatch用法及代碼示例
- Python matplotlib Axes.hist用法及代碼示例
- Python matplotlib boxplot用法及代碼示例
- Python matplotlib subplots用法及代碼示例
- Python matplotlib InsetPosition用法及代碼示例
- Python matplotlib Figure.set_size_inches用法及代碼示例
- Python matplotlib figlegend用法及代碼示例
- Python matplotlib Axes.step用法及代碼示例
- Python matplotlib Axes.contour用法及代碼示例
- Python matplotlib LassoSelector用法及代碼示例
- Python matplotlib BrokenBarHCollection.set_hatch用法及代碼示例
注:本文由純淨天空篩選整理自skytowner.com大神的英文原創作品 matplotlib.colors.TwoSlopeNorm。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。