MATLAB Multiple Data Cursors in Figure

In summary, the conversation discusses the possibility of creating a data cursor on one curve that automatically creates a data cursor at the same x-axis value for the other curve without manually lining them up, and the potential solution of using datacursormode or a third-party script like dualcursor.m. The individual also mentions having multiple curves and subplots, and the desire to minimize the time spent creating and aligning data cursors.
  • #1
DoubleHubble
9
0
Say I command the following simple script:

figure; plot([1:12],[1:12],[1:12],[4:15])'

1. How can I create a data cursor on one curve that automatically creates a data cursor at the same x-axis value for the other curve without having to manually create (Alt-Click, then line up) a second Datatip?

2. Is there a way to drag one Datatip left and right and have all other Datatips drag left and right by the respective amount (i.e. link the data cursors together by the x-axis)?

The reason I ask is because I have six different curves per subplot (of which I have 3) per figure (of which I have 12) and I would like to minimize the time spent creating and lining up all of the data cursors in each figure.

Feel free to answer one or both of the questions. I feel they are closely related, and if you know the answer to one, you may know the answer to the other - hence my including them in the same thread.
 
Physics news on Phys.org

1. What is the purpose of multiple data cursors in a MATLAB figure?

Multiple data cursors in a MATLAB figure allow you to view and analyze multiple data points at once. This can be useful for comparing data sets or identifying specific points of interest.

2. How do I add multiple data cursors to a figure in MATLAB?

To add multiple data cursors to a figure in MATLAB, you can use the datacursormode function. First, select the data points you want to add cursors to by clicking on them. Then, use the datacursormode on command to turn on the data cursor mode. You can then click on the data points again to add cursors to them.

3. Can I customize the appearance of multiple data cursors in MATLAB?

Yes, you can customize the appearance of data cursors in MATLAB by using the datacursormode function. This allows you to change the color, shape, and size of the cursors, as well as add labels or annotations to them.

4. How do I delete a data cursor from a MATLAB figure?

To delete a data cursor from a MATLAB figure, you can use the datacursormode off command. This will turn off data cursor mode and remove all cursors from the figure. Alternatively, you can click on a cursor and press the "Delete" key on your keyboard.

5. Can I use multiple data cursors in 3D plots in MATLAB?

Yes, you can use multiple data cursors in 3D plots in MATLAB. However, it may be more difficult to select and add cursors to specific data points in a 3D plot compared to a 2D plot. You can also use the datacursormode toggle command to switch between selecting data points and selecting cursors in a 3D plot.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
140
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
9
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
122
  • MATLAB, Maple, Mathematica, LaTeX
Replies
12
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
885
  • MATLAB, Maple, Mathematica, LaTeX
Replies
10
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
8
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
1K
Back
Top