# PetscDrawSetViewPort
Sets the portion of the window (page) to which draw routines will write. 
## Synopsis
```
#include "petscdraw.h" 
PetscErrorCode PetscDrawSetViewPort(PetscDraw draw, PetscReal xl, PetscReal yl, PetscReal xr, PetscReal yr)
```
Collective on draw


## Input Parameters

- ***xl -*** the horizontal coordinate of the lower left corner of the subwindow.
- ***yl -*** the vertical coordinate of the lower left corner of the subwindow.
- ***xr -*** the horizontal coordinate of the upper right corner of the subwindow.
- ***yr -*** the vertical coordinate of the upper right corner of the subwindow.
- ***draw -*** the drawing context



## Notes
These numbers must always be between 0.0 and 1.0.

Lower left corner is (0,0).




## See Also
 `PetscDrawGetViewPort(), ``PetscDraw`, `PetscDrawSplitViewPort()`, `PetscDrawViewPortsCreate()`

## Level
advanced

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


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/sys/classes/draw/interface/dviewp.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)  
