BookmarkSubscribe
Choose Language Hide Translation Bar
Community Trekker

## Overlay Plot Scripts

Hi all,

I have a quest about changing the scripts of an overlay plot.  Say I have a for loop that creates a new plot on each iteration.  Each iteration updates a string variable which is the name of the next column to plot.

What syntax do I use to change the column?  I copied the script from an overlay plot that I made.   Instead of using :Name("0V"), I tried using :AsColumn(xCol), but I had no luck.  Any suggestions?

for(k=2, k<=2, k++,

xCol = Column(dtSummary, k);

yCol = Column(dtSummary, k+65);

ov = dtSummary << (Overlay Plot( X( :Name( "0V" ) ), Y( :RP_0V ), Sort X( 0 ), Separate Axes( 1 ) ))

);

1 ACCEPTED SOLUTION

Accepted Solutions
Super User

## Re: Overlay Plot Scripts

This approach will work.  Use a table variable and the column(<table>, <column-name>) construct:

dt = open("\$sample_data\Car Physical Data.jmp");

xcol = "Turning Circle";

ycol = "Weight";

Overlay Plot( X( column(dt, xcol) ), Y( column(dt, ycol) ), Separate Axes( 1 ) );

3 REPLIES 3
Community Trekker

## Re: Overlay Plot Scripts

I changed my code so that it wouldn't have :Name, but still, no luck getting it to work.

for(k=2, k<=2, k++,

xCol = "_"||Char((k-2)*10)||"V";

yCol = Column(dtSummary, k+65);

Overlay Plot( X( :_0V ), Y( :RP_0V ), Sort X( 0 ), Separate Axes( 1 ) )

);

Super User

## Re: Overlay Plot Scripts

This approach will work.  Use a table variable and the column(<table>, <column-name>) construct:

dt = open("\$sample_data\Car Physical Data.jmp");

xcol = "Turning Circle";

ycol = "Weight";

Overlay Plot( X( column(dt, xcol) ), Y( column(dt, ycol) ), Separate Axes( 1 ) );

Highlighted
Community Trekker

## Re: Overlay Plot Scripts

Thank you very much!