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-443181%22%20slang%3D%22en-US%22%20mode%3D%22UPDATE%22%3E%E5%88%86%E5%B8%83%E3%83%92%E3%82%B9%E3%83%88%E3%82%B0%E3%83%A9%E3%83%A0%E3%81%AE%E6%B0%B4%E5%B9%B3%E8%BB%B8%E3%81%AE%E3%83%A9%E3%83%99%E3%83%AB%E3%81%AE%E5%90%91%E3%81%8D%E3%82%92%E3%80%81%E3%81%99%E3%81%B9%E3%81%A6%E3%81%AE%E3%83%92%E3%82%B9%E3%83%88%E3%82%B0%E3%83%A9%E3%83%A0%E3%81%AB%E5%AF%BE%E3%81%97%E3%81%A6%E5%9E%82%E7%9B%B4%E3%81%AB%E3%81%AA%E3%82%8B%E3%82%88%E3%81%86%E3%81%AB%E8%A8%AD%E5%AE%9A%E3%81%99%E3%82%8B%E3%81%AB%E3%81%AF%E3%81%A9%E3%81%86%E3%81%99%E3%82%8C%E3%81%B0%E3%82%88%E3%81%84%E3%81%A7%E3%81%99%E3%81%8B%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-443181%22%20slang%3D%22en-US%22%20mode%3D%22UPDATE%22%3E%3CP%3E%E5%88%86%E5%B8%83%20(%E3%83%92%E3%82%B9%E3%83%88%E3%82%B0%E3%83%A9%E3%83%A0)%20%E3%83%97%E3%83%AD%E3%83%83%E3%83%88%E3%81%AE%E6%B0%B4%E5%B9%B3%E8%BB%B8%E3%81%AE%E3%83%A9%E3%83%99%E3%83%AB%E3%81%AE%E5%90%91%E3%81%8D%E3%81%A8%E5%BD%A2%E5%BC%8F%20(%E3%82%A8%E3%83%B3%E3%82%B8%E3%83%8B%E3%82%A2%E3%83%AA%E3%83%B3%E3%82%B0%20SI)%20%E3%82%92%E5%A4%89%E6%9B%B4%E3%81%97%E3%82%88%E3%81%86%E3%81%A8%E3%81%97%E3%81%A6%E3%81%84%E3%81%BE%E3%81%99%E3%80%82%E4%BD%9C%E6%88%90%E4%B8%AD%E3%81%AE%E5%BC%8F%E5%86%85%E3%81%AE%E3%83%87%E3%82%A3%E3%82%B9%E3%83%91%E3%83%83%E3%83%81%20%E3%82%B9%E3%83%86%E3%83%BC%E3%83%88%E3%83%A1%E3%83%B3%E3%83%88%E3%82%92%E4%BD%BF%E7%94%A8%E3%81%97%E3%81%A6%E6%9C%80%E5%88%9D%E3%81%AE%E3%82%82%E3%81%AE%E3%81%AB%E5%AF%BE%E3%81%97%E3%81%A6%E3%81%93%E3%82%8C%E3%82%92%E8%A1%8C%E3%81%86%E3%81%93%E3%81%A8%E3%81%8C%E3%81%A7%E3%81%8D%E3%81%BE%E3%81%99%E3%81%8C%E3%80%81%E5%88%97%E3%83%AA%E3%82%B9%E3%83%88%E5%86%85%E3%81%AE%E3%81%99%E3%81%B9%E3%81%A6%E3%81%AE%E3%83%92%E3%82%B9%E3%83%88%E3%82%B0%E3%83%A9%E3%83%A0%E3%81%AB%E5%AF%BE%E3%81%97%E3%81%A6%E3%81%93%E3%82%8C%E3%82%92%E8%A1%8C%E3%81%86%E3%81%93%E3%81%A8%E3%81%8C%E3%81%A7%E3%81%8D%E3%82%8B%E5%BF%85%E8%A6%81%E3%81%8C%E3%81%82%E3%82%8A%E3%81%BE%E3%81%99%E3%80%82%3C%2FP%3E%3CP%3E%E3%80%8C%7B%7D%E3%80%8D%E3%81%AE%E9%96%93%E3%81%AB%E5%88%97%E5%90%8D%E3%81%B8%E3%81%AE%E7%95%B0%E3%81%AA%E3%82%8B%E3%82%BF%E3%82%A4%E3%83%97%E3%81%AE%E5%91%BC%E3%81%B3%E5%87%BA%E3%81%97%E3%82%92%E6%8C%BF%E5%85%A5%E3%81%97%E3%81%A6%E3%81%BF%E3%81%BE%E3%81%97%E3%81%9F%3A%3C%2FP%3E%3CP%3E%3CCODE%20class%3D%22%20language-jsl%22%3EDispatch(%20%7B%7D%2C%3C%2FCODE%3E%3C%2FP%3E%3CP%3E%E3%81%97%E3%81%8B%E3%81%97%E3%80%81%E3%81%A9%E3%82%8C%E3%82%82%E3%83%92%E3%82%B9%E3%83%88%E3%82%B0%E3%83%A9%E3%83%A0%E3%82%92%E5%A4%89%E6%9B%B4%E3%81%97%E3%81%BE%E3%81%9B%E3%82%93%E3%80%82%E5%88%97%E5%90%8D%20(%E3%81%A4%E3%81%BE%E3%82%8A%E3%80%81%7B%22My%20Column%22%7D)%20%E3%81%AE%E3%81%BF%E3%82%92%E6%96%87%E5%AD%97%E9%80%9A%E3%82%8A%E5%85%A5%E5%8A%9B%E3%81%99%E3%82%8B%E3%81%A8%E6%A9%9F%E8%83%BD%E3%81%97%E3%81%BE%E3%81%99%E3%81%8C%E3%80%81colList%20%E9%85%8D%E5%88%97%E5%86%85%E3%81%AE%E3%81%99%E3%81%B9%E3%81%A6%E3%81%AE%E5%90%8D%E5%89%8D%E3%81%AB%E5%AF%BE%E3%81%97%E3%81%A6%E3%81%93%E3%82%8C%E3%82%92%E5%AE%9F%E8%A1%8C%E3%81%97%E3%81%9F%E3%81%84%E3%81%A8%E8%80%83%E3%81%88%E3%81%A6%E3%81%84%E3%81%BE%E3%81%99%E3%80%82%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3Edt%20%3D%20currentdatatable()%3B%0A%0Acol%20%3D%20dt%20%26lt%3B%26lt%3B%20get%20column%20names()%3B%0Anc%20%3D%20N%20Items(%20col%20)%3B%0AcolList%20%3D%20%7B%7D%3B%0Abin_width%3D%7B%7D%3B%0A%0AFor(%20i%20%3D%201%2C%20i%20%26lt%3B%3D%20nc%2C%20i%2B%2B%2C%0A%09If(Contains%20(col%5Bi%5D%2C%22%3A%3A%22)%2C%0A%09Insert%20Into(%20colList%2C%20col%5Bi%5D%20))%0A)%3B%0A%0A%0AFor(i%20%3D%201%2C%20i%20%26lt%3B%3D%20N%20Items(colList)%2C%20i%2B%2B%2C%0A%09Insert%20Into(bin_width%2C0.0)%3B%0A%09bin_width%5Bi%5D%20%3D%20Col%20Max(Column(dt%2C%20colList%5Bi%5D))%20-%20Col%20Min(Column(dt%2C%20colList%5Bi%5D))%3B%0A%09bin_width%5Bi%5D%20%3D%20bin_width%5Bi%5D%2F10%3B%0A)%3B%0A%0A%0AtheExpr%20%3D%20%22dis%20%3D%20dt%20%26lt%3B%26lt%3B%20Distribution(Stack(%201%20)%2C%0A%09Continuous%20Distribution(%20column(%20column(dt%2CcolList%5B1%5D))%2C%20Set%20Bin%20Width(bin_width%5B1%5D)%2C%20Label%20Row(%20Label%20Orientation(%20%5C!%22Perpendicular%5C!%22%20)%20))%0A%09%22%3B%0A%0AFor(%20i%20%3D%202%2C%20i%20%26lt%3B%20N%20Items(%20colList%20)%2C%20i%2B%2B%2C%0A%09theExpr%20%3D%20theExpr%20%7C%7C%20%22%2C%20Continuous%20Distribution(%20column(%20column(dt%2C%20colList%5B%22%20%7C%7C%20Char(%20i%20)%20%7C%7C%20%22%5D))%2C%20Set%20Bin%20Width(bin_width%5Bi%5D))%22%0A)%3B%0A%0A%0AtheExpr%20%3D%20theExpr%20%7C%7C%20%22%2C%0A%09SendToReport(%0A%09%09Dispatch(%0A%09%09%09%7B%7D%2C%0A%09%09%09%5C!%221%5C!%22%2C%0A%09%09%09ScaleBox%2C%0A%09%09%09%7BFormat(%20%5C!%22Engineering%20SI%5C!%22%2C%2010%20)%2C%20Minor%20Ticks(%200%20)%2C%0A%09%09%09Label%20Row(%20Label%20Orientation(%20%5C!%22Perpendicular%5C!%22%20)%20)%7D%0A%09%09)%0A)%3B%22%3B%0A%0AEval(%20Parse(%20theExpr%20)%20)%3B%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-443181%22%20slang%3D%22en-US%22%20mode%3D%22UPDATE%22%3E%3CLINGO-LABEL%3E%E3%83%87%E3%83%BC%E3%82%BF%E3%81%AE%E6%8E%A2%E7%B4%A2%E3%81%A8%E8%A6%96%E8%A6%9A%E5%8C%96%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3E%E3%83%9E%E3%82%B9%E3%82%AB%E3%82%B9%E3%82%BF%E3%83%9E%E3%82%A4%E3%82%BC%E3%83%BC%E3%82%B7%E3%83%A7%E3%83%B3%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-443204%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3ERe%EF%BC%9A%E5%88%86%E5%B8%83%E3%83%92%E3%82%B9%E3%83%88%E3%82%B0%E3%83%A9%E3%83%A0%E3%81%AE%E6%A8%AA%E8%BB%B8%E3%81%AE%E3%83%A9%E3%83%99%E3%83%AB%E3%81%AE%E6%96%B9%E5%90%91%E3%82%92%E3%81%99%E3%81%B9%E3%81%A6%E3%81%AE%E3%83%92%E3%82%B9%E3%83%88%E3%82%B0%E3%83%A9%E3%83%A0%E3%81%AB%E5%9E%82%E7%9B%B4%E3%81%AB%E8%A8%AD%E5%AE%9A%E3%81%99%E3%82%8B%E3%81%AB%E3%81%AF%E3%81%A9%E3%81%86%E3%81%99%E3%82%8C%E3%81%B0%E3%82%88%E3%81%84%E3%81%A7%E3%81%99%E3%81%8B%EF%BC%9F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-443204%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3E%E3%81%93%E3%82%8C%E3%81%8C%E7%A7%81%E3%81%8C%E5%8F%96%E3%82%8B%E3%82%A2%E3%83%97%E3%83%AD%E3%83%BC%E3%83%81%E3%81%A7%E3%81%99%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3Edt%20%3D%20currentdatatable()%3B%0A%0Acol%20%3D%20dt%20%26lt%3B%26lt%3B%20get%20column%20names()%3B%0Anc%20%3D%20N%20Items(%20col%20)%3B%0AcolList%20%3D%20%7B%7D%3B%0Abin_width%3D%7B%7D%3B%0A%0AFor(%20i%20%3D%201%2C%20i%20%26lt%3B%3D%20nc%2C%20i%2B%2B%2C%0A%20If(Contains%20(col%5Bi%5D%2C%22%3A%3A%22)%2C%0A%20Insert%20Into(%20colList%2C%20col%5Bi%5D%20))%0A)%3B%0A%0AFor(i%20%3D%201%2C%20i%20%26lt%3B%3D%20N%20Items(colList)%2C%20i%2B%2B%2C%0A%20Insert%20Into(bin_width%2C0.0)%3B%0A%20bin_width%5Bi%5D%20%3D%20Col%20Max(Column(dt%2C%20colList%5Bi%5D))%20-%20Col%20Min(Column(dt%2C%20colList%5Bi%5D))%3B%0A%20bin_width%5Bi%5D%20%3D%20bin_width%5Bi%5D%2F10%3B%0A)%3B%0A%0A%0AtheExpr%20%3D%20%22dis%20%3D%20dt%20%26lt%3B%26lt%3B%20Distribution(Stack(%201%20)%2C%0A%20Continuous%20Distribution(%20column(%20column(dt%2CcolList%5B1%5D))%2C%20Set%20Bin%20Width(bin_width%5B1%5D)%2C%20Label%20Row(%20Label%20Orientation(%20%5C!%22Perpendicular%5C!%22%20)%20))%0A%20%22%3B%0A%0AFor(%20i%20%3D%201%2C%20i%20%26lt%3B%20N%20Items(%20colList%20)%2C%20i%2B%2B%2C%0A%20theExpr%20%3D%20theExpr%20%7C%7C%20%22%2C%20Continuous%20Distribution(%20column(%20column(dt%2C%20colList%5B%22%20%7C%7C%20Char(%20i%20)%20%7C%7C%20%22%5D))%2C%20Set%20Bin%20Width(bin_width%5Bi%5D))%22%0A)%3B%0A%0AEval(%20Parse(%20theExpr%20)%20)%3B%0A%0A(dis%20%26lt%3B%26lt%3B%20xpath(%22%2F%2FAxisBox%22))%20%26lt%3B%26lt%3B%20format(%22Engineering%20SI%22%2C%2010)%3B%0A(dis%20%26lt%3B%26lt%3B%20xpath(%22%2F%2FAxisBox%22))%20%26lt%3B%26lt%3B%20Minor%20Ticks(%200%20)%3B%0A(dis%20%26lt%3B%26lt%3B%20xpath(%22%2F%2FAxisBox%22))%20%26lt%3B%26lt%3B%20Label%20Row(%20Label%20Orientation(%20%22Perpendicular%22%20))%3B%0A%0A%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FLINGO-BODY%3E
Choose Language Hide Translation Bar
breino
Level II

How can I set the orientation of the labels in the horizontal axis of the distribution histogram to be perpendicular to all the histograms?

I am trying to change the orientation of the labels and the format (Engineering SI) for the horizontal axis in the Distribution (histograms) plots. I can do it for the first one using a dispatch statement within the expression that I am building but I need to be able to do it for all of the histograms in the column list.

I tried inserting different types of calls to the column name between the "{}" in:

Dispatch( {},

but none cause the histograms to change. It works if I literally put the column name (i.e. {"My Column"}) only but I want it to do it for all names in the colList array.

 

dt = currentdatatable();

col = dt << get column names();
nc = N Items( col );
colList = {};
bin_width={};

For( i = 1, i <= nc, i++,
	If(Contains (col[i],"::"),
	Insert Into( colList, col[i] ))
);


For(i = 1, i <= N Items(colList), i++,
	Insert Into(bin_width,0.0);
	bin_width[i] = Col Max(Column(dt, colList[i])) - Col Min(Column(dt, colList[i]));
	bin_width[i] = bin_width[i]/10;
);


theExpr = "dis = dt << Distribution(Stack( 1 ),
	Continuous Distribution( column( column(dt,colList[1])), Set Bin Width(bin_width[1]), Label Row( Label Orientation( \!"Perpendicular\!" ) ))
	";

For( i = 2, i < N Items( colList ), i++,
	theExpr = theExpr || ", Continuous Distribution( column( column(dt, colList[" || Char( i ) || "])), Set Bin Width(bin_width[i]))"
);


theExpr = theExpr || ",
	SendToReport(
		Dispatch(
			{},
			\!"1\!",
			ScaleBox,
			{Format( \!"Engineering SI\!", 10 ), Minor Ticks( 0 ),
			Label Row( Label Orientation( \!"Perpendicular\!" ) )}
		)
);";

Eval( Parse( theExpr ) );
1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: How can I set the orientation of the labels in the horizontal axis of the distribution histogram to be perpendicular to all the histograms?

Here is the approach I would take

dt = currentdatatable();

col = dt << get column names();
nc = N Items( col );
colList = {};
bin_width={};

For( i = 1, i <= nc, i++,
	If(Contains (col[i],"::"),
	Insert Into( colList, col[i] ))
);

For(i = 1, i <= N Items(colList), i++,
	Insert Into(bin_width,0.0);
	bin_width[i] = Col Max(Column(dt, colList[i])) - Col Min(Column(dt, colList[i]));
	bin_width[i] = bin_width[i]/10;
);


theExpr = "dis = dt << Distribution(Stack( 1 ),
	Continuous Distribution( column( column(dt,colList[1])), Set Bin Width(bin_width[1]), Label Row( Label Orientation( \!"Perpendicular\!" ) ))
	";

For( i = 1, i < N Items( colList ), i++,
	theExpr = theExpr || ", Continuous Distribution( column( column(dt, colList[" || Char( i ) || "])), Set Bin Width(bin_width[i]))"
);

Eval( Parse( theExpr ) );

(dis << xpath("//AxisBox")) << format("Engineering SI", 10);
(dis << xpath("//AxisBox")) << Minor Ticks( 0 );
(dis << xpath("//AxisBox")) << Label Row( Label Orientation( "Perpendicular" ));

Jim

View solution in original post

2 REPLIES 2
txnelson
Super User

Re: How can I set the orientation of the labels in the horizontal axis of the distribution histogram to be perpendicular to all the histograms?

Here is the approach I would take

dt = currentdatatable();

col = dt << get column names();
nc = N Items( col );
colList = {};
bin_width={};

For( i = 1, i <= nc, i++,
	If(Contains (col[i],"::"),
	Insert Into( colList, col[i] ))
);

For(i = 1, i <= N Items(colList), i++,
	Insert Into(bin_width,0.0);
	bin_width[i] = Col Max(Column(dt, colList[i])) - Col Min(Column(dt, colList[i]));
	bin_width[i] = bin_width[i]/10;
);


theExpr = "dis = dt << Distribution(Stack( 1 ),
	Continuous Distribution( column( column(dt,colList[1])), Set Bin Width(bin_width[1]), Label Row( Label Orientation( \!"Perpendicular\!" ) ))
	";

For( i = 1, i < N Items( colList ), i++,
	theExpr = theExpr || ", Continuous Distribution( column( column(dt, colList[" || Char( i ) || "])), Set Bin Width(bin_width[i]))"
);

Eval( Parse( theExpr ) );

(dis << xpath("//AxisBox")) << format("Engineering SI", 10);
(dis << xpath("//AxisBox")) << Minor Ticks( 0 );
(dis << xpath("//AxisBox")) << Label Row( Label Orientation( "Perpendicular" ));

Jim
breino
Level II

Re: How can I set the orientation of the labels in the horizontal axis of the distribution histogram to be perpendicular to all the histograms?

Thanks Jim that worked perfectly

Recommended Articles