cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Discussions

Solve problems, and share tips and tricks with other JMP users.
%3CLINGO-SUB%20id%3D%22lingo-sub-847328%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EAnotar%20gr%C3%A1ficos%20autom%C3%A1ticamente%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-847328%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3ETengo%20una%20cadena%20almacenada%20en%20las%20Notas%20para%20una%20serie%20de%20columnas%20en%20una%20tabla%20y%20la%20he%20asignado%20al%20objeto%20%22Notas%22.%20Cuando%20trazo%20estas%20columnas%20en%20un%20gr%C3%A1fico%20de%20variabilidad%2C%20me%20gustar%C3%ADa%20que%20las%20Notas%20aparecieran%20autom%C3%A1ticamente%20como%20una%20anotaci%C3%B3n.%20Mi%20idea%20inicial%20era%20incluir%20de%20alguna%20manera%20la%20anotaci%C3%B3n%20en%20el%20gr%C3%A1fico%20original%2C%20pero%20creo%20que%20deber%C3%ADa%20crear%20los%20gr%C3%A1ficos%20y%20anotarlos%20despu%C3%A9s.%20%C2%BFAlguna%20pista%20sobre%20c%C3%B3mo%20hacer%20esto%3F%20El%20c%C3%B3digo%20a%20continuaci%C3%B3n%20no%20funciona.%3C%2FP%3E%3CDIV%3E%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3Espud%20%3D%20Variability%20Chart(%20)%3B%0A%0A%0Aspud%20%26lt%3B%26lt%3B%20Add%20Text%20Annotation(%0A%09%09%09%09Text(%20%22Category%3A%20%22%20%7C%7C%20Notes%20)%2C%0A%09%09%09%09Fixed%20Size(%200%20)%2C%0A%09%09%09%09Text%20Box(%20%7B1%2C%20-30%2C%20382%2C%20184%7D%20)%2C%0A%09%09%09%09Filled(%200%20)%0A%09%09%09)%3B%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-847328%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CLINGO-LABEL%3EAutomatizaci%C3%B3n%20y%20scripting%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-847340%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Anotar%20gr%C3%A1ficos%20autom%C3%A1ticamente%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-847340%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EPodr%C3%ADa%20depender%20un%20poco%20de%20d%C3%B3nde%20desea%20agregar%20la%20anotaci%C3%B3n.%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3ENames%20Default%20To%20Here(1)%3B%0Adt%20%3D%20Open(%22%24SAMPLE_DATA%2FVariability%20Data%2F2%20Factors%20Crossed.jmp%22)%3B%0Aobj%20%3D%20dt%20%26lt%3B%26lt%3B%20Variability%20Chart(Y(%3AMeasurement)%2C%20X(%3AOperator%2C%20%3Apart%23))%3B%0Areport(obj)%20%26lt%3B%26lt%3B%20Add%20Text%20Annotation(%0A%09Text(%22We%20need%20to%20discuss%20this%20at%20the%20next%20meeting.%22)%2C%0A%09Text%20Box(%7B65%2C%2035%2C%20200%2C%2077%7D)%0A)%3B%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-847341%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERe%3A%20Anotar%20gr%C3%A1ficos%20autom%C3%A1ticamente%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-847341%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EEsto%20funciona%20bien%2C%20pero%20necesita%20entradas%20predefinidas.%20Busco%20algo%20que%20permita%20seleccionar%20entradas%20y%20luego%20anotarlas.%3C%2FP%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-847598%22%20slang%3D%22en-US%22%20mode%3D%22UPDATE%22%3ERe%3A%20Anotar%20gr%C3%A1ficos%20autom%C3%A1ticamente%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-847598%22%20slang%3D%22en-US%22%20mode%3D%22UPDATE%22%3E%3CP%3EHago%20una%20copia%20de%20la%20interfaz%20del%20gr%C3%A1fico%20de%20variabilidad%20y%20la%20anoto%20desde%20all%C3%AD.%20Probablemente%20necesite%20ajustes%2C%20pero%20parece%20funcionar.%3C%2FP%3E%3CBR%20%2F%3E%3CPRE%3ENames%20Default%20To%20Here(%201%20)%3B%3CBR%20%2F%3Edt%20%3D%20Current%20Data%20Table()%3B%3CBR%20%2F%3EIf(%20!Namespace%20Exists(%20%22Custom%20Dialog%22%20)%2C%3CBR%20%2F%3EdialogRecallNS%20%3D%20New%20Namespace(%3CBR%20%2F%3E%22Custom%20Dialog%22%2C%3CBR%20%2F%3E%7B%3CBR%20%2F%3EycolRecall%20%3D%3CBR%20%2F%3E%7B%3CBR%20%2F%3E%7D%3CBR%20%2F%3E%2C%3CBR%20%2F%3EstandRecall%20%3D%3CBR%20%2F%3E%7B%3CBR%20%2F%3E%7D%3CBR%20%2F%3E%2C%3CBR%20%2F%3ExcolRecall%20%3D%3CBR%20%2F%3E%7B%3CBR%20%2F%3E%7D%3CBR%20%2F%3E%2C%3CBR%20%2F%3EfreqRecall%20%3D%3CBR%20%2F%3E%7B%3CBR%20%2F%3E%7D%3CBR%20%2F%3E%2C%3CBR%20%2F%3EpartRecall%20%3D%3CBR%20%2F%3E%7B%3CBR%20%2F%3E%7D%3CBR%20%2F%3E%2C%3CBR%20%2F%3EbyRecall%20%3D%3CBR%20%2F%3E%7B%3CBR%20%2F%3E%7D%3CBR%20%2F%3E%7D%3CBR%20%2F%3E)%3CBR%20%2F%3E%2C%3CBR%20%2F%3EdialogRecallNS%20%3D%20Namespace(%20%22Custom%20Dialog%22%20)%3CBR%20%2F%3E)%3B%3CBR%20%2F%3Enc%20%3D%20N%20Col(%20dt%20)%3B%3CBR%20%2F%3ElbWidth%20%3D%20130%3B%3CBR%20%2F%3Epgm%20%3D%20Expr(%3CBR%20%2F%3Enw%20%3D%20New%20Window(%20%22Annotated%20Multiple%20Plots%22%2C%3CBR%20%2F%3EFor(%20i%20%3D%201%2C%20i%20%26lt%3B%3D%20N%20Items(%20exy%20)%2C%20i%2B%2B%2C%3CBR%20%2F%3ENotes%20%3D%20Try(%20Column(%20dt%2C%20exy%5Bi%5D%20)%20%26lt%3B%26lt%3B%20Get%20Property(%20%22Notes%22%20)%20)%3B%3CBR%20%2F%3ETry(%3CBR%20%2F%3EVariability%20Chart(%3CBR%20%2F%3EY(%20exy%5Bi%5D%20)%2C%3CBR%20%2F%3EX(%20Eval(%20exx%20)%20)%2C%3CBR%20%2F%3EStandard(%20Eval(%20Standy%20)%20)%2C%3CBR%20%2F%3EFreq(%20Eval(%20Freqy%20)%20)%2C%3CBR%20%2F%3EBy(%20Eval(%20Byy%20)%20)%2C%3CBR%20%2F%3ESendToReport(%3CBR%20%2F%3EDispatch(%3CBR%20%2F%3E%7B%7D%2C%3CBR%20%2F%3E%22%22%2C%3CBR%20%2F%3EAxisBox(%202%20)%2C%3CBR%20%2F%3EAdd%20Text%20Annotation(%3CBR%20%2F%3EText(%20%22Category%3A%20%22%20%7C%7C%20Notes%20)%2C%3CBR%20%2F%3EFixed%20Size(%200%20)%2C%3CBR%20%2F%3EText%20Box(%20%7B0%2C%20-255%2C%200%2C%200%7D%20)%2C%3CBR%20%2F%3EFilled(%200%20)%3CBR%20%2F%3E)%3CBR%20%2F%3E)%3CBR%20%2F%3E)%3CBR%20%2F%3E)%3CBR%20%2F%3E)%3B%3CBR%20%2F%3E)%3CBR%20%2F%3E)%3CBR%20%2F%3E)%3B%3CBR%20%2F%3EclearRoles%20%3D%20Expr(%3CBR%20%2F%3EcolListY%20%26lt%3B%26lt%3B%20RemoveAll%3B%3CBR%20%2F%3EcolListX%20%26lt%3B%26lt%3B%20RemoveAll%3B%3CBR%20%2F%3EStand%20%26lt%3B%26lt%3B%20RemoveAll%3B%3CBR%20%2F%3EFreq%20%26lt%3B%26lt%3B%20RemoveAll%3B%3CBR%20%2F%3EPart%20%26lt%3B%26lt%3B%20RemoveAll%3B%3CBR%20%2F%3EBy%20%26lt%3B%26lt%3B%20RemoveAll%3B%3CBR%20%2F%3E)%3B%3CBR%20%2F%3ErecallRoles%20%3D%20Expr(%3CBR%20%2F%3EdialogRecallNS%3AycolRecall%20%3D%20colListY%20%26lt%3B%26lt%3B%20GetItems%3B%3CBR%20%2F%3EdialogRecallNS%3AxcolRecall%20%3D%20colListX%20%26lt%3B%26lt%3B%20GetItems%3B%3CBR%20%2F%3EdialogRecallNS%3AstandRecall%20%3D%20Stand%20%26lt%3B%26lt%3B%20GetItems%3B%3CBR%20%2F%3EdialogRecallNS%3AfreqRecall%20%3D%20Freq%20%26lt%3B%26lt%3B%20GetItems%3B%3CBR%20%2F%3EdialogRecallNS%3ApartRecall%20%3D%20Part%20%26lt%3B%26lt%3B%20GetItems%3B%3CBR%20%2F%3EdialogRecallNS%3AbyRecall%20%3D%20By%20%26lt%3B%26lt%3B%20GetItems%3B%3CBR%20%2F%3E)%3B%3CBR%20%2F%3EcustomDlg%20%3D%20New%20Window(%20%22Example%20of%20a%20Custom%20Dialog%22%2C%3CBR%20%2F%3EBorder%20Box(%20Left(%203%20)%2C%20top(%202%20)%2C%3CBR%20%2F%3EV%20List%20Box(%3CBR%20%2F%3EH%20List%20Box(%3CBR%20%2F%3EV%20List%20Box(%3CBR%20%2F%3EPanel%20Box(%20%22Select%20Columns%22%2C%3CBR%20%2F%3EcolListData%20%3D%3CBR%20%2F%3EFilter%20Col%20Selector(%3CBR%20%2F%3EAll%2C%3CBR%20%2F%3Ewidth(%20lbWidth%20)%2C%3CBR%20%2F%3EnLines(%20Min(%20nc%2C%2010%20)%20)%3CBR%20%2F%3E)%3CBR%20%2F%3E)%3CBR%20%2F%3E)%2C%3CBR%20%2F%3EPanel%20Box(%20%22Cast%20Selected%20Columns%20into%20Roles%22%2C%3CBR%20%2F%3ELineup%20Box(%20N%20Col(%202%20)%2C%20Spacing(%203%20)%2C%3CBR%20%2F%3EButton%20Box(%20%22Y%2C%20Response%22%2C%3CBR%20%2F%3EcolListY%20%26lt%3B%26lt%3B%20Append(%20colListData%20%26lt%3B%26lt%3B%20GetSelected%20)%3CBR%20%2F%3E)%2C%3CBR%20%2F%3EcolListY%20%3D%20Col%20List%20Box(%20width(%20lbWidth%20)%2C%20nLines(%205%20)%20)%2C%3CBR%20%2F%3EButton%20Box(%20%22Standard%22%2C%3CBR%20%2F%3EStand%20%26lt%3B%26lt%3B%20Append(%20colListData%20%26lt%3B%26lt%3B%20GetSelected%20)%3CBR%20%2F%3E)%2C%3CBR%20%2F%3EStand%20%3D%20Col%20List%20Box(%20width(%20lbWidth%20)%2C%20nLines(%201%20)%20)%2C%3CBR%20%2F%3EButton%20Box(%20%22X%2C%20Grouping%22%2C%3CBR%20%2F%3EcolListX%20%26lt%3B%26lt%3B%20Append(%20colListData%20%26lt%3B%26lt%3B%20GetSelected%20)%3CBR%20%2F%3E)%2C%3CBR%20%2F%3EcolListX%20%3D%20Col%20List%20Box(%20width(%20lbWidth%20)%2C%20nLines(%202%20)%20)%2C%3CBR%20%2F%3EButton%20Box(%20%22Freq%22%2C%3CBR%20%2F%3EFreq%20%26lt%3B%26lt%3B%20Append(%20colListData%20%26lt%3B%26lt%3B%20GetSelected%20)%3CBR%20%2F%3E)%2C%3CBR%20%2F%3EFreq%20%3D%20Col%20List%20Box(%20width(%20lbWidth%20)%2C%20nLines(%201%20)%20)%2C%3CBR%20%2F%3EButton%20Box(%20%22Part%2C%20Sample%20ID%22%2C%3CBR%20%2F%3EPart%20%26lt%3B%26lt%3B%20Append(%20colListData%20%26lt%3B%26lt%3B%20GetSelected%20)%3CBR%20%2F%3E)%2C%3CBR%20%2F%3EPart%20%3D%20Col%20List%20Box(%20width(%20lbWidth%20)%2C%20nLines(%201%20)%20)%2C%3CBR%20%2F%3EButton%20Box(%20%22By%22%2C%3CBR%20%2F%3EBy%20%26lt%3B%26lt%3B%20Append(%20colListData%20%26lt%3B%26lt%3B%20GetSelected%20)%3CBR%20%2F%3E)%2C%3CBR%20%2F%3EBy%20%3D%20Col%20List%20Box(%20width(%20lbWidth%20)%2C%20nLines(%202%20)%20)%3CBR%20%2F%3E)%2C%3CBR%20%2F%3EText%20Box(%3CBR%20%2F%3E%22Operator%2C%20Instrument%20are%20examples%20of%20possible%20Grouping%20Columns%22%3CBR%20%2F%3E)%3CBR%20%2F%3E)%2C%3CBR%20%2F%3EPanel%20Box(%20%22Action%22%2C%3CBR%20%2F%3ELineup%20Box(%20N%20Col(%201%20)%2C%3CBR%20%2F%3EButton%20Box(%20%22OK%22%2C%3CBR%20%2F%3ErecallRoles%3B%3CBR%20%2F%3Eexy%20%3D%20colListY%20%26lt%3B%26lt%3B%20get%20items%3B%3CBR%20%2F%3Eexx%20%3D%20colListX%20%26lt%3B%26lt%3B%20get%20items%3B%3CBR%20%2F%3EStandy%20%3D%20Stand%20%26lt%3B%26lt%3B%20Get%20Items%3B%3CBR%20%2F%3EFreqy%20%3D%20Freq%20%26lt%3B%26lt%3B%20Get%20Items%3B%3CBR%20%2F%3EParty%20%3D%20Stand%20%26lt%3B%26lt%3B%20Get%20Items%3B%3CBR%20%2F%3EByy%20%3D%20By%20%26lt%3B%26lt%3B%20Get%20Items%3B%3CBR%20%2F%3Epgm%3B%3CBR%20%2F%3EcustomDlg%20%26lt%3B%26lt%3B%20CloseWindow%3B%3CBR%20%2F%3E)%2C%3CBR%20%2F%3EButton%20Box(%20%22Cancel%22%2C%20customDlg%20%26lt%3B%26lt%3B%20CloseWindow%20)%2C%3CBR%20%2F%3EButton%20Box(%20%22Reset%22%2C%20clearRoles%20)%2C%3CBR%20%2F%3EText%20Box(%20%22%20%22%20)%2C%3CBR%20%2F%3EButton%20Box(%20%22Remove%22%2C%3CBR%20%2F%3EcolListY%20%26lt%3B%26lt%3B%20RemoveSelected%3B%3CBR%20%2F%3EcolListX%20%26lt%3B%26lt%3B%20RemoveSelected%3B%3CBR%20%2F%3EStand%20%26lt%3B%26lt%3B%20RemoveSelected%3B%3CBR%20%2F%3EFreq%20%26lt%3B%26lt%3B%20RemoveSelected%3B%3CBR%20%2F%3EPart%20%26lt%3B%26lt%3B%20RemoveSelected%3B%3CBR%20%2F%3EBy%20%26lt%3B%26lt%3B%20RemoveSelected%3B%3CBR%20%2F%3E)%2C%3CBR%20%2F%3EButton%20Box(%20%22Recall%22%2C%3CBR%20%2F%3EclearRoles%3B%3CBR%20%2F%3ETry(%3CBR%20%2F%3EcolListY%20%26lt%3B%26lt%3B%20Append(%20dialogRecallNS%3AycolRecall%20)%3B%3CBR%20%2F%3EcolListX%20%26lt%3B%26lt%3B%20Append(%20dialogRecallNS%3AxcolRecall%20)%3B%3CBR%20%2F%3EStand%20%26lt%3B%26lt%3B%20Append(%20dialogRecallNS%3AstandRecall%20)%3B%3CBR%20%2F%3EFreq%20%26lt%3B%26lt%3B%20Append(%20dialogRecallNS%3AfreqRecall%20)%3B%3CBR%20%2F%3EPart%20%26lt%3B%26lt%3B%20Append(%20dialogRecallNS%3ApartRecall%20)%3B%3CBR%20%2F%3EBy%20%26lt%3B%26lt%3B%20Append(%20dialogRecallNS%3AbyRecall%20)%3B%3CBR%20%2F%3E)%3B%3CBR%20%2F%3E)%3CBR%20%2F%3E)%3CBR%20%2F%3E)%3CBR%20%2F%3E)%3CBR%20%2F%3E)%3CBR%20%2F%3E)%3CBR%20%2F%3E)%3B%3CBR%20%2F%3EcolListx%20%26lt%3B%26lt%3B%20set%20min%20items(%201%20)%3B%3CBR%20%2F%3EcolListy%20%26lt%3B%26lt%3B%20set%20min%20items(%201%20)%3B%3C%2FPRE%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E
Choose Language Hide Translation Bar
SpannerHead
Level VI

Annotate Graphs Automatically

I have a string stored in the Notes for a series of columns in a table and I have assigned this to the object "Notes".  When I plot these columns in a variability chart, I would like the Notes to show up automatically as an annotation.  My initial thought was to somehow include the annotation in the original plot but I'm thinking I should create the plots and annotate afterwards.  Any clue how to do this, the code below doesn't work?

spud = Variability Chart( );


spud << Add Text Annotation(
				Text( "Category: " || Notes ),
				Fixed Size( 0 ),
				Text Box( {1, -30, 382, 184} ),
				Filled( 0 )
			);

Slán



SpannerHead
1 ACCEPTED SOLUTION

Accepted Solutions
SpannerHead
Level VI

Re: Annotate Graphs Automatically

I make a facsimile of the Variability Plot Interface and Annotate from there.  Will probably need refinement but seems to work.

 

Names Default To Here( 1 );
dt = Current Data Table();
If( !Namespace Exists( "Custom Dialog" ),
dialogRecallNS = New Namespace(
"Custom Dialog",
{
ycolRecall =
{
}
,
standRecall =
{
}
,
xcolRecall =
{
}
,
freqRecall =
{
}
,
partRecall =
{
}
,
byRecall =
{
}
}
)
,
dialogRecallNS = Namespace( "Custom Dialog" )
);
nc = N Col( dt );
lbWidth = 130;
pgm = Expr(
nw = New Window( "Annotated Multiple Plots",
For( i = 1, i <= N Items( exy ), i++,
Notes = Try( Column( dt, exy[i] ) << Get Property( "Notes" ) );
Try(
Variability Chart(
Y( exy[i] ),
X( Eval( exx ) ),
Standard( Eval( Standy ) ),
Freq( Eval( Freqy ) ),
By( Eval( Byy ) ),
SendToReport(
Dispatch(
{},
"",
AxisBox( 2 ),
Add Text Annotation(
Text( "Category: " || Notes ),
Fixed Size( 0 ),
Text Box( {0, -255, 0, 0} ),
Filled( 0 )
)
)
)
)
);
)
)
);
clearRoles = Expr(
colListY << RemoveAll;
colListX << RemoveAll;
Stand << RemoveAll;
Freq << RemoveAll;
Part << RemoveAll;
By << RemoveAll;
);
recallRoles = Expr(
dialogRecallNS:ycolRecall = colListY << GetItems;
dialogRecallNS:xcolRecall = colListX << GetItems;
dialogRecallNS:standRecall = Stand << GetItems;
dialogRecallNS:freqRecall = Freq << GetItems;
dialogRecallNS:partRecall = Part << GetItems;
dialogRecallNS:byRecall = By << GetItems;
);
customDlg = New Window( "Example of a Custom Dialog",
Border Box( Left( 3 ), top( 2 ),
V List Box(
H List Box(
V List Box(
Panel Box( "Select Columns",
colListData =
Filter Col Selector(
All,
width( lbWidth ),
nLines( Min( nc, 10 ) )
)
)
),
Panel Box( "Cast Selected Columns into Roles",
Lineup Box( N Col( 2 ), Spacing( 3 ),
Button Box( "Y, Response",
colListY << Append( colListData << GetSelected )
),
colListY = Col List Box( width( lbWidth ), nLines( 5 ) ),
Button Box( "Standard",
Stand << Append( colListData << GetSelected )
),
Stand = Col List Box( width( lbWidth ), nLines( 1 ) ),
Button Box( "X, Grouping",
colListX << Append( colListData << GetSelected )
),
colListX = Col List Box( width( lbWidth ), nLines( 2 ) ),
Button Box( "Freq",
Freq << Append( colListData << GetSelected )
),
Freq = Col List Box( width( lbWidth ), nLines( 1 ) ),
Button Box( "Part, Sample ID",
Part << Append( colListData << GetSelected )
),
Part = Col List Box( width( lbWidth ), nLines( 1 ) ),
Button Box( "By",
By << Append( colListData << GetSelected )
),
By = Col List Box( width( lbWidth ), nLines( 2 ) )
),
Text Box(
"Operator, Instrument are examples of possible Grouping Columns"
)
),
Panel Box( "Action",
Lineup Box( N Col( 1 ),
Button Box( "OK",
recallRoles;
exy = colListY << get items;
exx = colListX << get items;
Standy = Stand << Get Items;
Freqy = Freq << Get Items;
Party = Stand << Get Items;
Byy = By << Get Items;
pgm;
customDlg << CloseWindow;
),
Button Box( "Cancel", customDlg << CloseWindow ),
Button Box( "Reset", clearRoles ),
Text Box( " " ),
Button Box( "Remove",
colListY << RemoveSelected;
colListX << RemoveSelected;
Stand << RemoveSelected;
Freq << RemoveSelected;
Part << RemoveSelected;
By << RemoveSelected;
),
Button Box( "Recall",
clearRoles;
Try(
colListY << Append( dialogRecallNS:ycolRecall );
colListX << Append( dialogRecallNS:xcolRecall );
Stand << Append( dialogRecallNS:standRecall );
Freq << Append( dialogRecallNS:freqRecall );
Part << Append( dialogRecallNS:partRecall );
By << Append( dialogRecallNS:byRecall );
);
)
)
)
)
)
)
);
colListx << set min items( 1 );
colListy << set min items( 1 );

 


Slán



SpannerHead

View solution in original post

3 REPLIES 3
jthi
Super User

Re: Annotate Graphs Automatically

Might depend on a bit where you wish to add the annotation to

Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Variability Data/2 Factors Crossed.jmp");
obj = dt << Variability Chart(Y(:Measurement), X(:Operator, :part#));
report(obj) << Add Text Annotation(
	Text("We need to discuss this at the next meeting."),
	Text Box({65, 35, 200, 77})
);
-Jarmo
SpannerHead
Level VI

Re: Annotate Graphs Automatically

This works well but it needs predefined inputs.  I'm after something that allows inputs to be selected and then annotates those.

 

 

 

 


Slán



SpannerHead
SpannerHead
Level VI

Re: Annotate Graphs Automatically

I make a facsimile of the Variability Plot Interface and Annotate from there.  Will probably need refinement but seems to work.

 

Names Default To Here( 1 );
dt = Current Data Table();
If( !Namespace Exists( "Custom Dialog" ),
dialogRecallNS = New Namespace(
"Custom Dialog",
{
ycolRecall =
{
}
,
standRecall =
{
}
,
xcolRecall =
{
}
,
freqRecall =
{
}
,
partRecall =
{
}
,
byRecall =
{
}
}
)
,
dialogRecallNS = Namespace( "Custom Dialog" )
);
nc = N Col( dt );
lbWidth = 130;
pgm = Expr(
nw = New Window( "Annotated Multiple Plots",
For( i = 1, i <= N Items( exy ), i++,
Notes = Try( Column( dt, exy[i] ) << Get Property( "Notes" ) );
Try(
Variability Chart(
Y( exy[i] ),
X( Eval( exx ) ),
Standard( Eval( Standy ) ),
Freq( Eval( Freqy ) ),
By( Eval( Byy ) ),
SendToReport(
Dispatch(
{},
"",
AxisBox( 2 ),
Add Text Annotation(
Text( "Category: " || Notes ),
Fixed Size( 0 ),
Text Box( {0, -255, 0, 0} ),
Filled( 0 )
)
)
)
)
);
)
)
);
clearRoles = Expr(
colListY << RemoveAll;
colListX << RemoveAll;
Stand << RemoveAll;
Freq << RemoveAll;
Part << RemoveAll;
By << RemoveAll;
);
recallRoles = Expr(
dialogRecallNS:ycolRecall = colListY << GetItems;
dialogRecallNS:xcolRecall = colListX << GetItems;
dialogRecallNS:standRecall = Stand << GetItems;
dialogRecallNS:freqRecall = Freq << GetItems;
dialogRecallNS:partRecall = Part << GetItems;
dialogRecallNS:byRecall = By << GetItems;
);
customDlg = New Window( "Example of a Custom Dialog",
Border Box( Left( 3 ), top( 2 ),
V List Box(
H List Box(
V List Box(
Panel Box( "Select Columns",
colListData =
Filter Col Selector(
All,
width( lbWidth ),
nLines( Min( nc, 10 ) )
)
)
),
Panel Box( "Cast Selected Columns into Roles",
Lineup Box( N Col( 2 ), Spacing( 3 ),
Button Box( "Y, Response",
colListY << Append( colListData << GetSelected )
),
colListY = Col List Box( width( lbWidth ), nLines( 5 ) ),
Button Box( "Standard",
Stand << Append( colListData << GetSelected )
),
Stand = Col List Box( width( lbWidth ), nLines( 1 ) ),
Button Box( "X, Grouping",
colListX << Append( colListData << GetSelected )
),
colListX = Col List Box( width( lbWidth ), nLines( 2 ) ),
Button Box( "Freq",
Freq << Append( colListData << GetSelected )
),
Freq = Col List Box( width( lbWidth ), nLines( 1 ) ),
Button Box( "Part, Sample ID",
Part << Append( colListData << GetSelected )
),
Part = Col List Box( width( lbWidth ), nLines( 1 ) ),
Button Box( "By",
By << Append( colListData << GetSelected )
),
By = Col List Box( width( lbWidth ), nLines( 2 ) )
),
Text Box(
"Operator, Instrument are examples of possible Grouping Columns"
)
),
Panel Box( "Action",
Lineup Box( N Col( 1 ),
Button Box( "OK",
recallRoles;
exy = colListY << get items;
exx = colListX << get items;
Standy = Stand << Get Items;
Freqy = Freq << Get Items;
Party = Stand << Get Items;
Byy = By << Get Items;
pgm;
customDlg << CloseWindow;
),
Button Box( "Cancel", customDlg << CloseWindow ),
Button Box( "Reset", clearRoles ),
Text Box( " " ),
Button Box( "Remove",
colListY << RemoveSelected;
colListX << RemoveSelected;
Stand << RemoveSelected;
Freq << RemoveSelected;
Part << RemoveSelected;
By << RemoveSelected;
),
Button Box( "Recall",
clearRoles;
Try(
colListY << Append( dialogRecallNS:ycolRecall );
colListX << Append( dialogRecallNS:xcolRecall );
Stand << Append( dialogRecallNS:standRecall );
Freq << Append( dialogRecallNS:freqRecall );
Part << Append( dialogRecallNS:partRecall );
By << Append( dialogRecallNS:byRecall );
);
)
)
)
)
)
)
);
colListx << set min items( 1 );
colListy << set min items( 1 );

 


Slán



SpannerHead

Recommended Articles