How do I add a tag properly with this script?

I'm trying to add a tag to my graph as part of a script, however every time it runs instead of adding a tag it adds a textbox. I assume this is an easy fix, however whenever I scour the internet I can't find anything to help, so any help here is appreacited!

Textbox instead of tag

Hi,

At first glance it does not appear that you are giving a wave name and point for the attachment in the tag command.

// Tag command with all optional parameters included
Tag/N=tag0 wave0, 0, "Point 0 on wave0"    // Add a tag to a trace

Andy

Thanks for your quick response Andy! I understand what you mean and I fixed it, however now I get the error "While executing Tag, the following error occurred: trace is not on graph". Does this mean the point I selected doesn't actually exist on my graph? If it helps at all, I selected point 50000 because that corresponds to about the 163 mark on my x-axis which is the point I'm trying to label. Sorry for the dumb questions!

It would be helpful if you posted the command you're trying to use. But I'll take a guess-

Tag/C/N=text0/F=1 $NameOfWave(wave1),50000,"This is my tag"

A frequent point of confusion- a trace is not a wave, so you can't simply use "wave1" since that is a wave reference variable pointing to a wave. This command makes the assumption that there is no reason for the trace to be "wave1#1" or something like that. The code you posted has just the one trace, so this should be safe.