Frame and Canvas
Hereafter are presented the available frame and canvas options for two dimensional graphs in mathlayer®.
Graph dimensions and background
Defining the width, height, paddings and colors of the graph.Options | Description | Values | Default Values |
width height | Sets the graph dimensions. | width: percentage: 0-1 pixel: >1 height: Any numerical value. | width: 600 height: 450 |
paddingLeft paddingRight paddingTop paddingBottom | Sets the graph paddings. | Any numerical value. | paddingLeft, paddingRight and paddingBottom: 80 paddingTop: 30 |
backgroundColor | Sets the background color. | Any color in Hex, RGB or HSL representation. | 'white' |
bodyColor | Sets a color for the body of the page. | Any color in Hex, RGB or HSL representation. | 'white' |
vertical | Rotate graph 90 degrees. | true or false. | false |
rotate | Rotete graph. | Values from 0 to 360. | 0 |
o = struct% initializing options struct
o.width = 400 o.height = 400 o.paddingTop = 80 o.backgroundColor = '#cccccc' o.vertical = true plot([1 6 4 3],o)
Canvas
Defining the colors of the canvas.Options | Description | Values | Default Values |
canvasOpacity | Sets the opacity of the canvas. | Any value from 0 to 1. | 1 |
canvasColor | Sets the color of the canvas. | Any color in Hex, RGB or HSL representation. | 'white' |
showSquaredCanvas | Sets limit lines for the canvas. | true or false. | false |
showGrid showGridX showGridY | Sets a grid for the canvas. | true or false. | false |
gradient | Sets a canvas that has a graduated color. | true or false. | false |
gradientColor1 gradientColor2 | Set a canvas that has a graduated color from gradientColor1 to gradientColor2. | Any color in Hex, RGB or HSL representation. | 'white' |
o = struct% initializing options struct
o.gradient = true o.gradientColor1 = 'rgb(198, 236, 198)' o.gradientColor2 = 'white' o.canvasOpacity = 0.8 o.showSquaredCanvas = true o.showGridY = true x = 0:0.1:4*pi plot(x,sin(x),o)