日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

setp函数--Matplotlib

發(fā)布時間:2024/1/1 编程问答 25 豆豆
生活随笔 收集整理的這篇文章主要介紹了 setp函数--Matplotlib 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

函數(shù)功能:
Set a property on an artist object.
設(shè)置元素屬性
函數(shù)語法:
setp(obj, *args, **kwargs)

函數(shù)參數(shù):
obj: 要設(shè)置的對象

  • matplotlib supports the use of setp() (“set property”) and getp() to set and get object properties, as well as to do introspection on the object.
    matplotlib 支持使用setp()函數(shù)設(shè)置屬性,使用getp()函數(shù)獲取查看屬性,以及進行自查。
  • 例如要將線條風(fēng)格設(shè)置為虛線,可以:

    line, = plot([1,2,3]) setp(line, linestyle='--') import matplotlib.pyplot as plt import numpy as npx = np.linspace(-2*np.pi, 2 * np.pi, 200) y = np.sin(x)line1,=plt.plot(x,y)plt.setp(line1,ls='--')plt.show()

  • If you want to know the valid types of arguments, you can provide the name of the property you want to set without a value:
    如果您想知道參數(shù)有效的類型(可取的值),則可以提供要設(shè)置的屬性名稱,但不帶值。
  • setp(line, 'linestyle')

    例如:獲取線條風(fēng)格的取值有哪些

    import matplotlib.pyplot as plt import numpy as npx = np.linspace(-2*np.pi, 2 * np.pi, 200) y = np.sin(x)line,=plt.plot(x,y)plt.setp(line,'linestyle')

    運行結(jié)果

    3. If you want to see all the properties that can be set, and their possible values, you can do:
    如果你想要查看所有可以設(shè)置的屬性和屬性的取值,可以:

    setp(line) import matplotlib.pyplot as plt import numpy as npx = np.linspace(-2*np.pi, 2 * np.pi, 200) y = np.sin(x)line1,=plt.plot(x,y)plt.setp(line1)

    運行結(jié)果如下:

    agg_filter: a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) arrayalpha: float or Noneanimated: boolantialiased or aa: boolclip_box: `.Bbox`clip_on: boolclip_path: Patch or (Path, Transform) or Nonecolor or c: colorcontains: unknowndash_capstyle: {'butt', 'round', 'projecting'}dash_joinstyle: {'miter', 'round', 'bevel'}dashes: sequence of floats (on/off ink in points) or (None, None)data: (2, N) array or two 1D arraysdrawstyle or ds: {'default', 'steps', 'steps-pre', 'steps-mid', 'steps-post'}, default: 'default'figure: `.Figure`fillstyle: {'full', 'left', 'right', 'bottom', 'top', 'none'}gid: strin_layout: boollabel: objectlinestyle or ls: {'-', '--', '-.', ':', '', (offset, on-off-seq), ...}linewidth or lw: floatmarker: marker style string, `~.path.Path` or `~.markers.MarkerStyle`markeredgecolor or mec: colormarkeredgewidth or mew: floatmarkerfacecolor or mfc: colormarkerfacecoloralt or mfcalt: colormarkersize or ms: floatmarkevery: None or int or (int, int) or slice or List[int] or float or (float, float) or List[bool]path_effects: `.AbstractPathEffect`picker: unknownpickradius: floatrasterized: bool or Nonesketch_params: (scale: float, length: float, randomness: float)snap: bool or Nonesolid_capstyle: {'butt', 'round', 'projecting'}solid_joinstyle: {'miter', 'round', 'bevel'}transform: `matplotlib.transforms.Transform`url: strvisible: boolxdata: 1D arrayydata: 1D arrayzorder: floatProcess finished with exit code 0

    官方文檔: setp函數(shù)

    總結(jié)

    以上是生活随笔為你收集整理的setp函数--Matplotlib的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

    如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。