How to Continually Update Text on a Plain Figure Environment in Matlab?

  • Context: MATLAB 
  • Thread starter Thread starter rsq_a
  • Start date Start date
  • Tags Tags
    Matlab Plot Text
Click For Summary
SUMMARY

The discussion focuses on displaying continually updated text in a plain figure environment using MATLAB. The user seeks to show updated numbers without a visible plot, utilizing the 'figure' and 'text' functions. The proposed solution involves setting the axes visibility to 'off' and using a loop to update the text. The correct implementation is crucial for achieving the desired output of a clean gray figure window with dynamic text updates.

PREREQUISITES
  • Familiarity with MATLAB programming
  • Understanding of figure and axes properties in MATLAB
  • Knowledge of the 'text' function for displaying text in figures
  • Basic loop structures in MATLAB
NEXT STEPS
  • Explore MATLAB's 'set' function for modifying figure properties
  • Learn about the 'cla' function for clearing axes in MATLAB
  • Investigate advanced text formatting options in MATLAB figures
  • Research performance optimization techniques for real-time updates in MATLAB
USEFUL FOR

MATLAB users, data visualizers, and engineers looking to create dynamic visual representations without traditional plotting elements.

rsq_a
Messages
103
Reaction score
1
I want to be able to display continually updated numbers on a plain figure environment. For example, a cheap way to do this is:

Code:
figure(1)
for j = 1:10
  title([ 'Hello'; num2str(j) ])
end

This prints out a two-liner ('Hello' and a number) in the title portion of the figure.

I want the same thing, but with no actual white plot. In other words, I just want the gray figure window, and updated figures.

How would I do this?
 
Physics news on Phys.org
Something like to following

Code:
figure(1)
set(gca,'Visible','off')

for j=1:10
  text(0,0,num2str(j)
  cla
end


should work
 

Similar threads

  • · Replies 9 ·
Replies
9
Views
5K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 1 ·
Replies
1
Views
5K
  • · Replies 2 ·
Replies
2
Views
3K
Replies
3
Views
2K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
Replies
2
Views
3K