plt.plot设置横纵坐标
时间: 2023-08-27 19:11:26 浏览: 197
引用中的代码展示了如何使用plt.plot函数设置横纵坐标。在这个例子中,cap1_x作为x轴坐标,cap2_y和cap3_y分别作为两条折线的y轴坐标。通过调用plt.plot(cap1_x, cap2_y, color='r', label="ATT-RLSTM")和plt.plot(cap1_x, cap3_y, color='g', label="CNN-RLSTM")可以分别绘制出红色和绿色的折线图。
需要注意的是,plt.plot函数的第一个参数是x轴坐标数据,第二个参数是y轴坐标数据。你可以根据自己的需求,将具体的数据替换到这个函数中来设置横纵坐标。<em>1</em><em>2</em><em>3</em>
#### 引用[.reference_title]
- *1* [Python画图如何显示各点横纵坐标(x, y)?](https://blog.csdn.net/qq_54528857/article/details/125249712)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}} ] [.reference_item]
- *2* [python plot绘制折线图,自定义横坐标间距、竖向显示大小](https://blog.csdn.net/qq_45758854/article/details/125636478)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}} ] [.reference_item]
- *3* [pyplot设置坐标间距、图中每个点设置相应数值](https://blog.csdn.net/ProgrammersFighting/article/details/124573859)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}} ] [.reference_item]
[ .reference_list ]
阅读全文