# TSMonitorLGCtxCreate
Creates a TSMonitorLGCtx context for use with TS to monitor the solution process graphically in various ways 
## Synopsis
```
#include "petscts.h"  
PetscErrorCode TSMonitorLGCtxCreate(MPI_Comm comm, const char host[], const char label[], int x, int y, int m, int n, PetscInt howoften, TSMonitorLGCtx *ctx)
```
Collective on TS


## Input Parameters

- ***host -*** the X display to open, or null for the local machine
- ***label -*** the title to put in the title bar
- ***x, y -*** the screen coordinates of the upper left coordinate of the window
- ***m, n -*** the screen width and height in pixels
- ***howoften -*** if positive then determines the frequency of the plotting, if -1 then only at the final time



## Output Parameter

- ***ctx -*** the context



## Options Database Key

- ***-ts_monitor_lg_timestep -*** automatically sets line graph monitor
+  -ts_monitor_lg_timestep_log - automatically sets line graph monitor
- ***-ts_monitor_lg_solution -*** monitor the solution (or certain values of the solution by calling TSMonitorLGSetDisplayVariables() or TSMonitorLGCtxSetDisplayVariables())
- ***-ts_monitor_lg_error -*** monitor the error
- ***-ts_monitor_lg_ksp_iterations -*** monitor the number of KSP iterations needed for each timestep
- ***-ts_monitor_lg_snes_iterations -*** monitor the number of SNES iterations needed for each timestep
- ***-lg_use_markers <true,false> -*** mark the data points (at each time step) on the plot; default is true



## Notes
Use TSMonitorLGCtxDestroy() to destroy.

One can provide a function that transforms the solution before plotting it with TSMonitorLGCtxSetTransform() or TSMonitorLGSetTransform()

Many of the functions that control the monitoring have two forms: TSMonitorLGSet/GetXXXX() and TSMonitorLGCtxSet/GetXXXX() the first take a TS object as the
first argument (if that TS object does not have a TSMonitorLGCtx associated with it the function call is ignored) and the second takes a TSMonitorLGCtx object
as the first argument.

One can control the names displayed for each solution or error variable with TSMonitorLGCtxSetVariableNames() or TSMonitorLGSetVariableNames()




## See Also
 `TSMonitorLGTimeStep()`, `TSMonitorSet()`, `TSMonitorLGSolution()`, `TSMonitorLGError()`, `TSMonitorDefault()`, `VecView()`,
`TSMonitorLGCtxCreate()`, `TSMonitorLGCtxSetVariableNames()`, `TSMonitorLGCtxGetVariableNames()`,
`TSMonitorLGSetVariableNames()`, `TSMonitorLGGetVariableNames()`, `TSMonitorLGSetDisplayVariables()`, `TSMonitorLGCtxSetDisplayVariables()`,
`TSMonitorLGCtxSetTransform()`, `TSMonitorLGSetTransform()`, `TSMonitorLGError()`, `TSMonitorLGSNESIterations()`, `TSMonitorLGKSPIterations()`,
`TSMonitorEnvelopeCtxCreate()`, `TSMonitorEnvelopeGetBounds()`, `TSMonitorEnvelopeCtxDestroy()`, `TSMonitorEnvelop()`


## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/interface/tsmon.c.html#TSMonitorLGCtxCreate">src/ts/interface/tsmon.c</A>

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/tutorials/extchemfield.c.html">src/ts/tutorials/extchemfield.c.html</A><BR>


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


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