In order to use strings on y axis they must be convertable tonnumeric or encodeable as orderable numeric. You have multiple distinct columns, a different quantity per row, and the strings have no obvious numeric representation. How does
Inside the callback, get axes CurrentPoint. Extract the x from that and find the closest x in the data. Use that to pull out the strings from the table. Return a cell array of character vectors; each entry will become a separate line in the datatip shown.
I am not going to do an implementation for you, as the result is going to look pretty poor. With that data, I believe that the kind of graph that is being proposed is nearly meaningless.
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
5 Comments
Direct link to this comment
https://au.mathworks.com/matlabcentral/answers/474537-how-to-plot-date-on-x-axis-and-string-on-y-axis-text-annonation-on-data-points#comment_730993
Direct link to this comment
https://au.mathworks.com/matlabcentral/answers/474537-how-to-plot-date-on-x-axis-and-string-on-y-axis-text-annonation-on-data-points#comment_730993
Direct link to this comment
https://au.mathworks.com/matlabcentral/answers/474537-how-to-plot-date-on-x-axis-and-string-on-y-axis-text-annonation-on-data-points#comment_731054
Direct link to this comment
https://au.mathworks.com/matlabcentral/answers/474537-how-to-plot-date-on-x-axis-and-string-on-y-axis-text-annonation-on-data-points#comment_731054
Direct link to this comment
https://au.mathworks.com/matlabcentral/answers/474537-how-to-plot-date-on-x-axis-and-string-on-y-axis-text-annonation-on-data-points#comment_731279
Direct link to this comment
https://au.mathworks.com/matlabcentral/answers/474537-how-to-plot-date-on-x-axis-and-string-on-y-axis-text-annonation-on-data-points#comment_731279
Direct link to this comment
https://au.mathworks.com/matlabcentral/answers/474537-how-to-plot-date-on-x-axis-and-string-on-y-axis-text-annonation-on-data-points#comment_731529
Direct link to this comment
https://au.mathworks.com/matlabcentral/answers/474537-how-to-plot-date-on-x-axis-and-string-on-y-axis-text-annonation-on-data-points#comment_731529
Direct link to this comment
https://au.mathworks.com/matlabcentral/answers/474537-how-to-plot-date-on-x-axis-and-string-on-y-axis-text-annonation-on-data-points#comment_790666
Direct link to this comment
https://au.mathworks.com/matlabcentral/answers/474537-how-to-plot-date-on-x-axis-and-string-on-y-axis-text-annonation-on-data-points#comment_790666
Sign in to comment.