:orphan:
# KSPMonitorSNESResidualDrawLG
Plots the linear `KSP` residual norm and the `SNES` residual norm at each iteration of an iterative solver. 
## Synopsis
```
#include "petsc/private/snesimpl.h"   
PetscErrorCode KSPMonitorSNESResidualDrawLG(KSP ksp, PetscInt n, PetscReal rnorm, PetscViewerAndFormat *vf)
```
Collective


## Input Parameters

- ***ksp   -*** iterative context
- ***n     -*** iteration number
- ***rnorm -*** 2-norm (preconditioned) residual value (may be estimated).
- ***vf    -*** The viewer context, created with `KSPMonitorSNESResidualDrawLGCreate()`



## Options Database Key

- ***-snes_monitor_ksp draw::draw_lg -*** Activates `KSPMonitorSNESResidualDrawLG()`





## Note
This is not called directly by users, rather one calls `SNESMonitorSet()`, with this function as an argument, to cause the monitor
to be used during the `SNESSolve()`


## See Also
 [](ch_snes), `KSPMonitorSet()`, `KSPMonitorTrueResidual()`, `SNESMonitor()`, `KSPMonitor()`, `KSPMonitorSNESResidualDrawLGCreate()`

## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/snes/interface/snesut.c.html#KSPMonitorSNESResidualDrawLG">src/snes/interface/snesut.c</A>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/snes/interface/snesut.c)


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