:orphan:
# PetscViewerDrawSetBounds
sets the upper and lower bounds to be used in plotting in a `PETSCVIEWERDRAW` `PetscViewer`
## Synopsis
```
#include "petscdraw.h"
#include "petscviewer.h"
PetscErrorCode PetscViewerDrawSetBounds(PetscViewer viewer, PetscInt nbounds, const PetscReal *bounds)
```
Collective
## Input Parameters
- ***viewer -*** the Petsc`Viewer` (created with `PetscViewerDrawOpen()`)
- ***nbounds -*** number of plots that can be made with this viewer, for example the dof passed to `DMDACreate()`
- ***bounds -*** the actual bounds, the size of this is 2*`nbounds`, the values are stored in the order min F_0, max F_0, min F_1, max F_1, .....
## Options Database Key
- ***-draw_bounds minF0,maxF0,minF1,maxF1 -*** the lower left and upper right bounds
## Note
this determines the colors used in 2d contour plots generated with VecView() for `DMDA` in 2d. Any values in the vector below or above the
bounds are moved to the bound value before plotting. In this way the color index from color to physical value remains the same for all plots generated with
this viewer. Otherwise the color to physical value meaning changes with each new image if this is not set.
## See Also
[](sec_viewers), `PETSCVIEWERDRAW`, `PetscViewerDrawGetLG()`, `PetscViewerDrawGetAxis()`, `PetscViewerDrawOpen()`
## Level
intermediate
## Location
src/sys/classes/viewer/impls/draw/drawv.c
## Examples
src/ts/tutorials/ex2.c
src/ts/tutorials/ex21.c
---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/sys/classes/viewer/impls/draw/drawv.c)
[Index of all Viewer routines](index.md)
[Table of Contents for all manual pages](/manualpages/index.md)
[Index of all manual pages](/manualpages/singleindex.md)