python開源庫,python庫簡介-zstarling

 2023-10-06 阅读 28 评论 0

摘要:目錄matplotlib.cmseaborn.lmplotpickle matplotlib.cm matplotlib.cm是matplotlib庫中內置的色彩映射函數。官網解釋 語法:matplotlib.cm.[色彩] ([數據集]) 即對[數據集]應用[色彩]示例:plt.cm.Set1(i) plt.cm.nipy_spectral結果:(0.2156862745098039

目錄

  • matplotlib.cm
  • seaborn.lmplot
  • pickle

matplotlib.cm

  • matplotlib.cm是matplotlib庫中內置的色彩映射函數。官網解釋
    • 語法:matplotlib.cm.[色彩] ([數據集]) 即對[數據集]應用[色彩]
    • 示例:plt.cm.Set1(i) plt.cm.nipy_spectral
    • 結果:(0.21568627450980393, 0.49411764705882355, 0.7215686274509804, 1.0)
    • 備注:顏色可用元組表示,元組由4各元素組成,每個元素范圍在[0,1]之間。eg:(0,0,0,0);(255,255,255,255)。

python開源庫,色彩集


cmaps = [('Perceptually Uniform Sequential', ['viridis', 'plasma', 'inferno', 'magma', 'cividis']),('Sequential', ['Greys', 'Purples', 'Blues', 'Greens', 'Oranges', 'Reds','YlOrBr', 'YlOrRd', 'OrRd', 'PuRd', 'RdPu', 'BuPu','GnBu', 'PuBu', 'YlGnBu', 'PuBuGn', 'BuGn', 'YlGn']),('Sequential (2)', ['binary', 'gist_yarg', 'gist_gray', 'gray', 'bone', 'pink','spring', 'summer', 'autumn', 'winter', 'cool', 'Wistia','hot', 'afmhot', 'gist_heat', 'copper']),('Diverging', ['PiYG', 'PRGn', 'BrBG', 'PuOr', 'RdGy', 'RdBu','RdYlBu', 'RdYlGn', 'Spectral', 'coolwarm', 'bwr', 'seismic']),('Cyclic', ['twilight', 'twilight_shifted', 'hsv']),('Qualitative', ['Pastel1', 'Pastel2', 'Paired', 'Accent','Dark2', 'Set1', 'Set2', 'Set3','tab10', 'tab20', 'tab20b', 'tab20c']),('Miscellaneous', ['flag', 'prism', 'ocean', 'gist_earth', 'terrain', 'gist_stern','gnuplot', 'gnuplot2', 'CMRmap', 'cubehelix', 'brg','gist_rainbow', 'rainbow', 'jet', 'turbo', 'nipy_spectral','gist_ncar'])]

seaborn.lmplot

  • snm,lmplot是用來繪制回歸圖的。官方解釋
    • 建立的回歸模型不一定是直線,也可以設置多項式模型。order:(可選)此參數的階數大于1,控制進行回歸的冪次(一次以上即是多項式回歸)。
    • 部分參數詳解。
      在這里插入圖片描述
    • seaborn.set_style()使用5種默認風格在這里插入圖片描述

pickle

  • pickle包的作用是模型加載和導出
    • import pickle
    • 語法:pickle.dump(model, 文件名) – 導出;
      pickle.load( 文件名) – 導入;
      在這里插入圖片描述
      在這里插入圖片描述

版权声明:本站所有资料均为网友推荐收集整理而来,仅供学习和研究交流使用。

原文链接:https://808629.com/127684.html

发表评论:

本站为非赢利网站,部分文章来源或改编自互联网及其他公众平台,主要目的在于分享信息,版权归原作者所有,内容仅供读者参考,如有侵权请联系我们删除!

Copyright © 2022 86后生记录生活 Inc. 保留所有权利。

底部版权信息