Subscribe Bookmark RSS Feed

Overlay Plot Scripts

natalie_

Community Trekker

Joined:

Jan 6, 2016

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
Solution

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
natalie_

Community Trekker

Joined:

Jan 6, 2016

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 ) )

  );

Solution

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 ) );

natalie_

Community Trekker

Joined:

Jan 6, 2016

Thank you very much!