![]() This can be done by changing the position, size etc. It would be aesthetically more pleasing if the text could be wrapped within the plot’s canvas. However, we can observe that a few text boxes are jutting out of the figure area. We have completed constructing a labelled scatter plot. Scatter Plot with all labels (Image by author) Final Touch It can also be grouped within fontdict to make your code easy to read and understand. plt.text(df.G,df.GA,"TOT", color='red')Īdditional arguments like color, size, alpha(transperency) etc. x, y and s are positional arguments and need not be explicitly mentioned if their order is followed. He x and y are Goals scored and Goals conceded by TOT respectively. ![]() I can add the label using plt.text() Syntax: plt.text(x=x coordinate, y=y coordinate, s=string to be displayed) Coming to our dataset, I am a Totenham Hotspur(TOT) fan and am interested only in the performance of TOT against the other teams. It would be useful if USA’s and other selected competitors data is labelled so that we can understand how these countries are performing with respect to each other and rest of the world. For example, if we are examining a socio-economic statistic of USA, it makes no sense to display the labels of all countries in scatter plot. Labelling all the data points may render your plot too clunky and difficult to comprehend. Most often scatter plots may contain large amount of data points, we might be interested how some specific items fare against the rest.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |