{VERSION 4 0 "IBM INTEL NT" "4.0" } {USTYLETAB {CSTYLE "Maple Input" -1 0 "Courier" 0 1 255 0 0 1 0 1 0 0 1 0 0 0 0 1 }{CSTYLE "2D Math" -1 2 "Times" 0 1 0 0 0 0 0 0 2 0 0 0 0 0 0 1 }{CSTYLE "Hyperlink" -1 17 "" 0 1 0 128 128 1 2 0 1 0 0 0 0 0 0 1 }{CSTYLE "2D Comment" 2 18 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 } {CSTYLE "" 0 21 "" 0 1 0 0 0 1 0 0 0 0 2 0 0 0 0 1 }{CSTYLE "Help Head ing" -1 26 "" 1 14 0 0 0 0 0 1 0 0 0 0 0 0 0 1 }{PSTYLE "Normal" -1 0 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }1 1 0 0 0 0 1 0 1 0 2 2 0 1 }{PSTYLE "Heading 1" -1 3 1 {CSTYLE "" -1 -1 "Time s" 1 18 0 0 0 1 2 1 2 2 2 2 1 1 1 1 }1 1 0 0 8 4 1 0 1 0 2 2 0 1 } {PSTYLE "Bullet Item" -1 15 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }1 1 0 0 3 3 1 0 1 0 2 2 15 2 }{PSTYLE "Normal" -1 256 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }3 1 0 0 0 0 1 0 1 0 2 2 0 1 }} {SECT 0 {SECT 0 {PARA 0 "" 0 "" {TEXT 26 9 "Function:" }{TEXT -1 32 " \+ crop - restrict a plot to a box" }}{PARA 0 "" 0 "" {TEXT 26 17 "Callin g sequence:" }{TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 50 "crop(P,[a.. b,c..d],x);\ncrop(P,[a..b,c..d,e..f],x);" }}{PARA 0 "" 0 "" {TEXT 26 11 "Parameters:" }}{PARA 0 "" 0 "" {TEXT -1 2 " " }{MPLTEXT 0 21 1 "P " }{TEXT -1 45 " - a two- or three-dimensional plot structure" }} {PARA 0 "" 0 "" {TEXT -1 2 " " }{MPLTEXT 0 21 16 "a, b, c, d, e, f" } {TEXT -1 37 " - real constants (possibly infinite)" }}{PARA 0 "" 0 "" {TEXT -1 2 " " }{MPLTEXT 0 21 1 "x" }{TEXT -1 22 " - (optional) anyth ing" }}}{SECT 0 {PARA 3 "" 0 "" {TEXT 26 12 "Description:" }}{PARA 15 "" 0 "" {TEXT -1 98 "This procedure takes a plot and removes all parts of it that lie outside a given rectangular box: " }{XPPEDIT 18 0 "a < = x" "6#1%\"aG%\"xG" }{XPPEDIT 18 0 "`` <= b;" "6#1%!G%\"bG" }{TEXT -1 2 ", " }{XPPEDIT 18 0 "c <= y" "6#1%\"cG%\"yG" }{XPPEDIT 18 0 "`` < = d;" "6#1%!G%\"dG" }{TEXT -1 27 " and (in three dimensions) " } {XPPEDIT 18 0 "e <= z" "6#1%\"eG%\"zG" }{XPPEDIT 18 0 "``<=f" "6#1%!G% \"fG" }{TEXT -1 1 "." }}{PARA 15 "" 0 "" {TEXT -1 44 "Visually the eff ect is similar to using the " }{MPLTEXT 0 21 4 "view" }{TEXT -1 28 " o ption. However, when the " }{MPLTEXT 0 21 4 "view" }{TEXT -1 185 " op tion is used the rest of the plot is still present, only the rendering system is instructed not to show it. This can cause problems when th e plot is combined with other plots using " }{MPLTEXT 0 21 7 "display " }{TEXT -1 1 "." }}{PARA 15 "" 0 "" {TEXT -1 33 "The Maple Advisor Da tabase patch " }{MPLTEXT 0 21 17 "displayarraypatch" }{TEXT -1 6 " use s " }{MPLTEXT 0 21 4 "crop" }{TEXT -1 70 " automatically to handle arr ays of plots where some plots include the " }{MPLTEXT 0 21 4 "view" } {TEXT -1 8 " option." }}{PARA 15 "" 0 "" {TEXT -1 31 "If the optional \+ third argument " }{MPLTEXT 0 21 1 "x" }{TEXT -1 176 " is present, invi sible (zero-length) curves are added at corners of the box so that the complete box is shown, even if a smaller box would suffice to show th e visible objects. " }}{PARA 15 "" 0 "" {TEXT -1 4 "The " }{MPLTEXT 0 21 4 "crop" }{TEXT -1 166 " procedure works with all plot elements: po ints, curves, polygons, surfaces (GRID, MESH and ISOSURFACE structures ) and text, produced by any of the plotting commands." }}{PARA 15 "" 0 "" {TEXT -1 182 "Text is removed if the associated point is outside \+ the box. No attempt is made to check what part of the actual text fit s inside the box (that could vary, as plots can be resized). " }} {PARA 15 "" 0 "" {TEXT -1 148 "Curves or polygons are truncated correc tly at the edges of the box. In the case of three-dimensional GRID, M ESH or ISOSURFACE structures, however, " }{MPLTEXT 0 21 4 "crop" } {TEXT -1 254 " acts by making vertices outside the box undefined. Thi s removes all surface elements that have one or more vertices outside \+ the box. Thus the edge of the remaining surface may be rather ragged, and may not extend all the way to the sides of the box. " }}{PARA 15 "" 0 "" {TEXT -1 53 "This procedure is part of the Maple Advisor Da tabase." }}}{SECT 0 {PARA 3 "" 0 "" {TEXT 26 9 "Examples:" }}{PARA 0 " " 0 "" {TEXT -1 39 "Two plots, and their combination using " } {MPLTEXT 0 21 7 "display" }{TEXT -1 1 "." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 109 "A:= plot(x,x=0..1,colour=red): \nB:= plot(1-x,x=0..1 ,colour=blue):\nplots[display]([A,B],scaling=constrained); " }}}{PARA 0 "" 0 "" {TEXT -1 4 "The " }{MPLTEXT 0 21 4 "view" }{TEXT -1 201 " op tion works on each individually, but not with the combination: it uses the largest rectangle containing both of the view rectangles, which i n this case contains more of the red line than we ask for." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 158 "Av:= plot(x,x=0..1,colour=red,view =[0..0.5,0..0.5]): \nBv:=plot(1-x,x=0..1,colour=blue,view=[0.2..0.8,0. 2..0.8]):\nplots[display]([Av,Bv],scaling=constrained); " }}}{PARA 0 " " 0 "" {TEXT -1 41 "Combining plots together with the use of " } {MPLTEXT 0 21 4 "crop" }{TEXT -1 1 "." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 115 "Ac:= crop(A,[0..0.5,0..0.5]): \nBc:= crop(B,[0.2 .. \+ 0.8, 0.2 .. 0.8]): \nplots[display]([Ac,Bc],scaling=constrained);" }}} {PARA 0 "" 0 "" {TEXT -1 59 "An example with a line segment, points, t ext and a polygon." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 269 "P:= p lots[display](\{plot([[0,0],[10,10]],colour=red),\nplots[pointplot](\{ seq([i,i+1],i=0..10)\},colour=black,\n symbol=box), plots[polygonplot ]([seq([i,(i-5)^2/2],i=0..10)],\n colour=cyan),\nplots[textplot](\{se q([i, i-1, convert(i,string)], i=0..10)\}, colour=blue)\}): P;" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 24 "crop(P,[1 .. 5,3 .. 5]);" }} }{PARA 0 "" 0 "" {TEXT -1 73 "Using the optional third argument to ens ure the whole box is in the plot:" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 25 "crop(P,[1..5,3..5],true);" }}}{PARA 0 "" 0 "" {TEXT -1 28 "A three-dimensional example:" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 419 "Q:= plots[display](\{\n plots[spacecurve]([[0,0,-3], [0,0,3]], colour=green),\n plots[tubeplot]([2*cos(t),2*sin(t),0],t=0.. 2*Pi,\n radius=1),\n plots[pointplot3d]([seq([2*cos(j*Pi/5),\n 2*s in(j*Pi/5),2], j=0..9)], symbol=box,\n symbolsize=15, colour=blue), \nplots[textplot3d](\{seq([2*cos(j*Pi/5),2*sin(j*Pi/5),3,\n convert( [65+j],bytes)], j=0..9)\}, colour=red)\},\nscaling=constrained): Q; cr op(Q,[0..3,-3..3,0..infinity]);" }{TEXT -1 0 "" }}}{PARA 0 "" 0 "" {TEXT -1 49 "Ragged edges caused by removing surface elements." }} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 30 "crop(Q,[-1.5..3,-3..3,-1..1] );" }{TEXT -1 0 "" }}}}{SECT 0 {PARA 0 "" 0 "" {TEXT 26 9 "See also:" }{TEXT -1 1 " " }{HYPERLNK 17 "display" 2 "plots,display" "" }{TEXT -1 1 "," }{TEXT -1 1 " " }{TEXT -1 0 "" }{HYPERLNK 17 "plot[options]" 2 "plot,options" "" }{TEXT -1 2 ", " }{HYPERLNK 17 "plot[structure]" 2 "plot,structure" "" }{TEXT -1 2 ", " }{HYPERLNK 17 "plots" 2 "plots " "" }{TEXT -1 2 ", " }{HYPERLNK 17 "View option in arrays of plots" 2 "View_option_in_arrays_of_plots" "" }}}{SECT 0 {PARA 0 "" 0 "" {TEXT 26 24 "Maple Advisor Database " }{TEXT -1 15 "R. Israel, 2000" }}}}{MARK "2 13 0 0" 139 }{VIEWOPTS 1 1 0 1 1 1803 1 1 1 1 } {PAGENUMBERS 0 1 2 33 1 1 }