/* Defines a "standard" viewport with seven character heights for   */
/* the left margin and four character heights everywhere else       */

#include "plplot.h"
                                                                   
void plvsta()
{
    float xmin, xmax, ymin, ymax;
    float chrdef, chrht, spdxmi, spdxma, spdymi, spdyma;

    int level;

    glev(&level);
    if (level < 1) fatal("Please call PLSTAR before calling PLVSTA.");

    gchr(&chrdef,&chrht);
    gspd(&spdxmi,&spdxma,&spdymi,&spdyma);

/*  Find out position of subpage boundaries in millimetres, reduce by */
/*  the desired border, and convert back into normalized subpage */
/*  coordinates */

    xmin = dcscx(mmdcx(dcmmx(spdxmi) + 7 * chrht));
    xmax = dcscx(mmdcx(dcmmx(spdxma) - 4 * chrht));
    ymin = dcscy(mmdcy(dcmmy(spdymi) + 4 * chrht));
    ymax = dcscy(mmdcy(dcmmy(spdyma) - 4 * chrht));

    plvpor(xmin,xmax,ymin,ymax);
}
