I think you are using MATLAB R2019a.
After plotting the figure, click on Data Tips option in the top right corner of the plot area (Refer the image below).
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/235073/image.png)
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!