2
votes

I'm an Octave noob but I'm trying to display a graph at the same time as an input in the terminal however the graphics only update after the input therefore I get an unloaded graph:

enter image description here

This is the code:

 f=figure;
 imshow(img);

 pause(1); % FIX THIS!

 in=input('Input required:', 's');

Pausing for 1 second is sketchy because it doesn't always the graph but without a pause it doesn't even enter the graphics loop. Is there someway to block until the graph is loaded before continuing? I wasn't able to find the required function in the documentation.

1

1 Answers

3
votes

You can use drawnow to force the graphics to render and the event queue to be flushed.

f = figure();
imshow(img);

drawnow

in = input('Input required:', 's');