简体   繁体   English

获取在python中不同散点图区域绘制的点数据

[英]To get data of points plotted in different area of scatter plots in python

I have created a scatter plot for a fantasy league for different players between 'players cost' and 'fantasy points'. 我为“玩家成本”和“幻想点”之间的不同玩家创建了幻想联盟的散点图。 Now I want to get the information (like Name,age,team,etc) of the data points on the left side of the green vertical line and more specifically at North-West part of the graph. 现在我想获得绿色垂直线左侧数据点的信息(如姓名,年龄,团队等),更具体地说,是图表的西北部分。 Is there any function "get" to get information the data points. 是否有任何函数“获取”来获取数据点的信息。

Image desription: Normal scatter plot with two vertial lines v1 at x=6 and v2 at x = 10. I want to get information of datapoints plotted on left of v1 from the plot 图像描述:正常散点图,在x = 6处有两条垂直线v1,在x = 10处有v2。我想从图中获得在v1左边绘制的数据点的信息

Following is the code i wrote to draw this scatter plot 以下是我写的用于绘制此散点图的代码

x = dataset.loc[:,"Cost"]
y = datasetloc[:,"Points"]
plt.figure(figsize = (20,10))
plt.scatter(x,y,size =100,marker = '*',color = 'b',alpha = 0.8,edgeolors 
= 'white')
plt.xlabel("Indiidual Players Cost")
plt.ylabel("Fantasy Points")
plt.title("Players Cost Vs Fantasy Points")
plt.show()

You will want to access information directly from your dataset. 您需要直接从数据集中访问信息。

nw = dataset[(dataset.Cost <= 6) & (dataset.Points >= 0)]
ne = dataset[(dataset.Cost >= 6) & (dataset.Points >= 0)]
sw = dataset[(dataset.Cost <= 6) & (dataset.Points <= 0)]
se = dataset[(dataset.Cost >= 6) & (dataset.Points <= 0)]

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

相关问题 如何在python中的散点图中平滑数据点? - How to smooth data points in scatter plots in python? 单击 Plotly 散点图中的数据点时打开 URL [Python] - Open URL when clicking on data points in Plotly scatter plots [Python] pylab三维散点图,绘制数据的2d投影 - pylab 3d scatter plots with 2d projections of plotted data 不同参数的多个散点图 - Python - Multiple Scatter Plots for different parameters - Python 在matplotlib中重置已绘制散点的点 - resetting points of an already plotted scatter in matplotlib 如何计算python 2D散点占用面积 - How to calculate python 2D scatter points occupied area 使用python为散点图中的数据点着色 - colouring data points in a scatter plot using python 使用matplotlib.pyplot.plot()在图例中为在Python的指定bin中绘制的一系列不同数据点添加单个标签 - Adding a single label to the legend for a series of different data points plotted inside a designated bin in Python using matplotlib.pyplot.plot() 如何使用plotly python中的下拉按钮更新多个散点图的数据? - How to update data of multiple scatter plots with dropdown buttons in plotly python? 如何为 python 中的每个数据生成单独的散点图? - How to produce separate scatter plots for each data in python?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM