! * \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
| 776 | * </pre> |
| 777 | */ |
| 778 | l_int32 |
| 779 | gplotSimpleXYN(NUMA *nax, |
| 780 | NUMAA *naay, |
| 781 | l_int32 plotstyle, |
| 782 | l_int32 outformat, |
| 783 | const char *outroot, |
| 784 | const char *title) |
| 785 | { |
| 786 | l_int32 i, n; |
| 787 | GPLOT *gplot; |
| 788 | NUMA *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 | /*-----------------------------------------------------------------* |
no test coverage detected