# Two-Dimensional Graphics Elements

Point[{x,y}] | point at position x, y |

Line[{{x_{1},y_{1}},{x_{2},y_{2}},...}] | line through the points , , ... |

Rectangle[{x_{min},y_{min}},{x_{max},y_{max}}] | filled rectangle |

Polygon[{{x_{1},y_{1}},{x_{2},y_{2}},...}] | filled polygon with the specified list of corners |

Circle[{x,y},r] | circle with radius r centered at x, y |

Disk[{x,y},r] | filled disk with radius r centered at x, y |

Raster[{{a_{11},a_{12},...},{a_{21},...},...}] | rectangular array of gray levels between 0 and 1 |

Text[expr,{x,y}] | the text of expr, centered at x, y (see "Graphics Primitives for Text") |

Basic two-dimensional graphics elements.

In[1]:= |

Out[1]= |

In[2]:= |

Out[2]= |

In[3]:= |

Out[3]= |

You can combine graphics objects that you have created explicitly from graphics primitives with ones that are produced by functions like Plot.

In[4]:= |

Out[4]= |

In[5]:= |

Out[5]= |

You can combine different graphical elements simply by giving them in a list. In two-dimensional graphics, *Mathematica* will render the elements in exactly the order you give them. Later elements are therefore effectively drawn on top of earlier ones.

In[6]:= |

Out[6]= |

In[7]:= |

Out[7]= |

The Polygon graphics primitive takes a list of , coordinates, corresponding to the corners of a polygon. *Mathematica* joins the last corner with the first one, and then fills the resulting area.

In[8]:= |

Out[8]= |

In[9]:= |

Out[9]= |

Point[{pt_{1},pt_{2},...}] | a multipoint consisting of points at , , ... |

Line[{line_{1},line_{2},...}] | a multiline consisting of lines , , ... |

Polygon[{poly_{1},poly_{2},...}] | a multipolygon consisting of polygons , , ... |

Primitives which can take multiple elements.

A large number of points can be represented by putting a list of coordinates inside of a single Point primitive. Similarly, a large number of lines or polygons can be represented as a list of coordinate lists. This representation is efficient and can generally be rendered more quickly by the *Mathematica* front end. Graphics directives such as RGBColor apply uniformly to the entire set of primitives.

In[10]:= |

Out[10]= |

In[11]:= |

Out[11]= |

Circle[{x,y},r] | a circle with radius r centered at the point |

Circle[{x,y},{r_{x},r_{y}}] | an ellipse with semiaxes and |

Circle[{x,y},r,{theta_{1},theta_{2}}] | a circular arc |

Circle[{x,y},{r_{x},r_{y}},{theta_{1},theta_{2}}] | an elliptical arc |

Disk[{x,y},r], etc. | filled disks |

In[12]:= |

Out[12]= |

In[13]:= |

Out[13]= |

*Mathematica* allows you to generate arcs of circles and segments of ellipses. In both cases, the objects are specified by starting and finishing angles. The angles are measured counterclockwise in radians with zero corresponding to the positive direction.

In[14]:= |

Out[14]= |

Raster[{{a_{11},a_{12},...},{a_{21},...},...}] | array of gray levels between 0 and 1 |

Raster[{{{a_{11},o_{11}},...},...}] | array of gray levels with opacity between 0 and 1 |

Raster[{{{r_{11},g_{11},b_{11}},...},...}] | array of rgb values between 0 and 1 |

Raster[{{{r_{11},g_{11},b_{11},o_{11}},...},...}] | array of rgb values with opacity between 0 and 1 |

Raster[array,{{x_{min},y_{min}},{x_{max},y_{max}}},{z_{min},z_{max}}] | array of gray levels between and drawn in the rectangle defined by and |

Raster-based graphics elements.

In[15]:= |

Out[15]= |

In[16]:= |

Out[16]= |

In[17]:= |

Out[17]= |

In[18]:= |

Out[18]= |