python无符号转有符号_Python | 散布符号

python无符号转有符号

There are multiple types of Scatter Symbols available in the matplotlib package and can be accessed through the command marker. In this article, we will show some examples of different marker types and also present a list containing all the markers as defined by matplotlib.

matplotlib软件包中有多种类型的散布符号 ,可以通过命令标记进行访问。 在本文中,我们将显示一些不同标记类型的示例,并提供一个包含由matplotlib定义的所有标记的列表。

Available Markers:

可用标记:

markers = {'.': 'point', ',': 'pixel', 'o': 'circle', 'v': 'triangle_down', 
'^': 'triangle_up', '': 'triangle_right', 
'1': 'tri_down', '2': 'tri_up', '3': 'tri_left', '4': 'tri_right', 
'8': 'octagon', 's': 'square', 'p': 'pentagon', '*': 'star', 
'h': 'hexagon1', 'H': 'hexagon2', '+': 'plus', 'x': 'x', 
'D': 'diamond', 'd': 'thin_diamond', '|': 'vline', '_': 'hline', 
'P': 'plus_filled', 'X': 'x_filled', 0: 'tickleft', 1: 'tickright', 
2: 'tickup', 3: 'tickdown', 4: 'caretleft', 5: 'caretright', 
6: 'caretup', 7: 'caretdown', 8: 'caretleftbase', 9: 'caretrightbase', 
10: 'caretupbase', 11: 'caretdownbase', 
'None': 'nothing', None: 'nothing', ' ': 'nothing', '': 'nothing'}

Python | Scatter Symbol (1)
Python | Scatter Symbol (2)
Python | Scatter Symbol (3)
Python | Scatter Symbol (4)
Python | Scatter Symbol (5)

Reference: matplotlib.markers.MarkerStyle

参考: matplotlib.markers.MarkerStyle

散点符号的Python代码 (Python code for scatter symbol)

import matplotlib.pyplot as plt
import numpy as np

x = np.arange(0.0, 50.0, 2.0)
y = x ** 1.3 + np.random.rand(*x.shape) * 30.0
s = np.random.rand(*x.shape) * 300 + 500

plt.figure()
plt.scatter(x, y, s, c="y", alpha=0.7, marker='X',
            label="Gold Mark")
plt.xlabel("Years")
plt.ylabel("Gold")
plt.title('Scatter Plot: Marker')
plt.legend()
plt.show()

plt.figure()
plt.scatter(x, y, s, c="b", alpha=0.5, marker='<',
            label="Gold Mark")
plt.xlabel("Years")
plt.ylabel("Gold")
plt.title('Scatter Plot: Marker')
plt.legend()
plt.show()

plt.figure()
plt.scatter(x, y, s, c="g", alpha=0.5, marker='^',
            label="Gold Mark")
plt.xlabel("Years")
plt.ylabel("Gold")
plt.title('Scatter Plot: Marker')
plt.legend()
plt.show()

plt.figure()
plt.scatter(x, y, s, c="r", alpha=0.5, marker='8',
            label="Gold Mark")
plt.xlabel("Years")
plt.ylabel("Gold")
plt.title('Scatter Plot: Marker')
plt.legend()
plt.show()

plt.figure()
plt.scatter(x, y, s, c="g", alpha=0.5, marker='p',
            label="Gold Mark")
plt.xlabel("Years")
plt.ylabel("Gold")
plt.title('Scatter Plot: Marker')
plt.legend()
plt.show()

Output:

输出:

Output is as figure


翻译自: https://www.includehelp.com/python/scatter-symbol.aspx

python无符号转有符号

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值