I have been trying to do this by myself, but I don't know where to start.
I know how to select the desired plot (if there are several plotted lines), but I have been unable to get the coordinates from there; no Get command seems to do the trick.
I would also like to draw a line from those coordinates down to the beginning of Y axis. If I have understood things correctly, the script for this last part would be:
int coordx = 10;
int coordy = 5000;
int yfrom = layer.y.from;
draw -d 2 -l {coordx,coordy,coordx,yfrom};
Where the values of coordx and coordy would be the coordinates extracted in the first part.
I am sure this is already explained somewhere, but I simply couldn't find where (I might not have been using the right keywords in my search). How can I get the coordinates from a specific index/row in a plot?
EDIT: I got it.
//%(dataplot,@L for x or @V for y, row number)
layer -c; //Count the number of plots in the layer and add that number in the variable named "count"
double lay = count; //Assign a variable name to the plot where the label/dropline will be (in this case, the last one)
double Coordx = %(lay, @L, 125); //Get the X coordinate for the point number 125 in that plot
double Coordy = %(lay, @V, 125); //Get the Y coordinate for the point number 125 in that plot
double yStack = 11000; //If your plots are stacked, type the distance between each plot (only for constant distances)
double Totaly = (lay-1)*yStack+Coordy; //Total Y value is the coordinate + stacking space
double yfrom = layer.y.from;
double LabelOffset = 2000; //Label offset so that the text doesn't fall directly on the plot line
draw -d 2 -l {Coordx,Totaly,Coordx,yfrom}; //Draw a dashed line
label -n Pointlabel Text; //Create a label named Pointlabel with the message "Text"
Pointlabel.x = Coordx; //Place the label in the right coordinates.
Pointlabel.y = Totaly+LabelOffset;
