Bug patch: Axis position in arrays of plots

Plots with hfarrays in arrays of plots
View option in arrays of plots

This Maple Advisor Database procedure displayarraypatch installs a patch to correct three bugs in the display of arrays of plots.

• When an array of two-dimensional plots is displayed, each plot's axis labels are near the centre of the plot. This may be a reasonable position if they are normal axes halfway between the edges of the plot, but otherwise it is not.

> with(plots):

```Warning, the name changecoords has been redefined
```

> p1:= plot(x,x=-2..2,labels=[x,y]):
p2:= plot(x,x=0..5,labels=[x,y]):
display(array([[p1,p2],[p2,p1]]));

The patch makes the positions of the axes in arrays of plots adjustable. This is accomplished using two global variables `plotarray/xaxis` and `plotarray/yaxis` . The initial values of these variables are [5, -1] and [-2, 5], corresponding to the default axis locations. Each is a list whose two entries are the x and y coordinates of the label, where [0,0] is the centre of the plot. For boxed or framed axes you might try

> `plotarray/xaxis`:= [3, -13]:
`plotarray/yaxis`:= [-13,3]:

> display(array([[p1,p2],[p2,p1]]),axes=box);

• The second bug is that two-dimensional plots containing hfarrays are not displayed correctly. Such plots are produced, for example, by densityplot in the plots package and by quickplot in the Maple Advisor Database. This is before using the patch:

> A:= densityplot(x,x=0..1,y=0..1):
B:= quickplot(hfarray([[0,0],[1,1],[2,0]])):
display(array([A,B]));

Here is the result with the patch installed.

> display(array([A,B]));

• The third bug is that the view option in the individual plots is not effective. This is before using the patch:

> A:= plot(x,x=0..1,view=[0..1/2,0..1/2]):
B:= plot(x,x=0..1,view=[1/2..1,1/2..1]):
display(array([A,B]));

Here it is with the patch installed:

> A:= plot(x,x=0..1,view=[0..1/2,0..1/2]):
B:= plot(x,x=0..1,view=[1/2..1,1/2..1]):
display(array([A,B]));

For copyright reasons, displayarraypatch is a procedure that produces new versions of the original Maple library procedures `plot/plotarray/object` and `plots/display_array` : we don't include those procedures themselves in the Maple Advisor Database. Running displayarraypatch() once will save the new versions of `plot/plotarray/object` and `plots/display_array` into a library (which could be the Maple Advisor Database library - saving them into Maple's own "lib" library is not recommended). Then (as long as this library's directory is present in your libname before Maple's own "lib" directory), the patched procedures will be used. The directory to be used is the value of savelibname , if that has been assigned a value, otherwise the first one in libname . I recommend that your "advisor" directory containing the Maple Advisor Database files be the first member of libname , so in most cases the corrected procedure will go there. If necessary, assign a new value to savelibname before running displayarraypatch .