1. NodeBox 1
    1. Homepage
    2. NodeBox 3Node-based app for generative design and data visualization
    3. NodeBox OpenGLHardware-accelerated cross-platform graphics library
    4. NodeBox 1Generate 2D visuals using Python code (Mac OS X only)
  2. Gallery
  3. Documentation
  4. Forum
  5. Blog

Reference | size()

size(w, h)

DescriptionSets the size of the canvas in points. The first parameter sets the width, the second parameter the height. If this command is used, it should be the first line in a script - it's illogical to set the size of the canvas halfway a script! The supplied values can be multiplied by "inch", "cm" or "mm". The predefined WIDTH and HEIGHT variables can be used to obtain the canvas size.
Tutorial Variables

size(400, 600)
# the canvas is 400 X 600 points
print WIDTH # prints 400
print HEIGHT # prints 600
size(20*cm, 20*cm)
# the canvas is 20 x 20 cm