JSXGraph logo
JSXGraph
JSXGraph share

Share

Bounding box
QR code
<iframe 
    src="https://www.jsxgraph.org/share/iframe/bounding-box" 
    style="border: 1px solid black; overflow: hidden; width: 550px; aspect-ratio: 55 / 65;" 
    name="JSXGraph example: Bounding box" 
    allowfullscreen
></iframe>
This code has to
<div id="board-0-wrapper" class="jxgbox-wrapper " style="width: 100%; ">
   <div id="board-0" class="jxgbox" style="aspect-ratio: 10 / 12; width: 100%;" data-ar="10 / 12"></div>
</div>

<script type = "text/javascript"> 
    /*
    This example is not licensed.
    */
    
    const BOARDID = 'board-0';

    var board = JXG.JSXGraph.initBoard(BOARDID, {
        boundingbox: [-5, 10, 5, -2],
        axis: true
    });
 </script> 
/*
This example is not licensed.
*/

const BOARDID = 'your_div_id'; // Insert your id here!

var board = JXG.JSXGraph.initBoard(BOARDID, {
    boundingbox: [-5, 10, 5, -2],
    axis: true
});
<jsxgraph width="100%" aspect-ratio="10 / 12" title="Bounding box" description="This construction was copied from JSXGraph examples database: BTW HERE SHOULD BE A GENERATED LINKuseGlobalJS="false">
   /*
   This example is not licensed.
   */
   
   var board = JXG.JSXGraph.initBoard(BOARDID, {
       boundingbox: [-5, 10, 5, -2],
       axis: true
   });
</jsxgraph>

Bounding box

The bounding box defines the viewport of the board, i.e. the portion of the $\mathbb{R}^2$ that is shown. The JavaScript code ~~~ var board = JXG.JSXGraph.initBoard('jxgbox', { boundingbox:[-5,10,5,-2], keepaspectratio: true, axis:true }); ~~~ sets the vertical and horizontal units and the position of the origin such that the upper left corner of the drawing panel has coordinates $(-5,10)$ and the lower right corner of the drawing panel has coordinates $(5,-2)$.
// Define the id of your board in BOARDID

var board = JXG.JSXGraph.initBoard(BOARDID, {
    boundingbox: [-5, 10, 5, -2],
    axis: true
});

This example is not licensed.