0

I have this function:

def draw(LuxCoordinates, finalPix, verName, GraphNum):
    plt.axes([0.2, 0.2, 0.7, 0.6]);

    plt.xlim(0,3500);
    plt.ylim(0,100);

    if GraphNum == 1:
        plt.plot(LuxCoordinates, finalPix, 'r');
    if GraphNum == 2:
        plt.plot(LuxCoordinates, finalPix, 'g');  
    if GraphNum == 3:
        plt.plot(LuxCoordinates, finalPix, 'b');    

    plt.scatter(LuxCoordinates, finalPix, linewidths=1)
    plt.grid(axis)
    plt.xlabel('Ambient', color='r');
    plt.ylabel('Depth Grows', color='r'); # grayscale color
    plt.title(PngName, color='#afeeee');
    savefig(PngName+'.png');

I'm calling to this function 1,2 or 3 times.

according to the number of calls I draw graphs on the same plot (I'm doing the plt.show() after I finished all calls.) each graph in different color. On each graph I mark the dots in a little circle with plt.scatter(LuxCoordinates, finalPix, linewidths=1).

Now I want to write near each dot, the values of x and y (LuxCoordinates, finalPix) How can I do it? Thanks!

shlomi
  • 523
  • 3
  • 13
  • 26

1 Answers1

0

You could use plt.annotate. Here is an example of its use.

See also the Guide and the Intro for a review of the many options.

Community
  • 1
  • 1
unutbu
  • 842,883
  • 184
  • 1,785
  • 1,677