Python绘制五颜六色多种颜色组合的表情包

import numpy as np
import matplotlib.pyplot as plt
from matplotlib.markers import MarkerStyle
from matplotlib.transforms import Affine2D
from matplotlib.text import TextPath
from matplotlib.colors import Normalize

SUCCESS_SYMBOLS = [
    TextPath((0, 0), "☹"),
    TextPath((0, 0), "😒"),
    TextPath((0, 0), "☺"),
]

N = 25
np.random.seed(42)
skills = np.random.uniform(5, 80, size=N) * 0.1 + 5
takeoff_angles = np.random.normal(0, 90, N)
thrusts = np.random.uniform(size=N)
successful = np.random.randint(0, 3, size=N)
positions = np.random.normal(size=(N, 2)) * 5
data = zip(skills, takeoff_angles, thrusts, successful, positions)

cmap = plt.colormaps["plasma"]
fig, ax = plt.subplots()
fig.suptitle("Throwing success", size=14)
for skill, takeoff, thrust, mood, pos in data:
    t = Affine2D().scale(skill).rotate_deg(takeoff)
    m = MarkerStyle(SUCCESS_SYMBOLS[mood], transform=t)
    ax.plot(pos[0], pos[1], marker=m, color=cmap(thrust))
fig.colorbar(plt.cm.ScalarMappable(norm=Normalize(0, 1), cmap=cmap),
             ax=ax, label="Normalized Thrust [a.u.]")
ax.set_xlabel("X position [m]")
ax.set_ylabel("Y position [m]")

plt.show()

在这里插入图片描述

SUCCESS_SYMBOLS = [
    TextPath((0, 0), "(∩_∩)"),
    TextPath((0, 0), "(^_^)"),
    TextPath((0, 0), "└(^o^)┘"),
]

在这里插入图片描述

SUCCESS_SYMBOLS = [
    TextPath((0, 0), "😄"),
    TextPath((0, 0), "😁"),
    TextPath((0, 0), "😂"),
]

在这里插入图片描述

cmap = plt.colormaps["Set3"]

在这里插入图片描述

cmap = plt.colormaps["Set1"]

在这里插入图片描述

cmap = plt.colormaps["Set2"]

在这里插入图片描述

cmap = plt.colormaps["ocean"]

在这里插入图片描述

cmap = plt.colormaps["ocean_r"]

在这里插入图片描述

cmap = plt.colormaps["plasma"]

在这里插入图片描述

cmap = plt.colormaps["plasma_r"]

在这里插入图片描述

cmap = plt.colormaps["prism"]

在这里插入图片描述

cmap = plt.colormaps["prism_r"]

在这里插入图片描述

cmap = plt.colormaps["rainbow"]

在这里插入图片描述

cmap = plt.colormaps["rainbow_r"]

在这里插入图片描述

cmap = plt.colormaps["seismic"]

在这里插入图片描述

cmap = plt.colormaps["seismic_r"]

在这里插入图片描述

cmap = plt.colormaps["spring"]

在这里插入图片描述

cmap = plt.colormaps["spring_r"]

在这里插入图片描述

cmap = plt.colormaps["summer"]

在这里插入图片描述

cmap = plt.colormaps["summer_r"]

在这里插入图片描述

cmap = plt.colormaps["tab10"]

在这里插入图片描述

cmap = plt.colormaps["tab10_r"]

在这里插入图片描述

cmap = plt.colormaps["tab20"]

在这里插入图片描述

cmap = plt.colormaps["tab20_r"]

在这里插入图片描述

cmap = plt.colormaps["tab20b"]

在这里插入图片描述

cmap = plt.colormaps["tab20b_r"]

在这里插入图片描述

cmap = plt.colormaps["tab20c"]

在这里插入图片描述

cmap = plt.colormaps["tab20c_r"]

在这里插入图片描述

cmap = plt.colormaps["terrain"]

在这里插入图片描述

cmap = plt.colormaps["terrain_r"]

在这里插入图片描述

cmap = plt.colormaps["twilight"]

在这里插入图片描述

cmap = plt.colormaps["twilight_r"]

在这里插入图片描述

cmap = plt.colormaps["twilight_shifted"]

在这里插入图片描述

cmap = plt.colormaps["twilight_shifted_r"]

在这里插入图片描述

cmap = plt.colormaps["viridis"]

在这里插入图片描述

cmap = plt.colormaps["viridis_r"]

在这里插入图片描述

cmap = plt.colormaps["winter"]

在这里插入图片描述

cmap = plt.colormaps["winter_r"]

在这里插入图片描述

参考文献:https://matplotlib.org/stable/gallery/lines_bars_and_markers/multivariate_marker_plot.html#sphx-glr-gallery-lines-bars-and-markers-multivariate-marker-plot-py
百度搜索:表情符号大全
开发工具:PyCharm和微信Alt+A截屏工具

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值