Hi Alyssa,
I'm not sure exactly what you are trying to do. The simplest thing would be to use the Data Cursor in your plot: Clicking on a node will display its name, and you can then compute the shortest path between two nodes from command line.
Using ginput, you would need to find the node index of the node closest to the selected mouse coordinates. Does this code do what you are looking for?
g = graph(bucky);
p = plot(g);
[x, y] = ginput(2);
[~, srcid] = min(hypot(x(1) - p.XData, y(1) - p.YData))
[~, tarid] = min(hypot(x(2) - p.XData, y(2) - p.YData))
shortestpath(graph(bucky), srcid, tarid)
