문제
나는 간행물을 위해 이 그림을 만들고 싶었다

해결책
수직 방향의 음영/채움 및 잘린 법선 곡선을 만들기 위해 Polygon() 그래픽 기능을 사용했습니다.문제는 크기가 조정되고 그래프에 적절하게 배치된 다각형을 쉽고 반복적으로 만들 수 있는 것이었습니다.이 기능을 사용하여이 작업을 수행했습니다.
func_VNormalShape = Function( // create a polygon that looks like a vertically oriented normal distribution
{_xloc, _yloc, _xscale = 1, _yscale = 1},
{_VNormShapeX, _VNormShapeY},
// create a vector of y values to use for plotting the shape
_VNormShapeY = ((_yloc - 3 * _yscale) :: (_yloc + 3 * _yscale) :: (_yscale / 10))`;
// create the filled polygon boundary points
_VNormShapeX = V Concat(
J( 61, 1, _xloc ),
_xloc + Sqrt( 2 * Pi() ) * _yscale * _xscale * Normal Density(
Sort Descending( _VNormShapeY ),
_yloc,
_yscale
)
);
_VNormShapeY = V Concat(
_VNormShapeY,
Sort Descending( _VNormShapeY )
);
// substitute into the Polygon(function) the two vectors with the boundary point X and Y values
// and evaluate the function
Eval(
Substitute(
Expr(
Polygon( Expr( shape_x ), Expr( shape_y ) )
),
Expr( shape_x ), _VNormShapeX,
Expr( shape_y ), _VNormShapeY
)
);
); 함수의 처음 두 인수는 그릴 분포의 "원점" 또는 위치를 지정합니다(즉, 분포의 중심 기준에 대한 (x,y) 위치).두 번째 선택적 인수는 분포 크기의 스케일링입니다.기본 크기는 표준 정규 분포를 기반으로 하며 배율은 x 방향과 y 방향에 상대적입니다.
함수의 결과는 그래픽 스크립트가 분포를 다각형으로 그리는 데 사용한 평가된 표현식입니다.
예:
func_VNormalShape(1,3)은 x=1, y=3에 중심을 둔 세로 방향 표준 정규 분포에 대한 다각형 문을 만듭니다.
func_VNormalShape(2,4, 0.5, 1.5)는 x=2, y=5를 중심으로 분포를 생성하지만 가로 너비는 0.5배 축소되고 세로 너비는 1.5배 확대됩니다.
논의
다음은 전체 그래픽의 일부를 만드는 전체 스크립트입니다.이 스크립트의 출력을 이미지 파일로 저장한 다음 파워포인트로 가져와 일부 주석을 추가하고 게시물 상단에 표시된 그래픽에 도달했습니다.
names default to here(1);
func_VNormalShape = Function( // create a polygon that looks like a vertically oriented normal distribution
{_xloc, _yloc, _xscale = 1, _yscale = 1},
{_VNormShapeX, _VNormShapeY},
// create a vector of y values to use for plotting the shape
_VNormShapeY = ((_yloc - 3 * _yscale) :: (_yloc + 3 * _yscale) :: (_yscale / 10))`;
// create the filled polygon boundary points
_VNormShapeX = V Concat(
J( 61, 1, _xloc ),
_xloc + Sqrt( 2 * Pi() ) * _yscale * _xscale * Normal Density(
Sort Descending( _VNormShapeY ),
_yloc,
_yscale
)
);
_VNormShapeY = V Concat(
_VNormShapeY,
Sort Descending( _VNormShapeY )
);
// substitute into the Polygon(function) the two vectors with the boundary point X and Y values
// and evaluate the function
Eval(
Substitute(
Expr(
Polygon( Expr( shape_x ), Expr( shape_y ) )
),
Expr( shape_x ), _VNormShapeX,
Expr( shape_y ), _VNormShapeY
)
);
);
_nw=new window("Figure",
_ob=Outline Box("Figure",
_gb=Graph Box(
suppressaxes,
x scale(0,5),
y scale(-1,11),
Xname(""),
Yname(""),
fill color("gray");
func_VNormalShape(1, 8, .75, .75);
line({1,8}, {1.75, 8});
func_VNormalShape(2, 6, .75, .75);
line({2,6}, {2.75, 6});
func_VNormalShape(3, 4, .75, .75);
line({3,4}, {3.75, 4});
func_VNormalShape(4, 2, .75, .75);
line({4,2}, {4.75, 2});
linestyle(1);
Pen Size(2);
line({0.5, 5}, {4.5, 5});
)
)
);
_gb[FrameBox(1)]<<{top(0), bottom(0), left(0), right(0)};결과 출력:

또한보십시오
오늘은 제 모습을 만들려고 빼냈을 때 정말 편리해서 따로 또 공유하고 싶었습니다.