MCPcopy Create free account
hub / github.com/creatale/node-dv / gplotSimpleXYN

Function gplotSimpleXYN

deps/leptonica/src/gplot.c:778–814  ·  view source on GitHub ↗

! * \brief gplotSimpleXYN() * * \param[in] nax [optional]; can be NULL * \param[in] naay numaa of arrays to plot against %nax * \param[in] plotstyle GPLOT_LINES, GPLOT_POINTS, GPLOT_IMPULSES, * GPLOT_LINESPOINTS, GPLOT_DOTS * \param[in] outformat GPLOT_PNG, GPLOT_PS, GPLOT_EPS, GPLOT_LATEX * \param[in] outroot root of output files * \param[in] t

Source from the content-addressed store, hash-verified

776 * </pre>
777 */
778l_int32
779gplotSimpleXYN(NUMA *nax,
780 NUMAA *naay,
781 l_int32 plotstyle,
782 l_int32 outformat,
783 const char *outroot,
784 const char *title)
785{
786l_int32 i, n;
787GPLOT *gplot;
788NUMA *nay;
789
790 PROCNAME("gplotSimpleXYN");
791
792 if (!naay)
793 return ERROR_INT("naay not defined", procName, 1);
794 if ((n = numaaGetCount(naay)) == 0)
795 return ERROR_INT("no numa in array", procName, 1);
796 if (plotstyle < 0 || plotstyle >= NUM_GPLOT_STYLES)
797 return ERROR_INT("invalid plotstyle", procName, 1);
798 if (outformat != GPLOT_PNG && outformat != GPLOT_PS &&
799 outformat != GPLOT_EPS && outformat != GPLOT_LATEX)
800 return ERROR_INT("invalid outformat", procName, 1);
801 if (!outroot)
802 return ERROR_INT("outroot not specified", procName, 1);
803
804 if ((gplot = gplotCreate(outroot, outformat, title, NULL, NULL)) == 0)
805 return ERROR_INT("gplot not made", procName, 1);
806 for (i = 0; i < n; i++) {
807 nay = numaaGetNuma(naay, i, L_CLONE);
808 gplotAddPlot(gplot, nax, nay, plotstyle, NULL);
809 numaDestroy(&nay);
810 }
811 gplotMakeOutput(gplot);
812 gplotDestroy(&gplot);
813 return 0;
814}
815
816
817/*-----------------------------------------------------------------*

Callers 1

gplotSimpleNFunction · 0.85

Calls 7

numaaGetCountFunction · 0.85
gplotCreateFunction · 0.85
numaaGetNumaFunction · 0.85
gplotAddPlotFunction · 0.85
numaDestroyFunction · 0.85
gplotMakeOutputFunction · 0.85
gplotDestroyFunction · 0.85

Tested by

no test coverage detected