Graph Size

Hi there!

I have a little problem when changing the size of an Image. 

When I apply the following code using the command line

NewImage/N=MyGraph MyWave
ModifyGraph/W=MyGraph width=150,height=50
ModifyGraph/W=MyGraph width = 0, height = 0

I get the expected result: the size of the graph i set to 150 by 50, which I can modify afterwards using the mouse. 

However, when I apply the same code inside a function, I get the "automatic" values of the size, as if I only put the last line of the code.

Is there any solutions?

 

Best regards

Put a call to DoUpdate between the two ModifyGraph calls. When you execute these commands on the command line, an automatic re-draw happens between the two commands. Mostly, those redraws are suppressed while running a user function. Certain data structures are only updated when the graph redraws, which is why these commands work differently in your function.