I want to write a function which will plot a chart using a specific set of parameters, and then call it multiple times as in the simple example below. This example doesn't actually work however, presumably because the "X" that I'm referencing inside the graph box is local to the "myplot" function. What is the easiest way I could modify the following so that it would work as I intend, i.e. the letters "A", "B", "C" and "D" should be written inside each of the four charts respectively?
myplot1 = Function( {X},
gb = Graph Box(
FrameSize( 100, 100 ),
X Scale( 0, 10 ),
Y Scale( 0, 100 ),
Text( center justified, {5, 50}, X )
)
);
nw1 = New Window( "Four Charts",
Lineup Box( N Col( 2 ), myplot1( "A" ), myplot1( "B" ), myplot1( "C" ), myplot1( "D" ) )
);
Many thanks