Label data points on plot

How about print (x, y) at once. from matplotlib import pyplot as plt fig = plt.figure() ax = fig.add_subplot(111) A = -0.75, -0.25, 0, 0.25, 0.5, 0.75, 1.0 B = 0.73, 0.97, 1.0, 0.97, 0.88, 0.73, 0.54 ax.plot(A,B) for xy in zip(A, B): # <– ax.annotate(‘(%s, %s)’ % xy, xy=xy, textcoords=”data”) # <– ax.grid() plt.show()

How to fix overlapping annotations / text

I just wanted to post here another solution, a small library I wrote to implement this kind of things: https://github.com/Phlya/adjustText An example of the process can be seen here: Here is the example image: import matplotlib.pyplot as plt from adjustText import adjust_text import numpy as np together = [(0, 1.0, 0.4), (25, 1.0127692669427917, 0.41), (50, … Read more

Label python data points on plot

How about print (x, y) at once. from matplotlib import pyplot as plt fig = plt.figure() ax = fig.add_subplot(111) A = -0.75, -0.25, 0, 0.25, 0.5, 0.75, 1.0 B = 0.73, 0.97, 1.0, 0.97, 0.88, 0.73, 0.54 ax.plot(A,B) for xy in zip(A, B): # <– ax.annotate(‘(%s, %s)’ % xy, xy=xy, textcoords=”data”) # <– ax.grid() plt.show()

Scatter plot with different text at each data point

I’m not aware of any plotting method which takes arrays or lists but you could use annotate() while iterating over the values in n. import matplotlib.pyplot as plt y = [2.56422, 3.77284, 3.52623, 3.51468, 3.02199] z = [0.15, 0.3, 0.45, 0.6, 0.75] n = [58, 651, 393, 203, 123] fig, ax = plt.subplots() ax.scatter(z, y) … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)