cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Submit your abstract to the call for content for Discovery Summit Americas by April 23. Selected abstracts will be presented at Discovery Summit, Oct. 21- 24.
Discovery is online this week, April 16 and 18. Join us for these exciting interactive sessions.
Choose Language Hide Translation Bar
natalie_
Level V

Using a script to plot multiple columns

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
ms
Super User (Alumni) ms
Super User (Alumni)

Re: Using a script to plot multiple columns

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

View solution in original post

4 REPLIES 4
ms
Super User (Alumni) ms
Super User (Alumni)

Re: Using a script to plot multiple columns

Overlay plot require numeric Y's.

Try <<get column names(numeric);

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

natalie_
Level V

Re: Using a script to plot multiple columns

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". 

ms
Super User (Alumni) ms
Super User (Alumni)

Re: Using a script to plot multiple columns

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_
Level V

Re: Using a script to plot multiple columns

Thank you so much!