简体   繁体   English

如何在 Matplotlib 中将列表可视化为 x 轴?

[英]How to visualize lists as x-axis in Matplotlib?

Say I have two lists:假设我有两个列表:

xlst = [[1,2,3],[2,3,5],[3,1,2],[2,5,3],[3,0,1]]
ylst = [0.25,0.22,0.35,0.37,0.17]

I have this kind of data because the lists in xlist are given by 3D coordinates.我有这种数据,因为 xlist 中的列表是由 3D 坐标给出的。 Now I want to train a machine learning model using xlst as features and ylst as labels.现在我想使用 xlst 作为特征和 ylst 作为标签来训练机器学习模型。 To visualize data, I need to plot xlst as x-axis and ylst as y-axis in a same graph using Matplotlib.为了可视化数据,我需要使用 Matplotlib 在同一个图中将 xlst 绘制为 x 轴,将 ylst 绘制为 y 轴。 How should I do it to make the graph comprehensible?我应该如何做才能使图表易于理解?

Say I have two lists:假设我有两个列表:

xlst = [[1,2,3],[2,3,5],[3,1,2],[2,5,3],[3,0,1]]
ylst = [0.25,0.22,0.35,0.37,0.17]

I have this kind of data because the lists in xlist are given by 3D coordinates.我有这种数据,因为 xlist 中的列表是由 3D 坐标给出的。 Now I want to train a machine learning model using xlst as features and ylst as labels.现在我想使用 xlst 作为特征和 ylst 作为标签来训练机器学习模型。 To visualize data, I need to plot xlst as x-axis and ylst as y-axis in a same graph using Matplotlib.为了可视化数据,我需要使用 Matplotlib 在同一个图中将 xlst 绘制为 x 轴,将 ylst 绘制为 y 轴。 How should I do it to make the graph comprehensible?我应该如何做才能使图表易于理解?

Say I have two lists:假设我有两个列表:

xlst = [[1,2,3],[2,3,5],[3,1,2],[2,5,3],[3,0,1]]
ylst = [0.25,0.22,0.35,0.37,0.17]

I have this kind of data because the lists in xlist are given by 3D coordinates.我有这种数据,因为 xlist 中的列表是由 3D 坐标给出的。 Now I want to train a machine learning model using xlst as features and ylst as labels.现在我想使用 xlst 作为特征和 ylst 作为标签来训练机器学习模型。 To visualize data, I need to plot xlst as x-axis and ylst as y-axis in a same graph using Matplotlib.为了可视化数据,我需要使用 Matplotlib 在同一个图中将 xlst 绘制为 x 轴,将 ylst 绘制为 y 轴。 How should I do it to make the graph comprehensible?我应该如何做才能使图表易于理解?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM