cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
The Discovery Summit 2025 Call for Content is open! Submit an abstract today to present at our premier analytics conference.
See how to use to use Text Explorer to glean valuable information from text data at April 25 webinar.
Choose Language Hide Translation Bar
View Original Published Thread

Using a script to plot multiple columns

natalie_
Level V

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!