The easiest way to display values ​​as symbols in a scatter plot?

In response to my earlier question regarding color space correction for scattered images of 4D data, Tom10 suggested displaying the values ​​as characters to double-check my data. Great Idea In the past, I ran a few demos like this, but I can’t find a demo which, as I recall, was pretty simple.

So, what is the easiest way to plot numerical values ​​as a symbol in a scatter chart instead of an "o", for example? Tom10 suggested plt.txt (x, y, value) - and this is the implementation used in a number of examples. However, I am wondering if there is an easy way to evaluate the “value” from my array of numbers? Can one simply say: str (valuearray)?

Do you need a loop to evaluate values ​​for graphing, as suggested in the matplotlib demo section for 3D scatter plots ?

Their example produces:

alt text
(source: sourceforge.net )

However, they do something quite complicated in estimating locations, as well as in changing the direction of text based on data. So, is there a nice way to build x, y, C data (where C is the value often used as the color on the data- graph, but instead I want to make a symbol)?

Again, I think we have an honest answer to this-. I'm just wondering if there is an easier way?

+3
source share
1

, , :

for x, y, val in zip(x_array, y_array, val_array):
    plt.text(x, y, val)

, , str (valarray), , , , , . ,

valarray.astype(str)

numpy,

[str(v) for v in valarray]

Python. valarray plt.text .

+2

Source: https://habr.com/ru/post/1748089/


All Articles