Shapes and Colors in NetLogo

 

For some phenomena, modeling the way agents look is almost as important as modeling how they behave. For others, creating pleasing and creative visualizations may simply augment our enjoyment of the modeling process and help us communicate our ideas better with others.

NetLogo includes a Turtle Shapes Editor, a Link Shapes editor, and a Color Swatches panel that allow us to create agent-based models that do not only represent real-world phenomena conceptually, but also create powerful visualizations of our agents. If you would like to learn more about how to use the shapes editors and the color swatches, read along.

Note: You can visit the NetLogo User Manual at https://ccl.northwestern.edu/netlogo/docs/ for more information on Shapes and Colors*

 


 

Turtle Shapes

In NetLogo, turtle shapes are vector shapes. They are built up from basic geometric shapes; squares, circles, and lines, rather than a grid of pixels. This way, when we resize a turtle, its image does not loose quality (i.e., does not become pixelated).

 

Default Shapes

NetLogo already has a lot of pre-designed shapes for us to use. Some of these shapes, called default shapes are embedded within each new NetLogo model. These shapes are:

Default NetLogo Shapes

And the names of these shapes are:

 

Turtle Shapes Library

NetLogo has way more turtle shapes than the default ones for us to choose from. All we need to do is to click the Import From Library button, which will bring up a long list of shapes to choose from.

Shapes Library

 

Creating new shapes and editing existing ones

If none of the shapes in the library fits our model, we can create new shapes from scratch by clicking the New button and drawing our own shape.

New Shape Designer

 

A few things to keep in mind while using the New Shape Editor:

 

For more detailed information, visit the Shapes Editor section of the NetLogo User Manual at https://ccl.northwestern.edu/netlogo/docs/shapes.html.

 


 

Colors

NetLogo has a custom way of representing colors that makes it easier to remember how to use them in code and how to manipulate color. Each color is assigned a number in the range 0 to 140, with the exception of 140 itself. The best way to familiarize ourselves with NetLogo colors is to click the Tools menu and pick the Color Swatches option, which will bring up a window that contains an interactive version of the following image that shows the corresponding number for each color and it's shades:

 

NetLogo Colors

 

Things to keep in mind while using NetLogo colors in code:

 

For more detailed information, visit the Colors section of the NetLogo User Manual's Programming Guide Section at at https://ccl.northwestern.edu/netlogo/docs/programming.html#colors.

 


 

Link Shapes

NetLogo also allows us to go beyond the simple straight lines and define a variety of custom link shapes for our models. To create new link shapes, click the Tools menu and click the Link Shapes Editor item. You will

 

Link Shape Designer

 

In contrast to turtle shapes, NetLogo only has one standard link shape and there is no library, either. If we want to use a link shape other than straight line, we either need to create it from scratch by clicking the New button or import it from a previously developed model by clicking the Import from Model button.

Things to keep in mind while using the Link Shapes Editor:

 

For more detailed information, visit the Shapes Editor section of the NetLogo User Manual at https://ccl.northwestern.edu/netlogo/docs/shapes.html#creating-and-editing-link-shapes.