Add filename to data point label in a figure

3 ビュー (過去 30 日間)
Troy Buschbom
Troy Buschbom 2018 年 1 月 23 日
コメント済み: Troy Buschbom 2018 年 2 月 1 日
I have a script that outputs a figure from three variables with thousands of scattered data points. The data comes from multiple (77).csv files. I would like to be able to select any point, using the DATA CURSOR, and see the filename ".csv" from which the data point originated in the label. Currently, when I select the data point, I do see the three variables that make up the X, Y and Z coordinates. (see attached pic) I did not create the script that creates the figure and am a brand new user of Matlab.
  2 件のコメント
Jan
Jan 2018 年 1 月 23 日
What exactly is "output a model"? A "model" can be nearly everything. How do you want to "select" a point? By its index or using the mouse? How is the information available, which file belongs to which point?
Please edit the question and add more details.
Troy Buschbom
Troy Buschbom 2018 年 1 月 23 日
Thank you for the input Jan. I have updated my question and added a graphic.

サインインしてコメントする。

採用された回答

Benjamin Kraus
Benjamin Kraus 2018 年 2 月 1 日
In order to get your datatips to show any information about the filename, you first need some way to determine which file a point was loaded from based on the x/y/z coordinates of the point (and perhaps the identify of the scatter object). To do that you are going to need to know more about how the data is being plotted and stored, but from your question you did not create the script that creates the figure.
Most likely, the figure has no information about where the data came from. You are going to have to look through the script that creates the figure and try to understand how the code works to read the data and then generate the figure. Once you have a basic understanding, you are going to need to modify the script to keep track of a mapping from file name to data point.
Once you are at that point, take a look at the post referred to earlier.
  1 件のコメント
Troy Buschbom
Troy Buschbom 2018 年 2 月 1 日
Thanks Benjamin.

サインインしてコメントする。

その他の回答 (1 件)

Jordy Jose
Jordy Jose 2018 年 1 月 31 日
Hi,
You may refer to the below MATLAB Answers post to learn how to display Custom text for the Data Cursor:
https://www.mathworks.com/matlabcentral/answers/315124-how-do-i-display-custom-text-for-the-data-cursor
  1 件のコメント
Troy Buschbom
Troy Buschbom 2018 年 1 月 31 日
Thanks for your input Jordy! I have already looked at the link and am sure it will be helpful in the future. However, it does not solve my question on how to add the filename from which the data was pulled. Thanks!

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeAnnotations についてさらに検索

製品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by