【科研工具】论文绘图方法

文章介绍了用于制作模型图和实验结果图的一些资源和Python库,如Flaticon、Iconfont.cn以及Matplotlib、Seaborn和Plotly,提供了散点图、折线图和柱状图的代码示例。
摘要由CSDN通过智能技术生成

记录下一些好用的工具,方便以后长期使用。
论文中需要的图主要有两种:

  1. 模型图
  2. 实验结果图

模型图

icon
为了使我们的图看起来逼格更高一点,对于模型图中的icon可以使用一些几个网站

  1. https://www.flaticon.com
    pro版本需要充钱,可以使用free版本,只需要涉及版本时归属于原作者就可以了。
    在这里插入图片描述
  2. https://www.iconfont.cn
    适用于大图标中的小图标,风格多样,可选择性多。
    在这里插入图片描述
    有了icon后可以在ppt中画,或者visio。

实验结果图

可以使用python或者matlab。
Python中有许多绘图库可以用来画实验结果图,其中比较流行的有Matplotlib、Seaborn和Plotly等。
代码示例如:

  1. 散点图:
import matplotlib.pyplot as plt
import numpy as np

def print_hi(name):
    # Use a breakpoint in the code line below to debug your script.
    print(f'Hi, {name}')  # Press Ctrl+F8 to toggle the breakpoint.

# Press the green button in the gutter to run the script.
if __name__ == '__main__':
    # 绘制散点图
    plt.scatter(x, y)

    # 添加标题和标签
    # plt.title('实验结果')
    plt.xlabel('x')
    plt.ylabel('y')

    # 显示图像
    plt.show()

在这里插入图片描述
2. 折线图:

 # 折线图
    # 创建一个数据列表
    x = [1, 2, 3, 4, 5]
    y1 = [1, 3, 2, 4, 5]
    y2 = [2, 4, 3, 5, 6]

    # 绘制折线图
    plt.plot(x, y1, label='Line 1')
    plt.plot(x, y2, label='Line 2')

    # 添加图例和坐标轴标签
    plt.legend()
    plt.xlabel('X Label')
    plt.ylabel('Y Label')

    # 显示图形
    plt.show()

在这里插入图片描述

  1. 柱状图:
# 创建数据
    x = np.array(['A', 'B', 'C', 'D', 'E'])
    y1 = np.array([10, 24, 36, 40, 56])
    y2 = np.array([20, 28, 30, 45, 58])

    # 绘制柱状图
    fig, ax = plt.subplots()
    ax.bar(x, y1, label='Bar 1')
    ax.bar(x, y2, bottom=y1, label='Bar 2')

    # 添加图例和坐标轴标签
    ax.legend()
    ax.set_xlabel('X Label')
    ax.set_ylabel('Y Label')

    # 显示图形
    plt.show()

在这里插入图片描述
可以根据自己的需求进一步设计配色、样式。

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值