Why is there no DataIndex field in cursor_info for scatter plots?

Illustration
arundsouza - 2020-08-17T12:21:01+00:00
Question: Why is there no DataIndex field in cursor_info for scatter plots?

Export cursor data to the workspace using the following steps: 1. Generate a scatter plot using the following code:   [x, y] = meshgrid (0: 0.1: 1.0: .1: 1); scatter(x(:), y(:),10) 2. Add a few data cursors on the figure. 3. Right-click on the figure and select the ‘Export Cursor Data to Workspace’ option. The "cursor_info" structure appears in the workspace. This structure has sub-structures corresponding to each data cursor on the plot. I see that each of these sub-structures has two fields: ‘Target’ and ‘Position’. However, for a plot generated using the PLOT function (e.g., x1 = [1 2 3]; y1 = [4 5 6]; plot(x1,y1);), I find that the corresponding data cursor structures have three fields: ‘Target’, ‘Position’ and ‘DataIndex’. Note the additional 'DataIndex' field for data cursors in the latter case. Why is there no such 'DataIndex' field in cursor_info for scatter plots?

Expert Answer

Profile picture of John Williams John Williams answered . 2025-11-20

The 'DataIndex' field is created in the "cursor_info" structure only when data cursors are added to line objects.
This field does not exist for images, surfaces, or any other object.


Not satisfied with the answer ?? ASK NOW

Get a Free Consultation or a Sample Assignment Review!