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%3E%E8%87%AA%E5%8B%95%E8%A8%BB%E9%87%8B%E5%9C%96%E8%A1%A8%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-847328%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%E6%88%91%E5%9C%A8%20Notes%20%E4%B8%AD%E5%84%B2%E5%AD%98%E4%BA%86%E4%B8%80%E7%B3%BB%E5%88%97%E8%A1%A8%E4%B8%AD%E5%88%97%E7%9A%84%E5%AD%97%E4%B8%B2%EF%BC%8C%E4%B8%A6%E5%B0%87%E5%85%B6%E6%8C%87%E6%B4%BE%E7%B5%A6%E7%89%A9%E4%BB%B6%E3%80%8CNotes%E3%80%8D%E3%80%82%E7%95%B6%E6%88%91%E5%9C%A8%E8%AE%8A%E7%95%B0%E5%9C%96%E8%A1%A8%E4%B8%AD%E7%B9%AA%E8%A3%BD%E9%80%99%E4%BA%9B%E5%88%97%E6%99%82%EF%BC%8C%E6%88%91%E5%B8%8C%E6%9C%9B%E8%A8%BB%E9%87%8B%E8%83%BD%E5%A4%A0%E8%87%AA%E5%8B%95%E9%A1%AF%E7%A4%BA%E7%82%BA%E8%A8%BB%E8%A7%A3%E3%80%82%E6%88%91%E6%9C%80%E5%88%9D%E7%9A%84%E6%83%B3%E6%B3%95%E6%98%AF%E4%BB%A5%E6%9F%90%E7%A8%AE%E6%96%B9%E5%BC%8F%E5%B0%87%E8%A8%BB%E9%87%8B%E5%8C%85%E5%90%AB%E5%9C%A8%E5%8E%9F%E5%A7%8B%E6%83%85%E7%AF%80%E4%B8%AD%EF%BC%8C%E4%BD%86%E6%88%91%E6%83%B3%E6%88%91%E6%87%89%E8%A9%B2%E5%85%88%E5%89%B5%E5%BB%BA%E6%83%85%E7%AF%80%E7%84%B6%E5%BE%8C%E5%86%8D%E9%80%B2%E8%A1%8C%E8%A8%BB%E9%87%8B%E3%80%82%E4%BB%BB%E4%BD%95%E7%B7%9A%E7%B4%A2%E5%A6%82%E4%BD%95%E5%81%9A%E5%88%B0%E9%80%99%E4%B8%80%E9%BB%9E%EF%BC%8C%E4%B8%8B%E9%9D%A2%E7%9A%84%E7%A8%8B%E5%BC%8F%E7%A2%BC%E4%B8%8D%E8%B5%B7%E4%BD%9C%E7%94%A8%EF%BC%9F%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%3E%E8%87%AA%E5%8B%95%E5%8C%96%E5%92%8C%E8%85%B3%E6%9C%AC%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%3E%E5%9B%9E%E8%A6%86%EF%BC%9A%E8%87%AA%E5%8B%95%E8%A8%BB%E9%87%8B%E5%9C%96%E8%A1%A8%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-847340%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%E5%8F%AF%E8%83%BD%E5%8F%96%E6%B1%BA%E6%96%BC%E4%BD%A0%E5%B8%8C%E6%9C%9B%E6%B7%BB%E5%8A%A0%E8%A8%BB%E8%A7%A3%E7%9A%84%E4%BD%8D%E7%BD%AE%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%3E%E5%9B%9E%E8%A6%86%EF%BC%9A%E8%87%AA%E5%8B%95%E8%A8%BB%E9%87%8B%E5%9C%96%E8%A1%A8%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-847341%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%E9%80%99%E5%BE%88%E6%9C%89%E6%95%88%E4%BD%86%E6%98%AF%E9%9C%80%E8%A6%81%E9%A0%90%E5%85%88%E5%AE%9A%E7%BE%A9%E7%9A%84%E8%BC%B8%E5%85%A5%E3%80%82%E6%88%91%E6%AD%A3%E5%9C%A8%E5%B0%8B%E6%89%BE%E4%B8%80%E7%A8%AE%E8%83%BD%E5%A4%A0%E9%81%B8%E6%93%87%E8%BC%B8%E5%85%A5%E7%84%B6%E5%BE%8C%E5%B0%8D%E5%85%B6%E9%80%B2%E8%A1%8C%E8%A8%BB%E9%87%8B%E7%9A%84%E6%9D%B1%E8%A5%BF%E3%80%82%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%3E%E5%9B%9E%E8%A6%86%EF%BC%9A%E8%87%AA%E5%8B%95%E8%A8%BB%E9%87%8B%E5%9C%96%E8%A1%A8%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-847598%22%20slang%3D%22en-US%22%20mode%3D%22UPDATE%22%3E%3CP%3E%E6%88%91%E8%A3%BD%E4%BD%9C%E4%BA%86%E8%AE%8A%E7%95%B0%E6%80%A7%E7%B9%AA%E5%9C%96%E4%BB%8B%E9%9D%A2%E7%9A%84%E8%A4%87%E8%A3%BD%E5%93%81%E4%B8%A6%E5%BE%9E%E9%82%A3%E8%A3%A1%E9%80%B2%E8%A1%8C%E8%A8%BB%E9%87%8B%E3%80%82%E5%8F%AF%E8%83%BD%E9%9C%80%E8%A6%81%E6%94%B9%E9%80%B2%E4%BD%86%E4%BC%BC%E4%B9%8E%E6%9C%89%E6%95%88%E3%80%82%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