MATLAB Multiple Data Cursors in Figure

Click For Summary
SUMMARY

This discussion focuses on creating synchronized data cursors in MATLAB figures, specifically using the datacursormode function. Users seek methods to automatically align data cursors across multiple curves based on the x-axis values, thereby streamlining the process of analyzing multiple datasets. The conversation references a GitHub repository containing a script for dual cursors, which may provide a solution to the outlined challenges.

PREREQUISITES
  • Familiarity with MATLAB plotting functions
  • Understanding of datacursormode functionality
  • Basic knowledge of MATLAB scripting
  • Experience with GitHub for accessing shared code
NEXT STEPS
  • Explore the datacursormode documentation in MATLAB
  • Examine the GitHub repository for the dual cursor script
  • Research techniques for linking data cursors in MATLAB
  • Investigate MATLAB's event handling for custom cursor behavior
USEFUL FOR

This discussion is beneficial for MATLAB users, data analysts, and researchers who frequently work with multiple datasets and require efficient methods for data visualization and analysis.

DoubleHubble
Messages
8
Reaction score
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

Similar threads

  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 9 ·
Replies
9
Views
4K
  • · Replies 12 ·
Replies
12
Views
4K
  • · Replies 3 ·
Replies
3
Views
4K
Replies
2
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
Replies
1
Views
3K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 10 ·
Replies
10
Views
3K
  • · Replies 4 ·
Replies
4
Views
1K