- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Highlight bins in a distribution based on a column value to highlight bin migration
I have a set of distributions which contain a population of units. I have used a select where with a containsitem call to select the list items in my dataset matching specific DUT reference ID numbers. This helps to show which bins contain the measurements for the units of interest. I would like use the date of test for each instance of the selection to highlight the bin containing measurements. For example if the same unit was tested on 6/20/2024 and later tested again on 6/25/2024, then once more in on 6/28/2024. The bin result from 6/20 would be highlighted with one color and the bin result on the 6/25, 6/28 would two other colors. Some other goals are to have these colors to be consistent across the distributions in the report (one color for each date of test), with all unselected units remaining with default color. I would also like to have the highlight be from top to bottom of the plot for the respective bin.
Your support is greatly appreciated.
//dtmain << select where(:SN=="12346777" | :SN=="12346982");
dtmain << select where(ContainsItem(:SN, {"12346777", "12346982"}));
Distribution(
Stack( 1 ),
Continuous Distribution(
Column( :Average ),
Horizontal Layout( 1 ),
Vertical( 0 ),
Set Bin Width( 2 ),
Process Capability( 0 )
),
Continuous Distribution(
Column( :Min ),
Horizontal Layout( 1 ),
Vertical( 0 ),
Set Bin Width( 2 ),
Process Capability( 0 )
),
Continuous Distribution(
Column( :Max ),
Horizontal Layout( 1 ),
Vertical( 0 ),
Set Bin Width( 2 ),
Process Capability( 0 )
),
By(
:TID, :BLOCKNAME, :MEAS_TYPE
)
);
Mock-up of what I would like to achieve:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Highlight bins in a distribution based on a column value to highlight bin migration
Thanks for your replies. I was able to adapt the code to address the Indvidual plots. In my analysis I have three subplots for each set of conditions. I resorted to hardcoding the subplot index.
If( Is List( rptDist ),
dists=rptDist;
myBys1 = Transform each ({myexpr} , rptDist << Get Where Expr, Arg(myExpr , 1 ));
myBys2 = Transform each ({myexpr} , rptDist << Get Where Expr, Arg(myExpr , 2 ));
myBys3 = Transform each ({myexpr} , rptDist << Get Where Expr, Arg(myExpr , 3 ));
, //else condition - no By conditions in Distribution call
dists = Eval List( {rptDist} );
myBys= {};
);
On to a new challenge. in that the use of Associative Array calls is losing information. Will create a separate post for the next challenge since the plotting goal here has been achieved.
Thanks everyone!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Highlight bins in a distribution based on a column value to highlight bin migration
My first guess is that you are trying to use Report() function on a list (check what dist contains using Show(dist);) when you are using By
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Highlight bins in a distribution based on a column value to highlight bin migration
Hi Jarmo,
I've added the nested for loops which achieved the desired result. Without the second loop the added reference would only appear in the first of the three plots. Please note that I assigned numOfPlots
a constant value of 3. I was looking for a way to interrogate the report(AxisBox... for dimensions, but I did not find the right object to return the correct count.
In all there are three nested for loops to produce distributions and to annotate them with refence lines.
...
For Each( {report, idx}, distRPTs, //grab each report in the
...
For Each( {bin, index}, theBins, //process bin for each report
...
For( iPlot = 1, iPlot <= numOfPlots, iPlot +=1, << add refer. in each of the subplots.
...
...For Each( {bin, index}, theBins,
binList = {};
//TBD change bin width to avoid offset when bin width is an odd number
Insert Into( binList, bin - theIncr / 2 );
Insert Into( binList, bin + theIncr / 2 );
For( iPlot = 1, iPlot <= numOfPlots, iPlot +=1,
Eval( Eval Expr(report[AxisBox( iPlot )] << Add Ref Line( Expr( binList ), "Solid", Expr( Index + 2 ), "", 1, 0.25 ) ) );
);
);
- « Previous
-
- 1
- 2
- Next »