Normally user should set it to zero by SetWarn(0); before plotting and check if GetWarn() or Message() return non zero after plotting. Only last warning will be saved. All warnings/errors produced by MathGL is not critical – the plot just will not be drawn. By default, all warnings are printed in stderr. You can disable it by using mgl_suppress_warn(true);.
mglGraph: void SetWarn (int code, const char *info="") ¶void mgl_set_warn (HMGL gr, int code, const char *info) ¶Set warning code. Normally you should call this function only for clearing the warning state, i.e. call SetWarn(0);. Text info will be printed as is if code<0.
mglGraph: const char *Message () ¶const char *mgl_get_mess (HMGL gr) ¶ mgl_get_mess (long gr, char *out, int len) ¶Return messages about matters why some plot are not drawn. If returned string is empty then there are no messages.
mglGraph: int GetWarn () ¶int mgl_get_warn (HMGL gr) ¶Return the numerical ID of warning about the not drawn plot. Possible values are:
mglWarnNone=0Everything OK
mglWarnDimData dimension(s) is incompatible
mglWarnLowData dimension(s) is too small
mglWarnNegMinimal data value is negative
mglWarnFileNo file or wrong data dimensions
mglWarnMemNot enough memory
mglWarnZeroData values are zero
mglWarnLegNo legend entries
mglWarnSlcSlice value is out of range
mglWarnCntNumber of contours is zero or negative
mglWarnOpenCouldn’t open file
mglWarnLIdLight: ID is out of range
mglWarnSizeSetsize: size(s) is zero or negative
mglWarnFmtFormat is not supported for that build
mglWarnTernAxis ranges are incompatible
mglWarnNullPointer is NULL
mglWarnSpcNot enough space for plot
mglScrArgWrong argument(s) of a command in MGL script
mglScrCmdWrong command in MGL script
mglScrLongToo long line in MGL script
mglScrStrUnbalanced ’ in MGL script
mglScrTempChange temporary data in MGL script
mglGraph: void SuppressWarn (bool state) static ¶void mgl_suppress_warn (int state) ¶Disable printing warnings to stderr if state is nonzero.
mglGraph: void SetGlobalWarn (const char *info) static ¶void mgl_set_global_warn (const char *info) ¶Set warning message info for global scope.