 Application Center - Maplesoft

# Grid Lines in Maple

You can switch back to the summary page by clicking here. GridDisplay Example Worksheet

William Spaetzel

Introduction and Usage

GridDisplay can take any set, sequence or list of plots and will display the plots with appropriate grid lines added to it

Its calling sequence is GridDisplay(L, options) where L is a set, sequence, or list of plot structures

Its options are:
gridcolor=[x color, y color] or gridcolor=both colors

Which sets the color of the grid. Default: grey

ticksperline=[x ticks, y ticks] or ticksperline=both ticks
Which sets the number of tick marks that are drawn per each grid line. Default: 2

gridlines=[x lines, y lines] or gridlines=both lines
Which sets the number of grid lines that are drawn. If this option is left out, the number of gridlines is chosen automatically.

precision=[x value, y value] or precision=both value
Which sets the number of digits to show for the grid labels. Default: 4

gridstyle=[x style, y style] or gridstyle=both style
Which sets the line style used to draw the gridlines, can be one of SOLID, DASH, DOT or DASHDOT, Default: DOT

Examples

 > logplot:=plots[semilogplot](log(x), x=1..10):

 > GridDisplay(logplot, gridlines=[2,3], gridstyle=[SOLID, DASHDOT] ); > squarecos := [plot([x^2, 1/x], x=-5..5, -10..10, discont=true, legend=["Square", "Inverse"] ), plot ( cos(x), x=-10..10, color=black, legend="cos")], plot ( 2*sin(x), x=-8..8, color=red, legend=["2*sin"]):

 > GridDisplay(squarecos, gridcolour=[wheat, COLOR(RGB, 0, 150, 100)], ticksperline=[4,3]); > p := seq(seq(plots[polygonplot]([[i,j],[i+1,j],[i+1,j+1],[i,j+1]],  color=COLOR(RGB,rand()/10^12,rand()/10^12,rand()/10^12)),i=1..10),j=1..10):

 > GridDisplay(p, gridlines=4, ticksperline=[2,9], gridstyle=SOLID, gridcolor=[red,blue]); > cosplot := plot(cos(x), x=-Pi/2..Pi/2):

 > GridDisplay(cosplot, precision=2, gridlines=7); Legal Notice: The copyright for this application is owned by the author(s). Neither Maplesoft nor the author are responsible for any errors contained within and are not liable for any damages resulting from the use of this material. This application is intended for non-commercial, non-profit use only. Contact the author for permission if you wish to use this application in for-profit activities. 