Solving MATLAB Problem: Mark an X or Cross on a Plot

  • Context: MATLAB 
  • Thread starter Thread starter sstefan1
  • Start date Start date
  • Tags Tags
    Matlab
Click For Summary
SUMMARY

To mark an X or cross on a plot in MATLAB, utilize the "scatter" function. Specifically, the command scatter(a,b,'x') places a cross at the coordinates (a,b) on the current 2D plot. The "hold on" command is essential to ensure that the cross is added to the existing plot without erasing it. Further details about the plot type or the specific point to be marked may refine the solution.

PREREQUISITES
  • Familiarity with MATLAB programming environment
  • Understanding of 2D plotting in MATLAB
  • Knowledge of MATLAB functions such as "scatter" and "hold on"
  • Basic coordinate system concepts
NEXT STEPS
  • Explore MATLAB's "scatter" function documentation for additional options
  • Learn about customizing plot markers in MATLAB
  • Investigate the use of "hold on" and "hold off" commands in MATLAB plotting
  • Research advanced plotting techniques in MATLAB for complex visualizations
USEFUL FOR

MATLAB users, data analysts, and researchers looking to enhance their data visualization skills by marking specific points on plots.

sstefan1
Messages
4
Reaction score
0
hi everyone!

I need to mark an X or a cross on a plot at a specific x-value. Any ideas how i can do this?

Thank you!
 
Physics news on Phys.org
You can use the "scatter" function to put a cross on an existing 2D plot, eg.

hold on
scatter(a,b,'x')

This will put a lone cross at the coordinate (a,b) on the current plot.

I can't be more specific without knowing the kind of plot you're drawing or the nature of the point to be marked.
 

Similar threads

  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 4 ·
Replies
4
Views
4K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 32 ·
2
Replies
32
Views
4K
  • · Replies 1 ·
Replies
1
Views
5K