Subscribe Bookmark RSS Feed

Using a script to plot multiple columns

natalie_

Community Trekker

Joined:

Jan 6, 2016

Hi Everyone,

I have a data table with several columns.  The first column in my x-axis, and the rest of the columns are my y-values.  I have done this before, but all the column names were numbers, or didn't have any spaces.  Now they do, and my code is not working.  How can I edit this code to get my plot?

y_cols = dtIdleak << get column names(string,character);

  Remove From(y_cols,1);

  dtIdleak << Overlay Plot(X(:Vd_V),Y(:(Eval(y_cols))),

  Overlay Axis << {{Min( 0.01 ), Max( 100 ), Inc( 1 ), Minor Ticks( 1 )}},

  Connect Points(1),

  SendToReport(

  Dispatch(

  {},

  "102",

  ScaleBox,

  {Scale("Log"),Min( 0.01 ), Max( 1000 ), Inc( 1 ), Minor Ticks( 1 )}

  ),

  Dispatch( {}, "", AxisBox, {Add Axis Label( "Idleak (uA)" )} ),

  Dispatch( {}, "Y", TextEditBox, {Set Text( "Idleak (uA)" )} ),

  Dispatch( {}, "Overlay Plot Graph", FrameBox, {Frame Size( 740, 585 )} )

  )

)

1 ACCEPTED SOLUTION

Accepted Solutions
Solution

Ok, the names should not matter if you use <<get column names() ​without the "string" option.

And Change Y(:(Eval(y_cols))) into Y(Eval(y_cols))

4 REPLIES
ms

Super User

Joined:

Jun 23, 2011

Overlay plot require numeric Y's.

Try <<get column names(numeric);

instead of <<get column names(string,character);

natalie_

Community Trekker

Joined:

Jan 6, 2016

Unfortunately, that did not work.

The first column (the x values) is labeled "Vd_V", and then the subsequent columns (the y values) have a name like "x= 1 y= 1 Site 1". 

Solution

Ok, the names should not matter if you use <<get column names() ​without the "string" option.

And Change Y(:(Eval(y_cols))) into Y(Eval(y_cols))

natalie_

Community Trekker

Joined:

Jan 6, 2016

Thank you so much!