Example #1
0
void xvgr_new_dataset(FILE *out, int nr_first, int nsets,
                      const char **setname,
                      const output_env_t oenv)
{
    int  i;
    char buf[STRLEN];

    if (output_env_get_print_xvgr_codes(oenv))
    {
        fprintf(out, "@\n");
        for (i = 0; (i < nsets); i++)
        {
            if (setname[i])
            {
                if (output_env_get_xvg_format(oenv) == exvgXMGR)
                {
                    fprintf(out, "@ legend string %d \"%s\"\n",
                            i+nr_first, xvgrstr(setname[i], oenv, buf, STRLEN));
                }
                else
                {
                    fprintf(out, "@ s%d legend \"%s\"\n",
                            i+nr_first, xvgrstr(setname[i], oenv, buf, STRLEN));
                }
            }
        }
    }
    else
    {
        fprintf(out, "\n");
    }
}
Example #2
0
void xvgr_legend(FILE *out, int nsets, const char** setname,
                 const output_env_t oenv)
{
    int  i;
    char buf[STRLEN];

    if (output_env_get_print_xvgr_codes(oenv))
    {
        xvgr_view(out, 0.15, 0.15, 0.75, 0.85, oenv);
        fprintf(out, "@ legend on\n");
        fprintf(out, "@ legend box on\n");
        fprintf(out, "@ legend loctype view\n");
        fprintf(out, "@ legend %g, %g\n", 0.78, 0.8);
        fprintf(out, "@ legend length %d\n", 2);
        for (i = 0; (i < nsets); i++)
        {
            if (setname[i])
            {
                if (output_env_get_xvg_format(oenv) == exvgXMGR)
                {
                    fprintf(out, "@ legend string %d \"%s\"\n",
                            i, xvgrstr(setname[i], oenv, buf, STRLEN));
                }
                else
                {
                    fprintf(out, "@ s%d legend \"%s\"\n",
                            i, xvgrstr(setname[i], oenv, buf, STRLEN));
                }
            }
        }
    }
}
Example #3
0
void xvgr_header(FILE *fp, const char *title, const char *xaxis,
                 const char *yaxis, int exvg_graph_type,
                 const gmx_output_env_t *oenv)
{
    char   pukestr[100], buf[STRLEN];

    if (output_env_get_print_xvgr_codes(oenv))
    {
        gmx_format_current_time(buf, STRLEN);
        fprintf(fp, "# This file was created %s", buf);
        try
        {
            gmx::BinaryInformationSettings settings;
            settings.generatedByHeader(true);
            settings.linePrefix("# ");
            gmx::printBinaryInformation(fp, output_env_get_program_context(oenv),
                                        settings);
        }
        GMX_CATCH_ALL_AND_EXIT_WITH_FATAL_ERROR;
        fprintf(fp, "# %s is part of G R O M A C S:\n#\n",
                output_env_get_program_display_name(oenv));
        bromacs(pukestr, 99);
        fprintf(fp, "# %s\n#\n", pukestr);
        fprintf(fp, "@    title \"%s\"\n", xvgrstr(title, oenv, buf, STRLEN));
        fprintf(fp, "@    xaxis  label \"%s\"\n",
                xvgrstr(xaxis, oenv, buf, STRLEN));
        fprintf(fp, "@    yaxis  label \"%s\"\n",
                xvgrstr(yaxis, oenv, buf, STRLEN));
        switch (exvg_graph_type)
        {
            case exvggtXNY:
                if (output_env_get_xvg_format(oenv) == exvgXMGR)
                {
                    fprintf(fp, "@TYPE nxy\n");
                }
                else
                {
                    fprintf(fp, "@TYPE xy\n");
                }
                break;
            case exvggtXYDY:
                fprintf(fp, "@TYPE xydy\n");
                break;
            case exvggtXYDYDY:
                fprintf(fp, "@TYPE xydydy\n");
                break;
        }
    }
}
Example #4
0
void xvgr_subtitle(FILE *out, const char *subtitle, const output_env_t oenv)
{
    char buf[STRLEN];

    if (output_env_get_print_xvgr_codes(oenv))
    {
        fprintf(out, "@ subtitle \"%s\"\n", xvgrstr(subtitle, oenv, buf, STRLEN));
    }
}
Example #5
0
void xvgr_header(FILE *fp, const char *title, const char *xaxis,
                 const char *yaxis, int exvg_graph_type,
                 const output_env_t oenv)
{
    char   pukestr[100], buf[STRLEN];
    time_t t;

    if (output_env_get_print_xvgr_codes(oenv))
    {
        time(&t);
        gmx_ctime_r(&t, buf, STRLEN);
        fprintf(fp, "# This file was created %s", buf);
        fprintf(fp, "# by the following command:\n# %s\n#\n", command_line());
        fprintf(fp, "# %s is part of G R O M A C S:\n#\n", ShortProgram());
        bromacs(pukestr, 99);
        fprintf(fp, "# %s\n#\n", pukestr);
        fprintf(fp, "@    title \"%s\"\n", xvgrstr(title, oenv, buf, STRLEN));
        fprintf(fp, "@    xaxis  label \"%s\"\n",
                xvgrstr(xaxis, oenv, buf, STRLEN));
        fprintf(fp, "@    yaxis  label \"%s\"\n",
                xvgrstr(yaxis, oenv, buf, STRLEN));
        switch (exvg_graph_type)
        {
            case exvggtXNY:
                if (output_env_get_xvg_format(oenv) == exvgXMGR)
                {
                    fprintf(fp, "@TYPE nxy\n");
                }
                else
                {
                    fprintf(fp, "@TYPE xy\n");
                }
                break;
            case exvggtXYDY:
                fprintf(fp, "@TYPE xydy\n");
                break;
            case exvggtXYDYDY:
                fprintf(fp, "@TYPE xydydy\n");
                break;
        }
    }
}