# PetscDrawRectangle
draws a rectangle  onto a drawable. 
## Synopsis
```
#include "petscdraw.h" 
PetscErrorCode PetscDrawRectangle(PetscDraw draw, PetscReal xl, PetscReal yl, PetscReal xr, PetscReal yr, int c1, int c2, int c3, int c4)
```
Not Collective


## Input Parameters

- ***draw -*** the drawing context
- ***xl,yl,xr,yr -*** the coordinates of the lower left, upper right corners
- ***c1,c2,c3,c4 -*** the colors of the four corners in counter clockwise order





## See Also
 `PetscDraw`, `PetscDrawLine()`, `PetscDrawRectangle()`, `PetscDrawTriangle()`, `PetscDrawEllipse()`,
`PetscDrawMarker()`, `PetscDrawPoint()`, `PetscDrawString()`, `PetscDrawPoint()`, `PetscDrawArrow()`

## Level
beginner

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/classes/draw/interface/drect.c.html#PetscDrawRectangle">src/sys/classes/draw/interface/drect.c</A>

## Implementations

<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/classes/draw/impls/image/drawimage.c.html#PetscDrawRectangle_Image">PetscDrawRectangle_Image in src/sys/classes/draw/impls/image/drawimage.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/classes/draw/impls/null/drawnull.c.html#PetscDrawRectangle_Null">PetscDrawRectangle_Null in src/sys/classes/draw/impls/null/drawnull.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/classes/draw/impls/tikz/tikz.c.html#PetscDrawRectangle_TikZ">PetscDrawRectangle_TikZ in src/sys/classes/draw/impls/tikz/tikz.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/classes/draw/impls/win32/win32draw.c.html#PetscDrawRectangle_Win32">PetscDrawRectangle_Win32 in src/sys/classes/draw/impls/win32/win32draw.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/classes/draw/impls/x/xops.c.html#PetscDrawRectangle_X">PetscDrawRectangle_X in src/sys/classes/draw/impls/x/xops.c</A><BR>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/sys/classes/draw/interface/drect.c)


[Index of all Draw routines](index.md)  
[Table of Contents for all manual pages](/docs/manualpages/index.md)  
[Index of all manual pages](/docs/manualpages/singleindex.md)  
