Perspective Box and Whisker Plot

Pedant hat on:

Nope. 2.5, 5.0, 7.5 with eleven elements. Make it twelve elements and you'll match.

Well, not quite. In your case, 2.75 is closer to 3, so myList[3] should be weighted proportionally more: q1 = (0.25*myList[2]+0.75*myList[3])

system.math.percentile() appears to be getting this wrong.

1 Like

Yeah I rushed my response a little bit between pushing and testing a production project update, typing that post, and helping a friend write C code for an embedded system at the same time. :slight_smile:

1 Like


I have a column of data as my input to the script transform, then I need to sort the column in ascending fashion. Finally, it seemed like the system.math.percentile could be something I could use but the script is not running yet.
Edit: I should mention the first row in that column is a header

no need to sort the dataset before you call system.math.percentile() it will sort it internally.

alright, I got rid of the sorted = system.dataset.sort(value,Melter/TCs/TE20T1/Input/PV, True)
so now I just have:
q1 = system.math.percentile(value,25)
return q1

But yet I still have an error. Is it because of the header on the column?

You need to pass a list not a dataset into percentile(). You might could try, untested,

data = self.data
myColumn = 'Melter/TCs/TE20T01/Input/PV'
q1 = system.math.percentile(data.getColumnAsList(myColumn),25)


I’ve got to be missing something simple here. I feel like I am close to getting it to work. Any input?

you need to match the indentation of the def

def transform
    myColumn = 

Yep, indent your code to line up with the triple quotes

Hey guys, this is where I stand now. It seems to me maybe the “.getColumnAsList” function doesn’t work in ignition 8.0 but I could be wrong. My method here was to take my incoming column of data, delete the header and then perform the percentile function. I just assumed that the percentile function would not work if there was a header on the column.
Edit: I am currently getting a parse error

It only takes one argument, the integer index of the column.

Yup, I found my mistake. Everything seems to be working as expected. Thanks!

Hey @ben.d.musson I know its been a while but consistently run into an issue. Whenever I bind values to the parameters on the embedded view in the example window, it seems to get over written by the original values. Would you know how to prevent that from happening?
Thanks!

EDIT: Just to explain further on what I would want from this box and whisker plot, Id like to be able to place the chart onto a dashboard view and be able to bind the max, min, q1, q3 and median to each of my temperature tags