The R Project SVN R

Rev

Rev 59260 | Rev 59266 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 59260 Rev 59261
Line 498... Line 498...
498
    asp = (logscale) ? NA_REAL : asReal(CAR(args));;
498
    asp = (logscale) ? NA_REAL : asReal(CAR(args));;
499
    args = CDR(args);
499
    args = CDR(args);
500
 
500
 
501
    /* This reads [xy]axs and lab, used in GScale */
501
    /* This reads [xy]axs and lab, used in GScale */
502
    GSavePars(dd);
502
    GSavePars(dd);
503
    ProcessInlinePars(args, dd, call);
503
    ProcessInlinePars(args, dd);
504
 
504
 
505
    if (isInteger(xlim)) {
505
    if (isInteger(xlim)) {
506
	if (INTEGER(xlim)[0] == NA_INTEGER || INTEGER(xlim)[1] == NA_INTEGER)
506
	if (INTEGER(xlim)[0] == NA_INTEGER || INTEGER(xlim)[1] == NA_INTEGER)
507
	    error(_("NAs not allowed in 'xlim'"));
507
	    error(_("NAs not allowed in 'xlim'"));
508
	xmin = INTEGER(xlim)[0];
508
	xmin = INTEGER(xlim)[0];
Line 1040... Line 1040...
1040
    gpptr(dd)->xaxp[1] = dpptr(dd)->xaxp[1];
1040
    gpptr(dd)->xaxp[1] = dpptr(dd)->xaxp[1];
1041
    gpptr(dd)->xaxp[2] = dpptr(dd)->xaxp[2];
1041
    gpptr(dd)->xaxp[2] = dpptr(dd)->xaxp[2];
1042
    gpptr(dd)->yaxp[0] = dpptr(dd)->yaxp[0];
1042
    gpptr(dd)->yaxp[0] = dpptr(dd)->yaxp[0];
1043
    gpptr(dd)->yaxp[1] = dpptr(dd)->yaxp[1];
1043
    gpptr(dd)->yaxp[1] = dpptr(dd)->yaxp[1];
1044
    gpptr(dd)->yaxp[2] = dpptr(dd)->yaxp[2];
1044
    gpptr(dd)->yaxp[2] = dpptr(dd)->yaxp[2];
1045
    ProcessInlinePars(args, dd, call);
1045
    ProcessInlinePars(args, dd);
1046
 
1046
 
1047
    /* Retrieve relevant "par" values. */
1047
    /* Retrieve relevant "par" values. */
1048
 
1048
 
1049
    switch(side) {
1049
    switch(side) {
1050
    case 1:
1050
    case 1:
Line 1521... Line 1521...
1521
    PROTECT(lwd = FixupLwd(CAR(args), gpptr(dd)->lwd)); args = CDR(args);
1521
    PROTECT(lwd = FixupLwd(CAR(args), gpptr(dd)->lwd)); args = CDR(args);
1522
    nlwd = LENGTH(lwd);
1522
    nlwd = LENGTH(lwd);
1523
 
1523
 
1524
    /* Miscellaneous Graphical Parameters */
1524
    /* Miscellaneous Graphical Parameters */
1525
    GSavePars(dd);
1525
    GSavePars(dd);
1526
    ProcessInlinePars(args, dd, call);
1526
    ProcessInlinePars(args, dd);
1527
 
1527
 
1528
    x = REAL(sx);
1528
    x = REAL(sx);
1529
    y = REAL(sy);
1529
    y = REAL(sy);
1530
 
1530
 
1531
    if (INTEGER(lty)[0] != NA_INTEGER)
1531
    if (INTEGER(lty)[0] != NA_INTEGER)
Line 1800... Line 1800...
1800
 
1800
 
1801
    PROTECT(lwd = FixupLwd(CAR(args), gpptr(dd)->lwd));
1801
    PROTECT(lwd = FixupLwd(CAR(args), gpptr(dd)->lwd));
1802
    nlwd = length(lwd); args = CDR(args);
1802
    nlwd = length(lwd); args = CDR(args);
1803
 
1803
 
1804
    GSavePars(dd);
1804
    GSavePars(dd);
1805
    ProcessInlinePars(args, dd, call);
1805
    ProcessInlinePars(args, dd);
1806
 
1806
 
1807
    x0 = REAL(sx0);
1807
    x0 = REAL(sx0);
1808
    y0 = REAL(sy0);
1808
    y0 = REAL(sy0);
1809
    x1 = REAL(sx1);
1809
    x1 = REAL(sx1);
1810
    y1 = REAL(sy1);
1810
    y1 = REAL(sy1);
Line 1875... Line 1875...
1875
    PROTECT(lwd = FixupLwd(CAR(args), gpptr(dd)->lwd));
1875
    PROTECT(lwd = FixupLwd(CAR(args), gpptr(dd)->lwd));
1876
    nlwd = length(lwd);
1876
    nlwd = length(lwd);
1877
    args = CDR(args);
1877
    args = CDR(args);
1878
 
1878
 
1879
    GSavePars(dd);
1879
    GSavePars(dd);
1880
    ProcessInlinePars(args, dd, call);
1880
    ProcessInlinePars(args, dd);
1881
 
1881
 
1882
    xl = REAL(sxl);
1882
    xl = REAL(sxl);
1883
    xr = REAL(sxr);
1883
    xr = REAL(sxr);
1884
    yb = REAL(syb);
1884
    yb = REAL(syb);
1885
    yt = REAL(syt);
1885
    yt = REAL(syt);
Line 1941... Line 1941...
1941
    PROTECT(col = FixupCol(CAR(args), R_TRANWHITE));	args = CDR(args);
1941
    PROTECT(col = FixupCol(CAR(args), R_TRANWHITE));	args = CDR(args);
1942
    PROTECT(border = FixupCol(CAR(args), gpptr(dd)->fg)); args = CDR(args);
1942
    PROTECT(border = FixupCol(CAR(args), gpptr(dd)->fg)); args = CDR(args);
1943
    PROTECT(lty = FixupLty(CAR(args), gpptr(dd)->lty)); args = CDR(args);
1943
    PROTECT(lty = FixupLty(CAR(args), gpptr(dd)->lty)); args = CDR(args);
1944
 
1944
 
1945
    GSavePars(dd);
1945
    GSavePars(dd);
1946
    ProcessInlinePars(args, dd, call);
1946
    ProcessInlinePars(args, dd);
1947
 
1947
 
1948
    GMode(1, dd);
1948
    GMode(1, dd);
1949
 
1949
 
1950
    vmax = vmaxget();
1950
    vmax = vmaxget();
1951
 
1951
 
Line 2024... Line 2024...
2024
 
2024
 
2025
    angle = CAR(args); args = CDR(args);
2025
    angle = CAR(args); args = CDR(args);
2026
    interpolate = CAR(args); args = CDR(args);
2026
    interpolate = CAR(args); args = CDR(args);
2027
 
2027
 
2028
    GSavePars(dd);
2028
    GSavePars(dd);
2029
    ProcessInlinePars(args, dd, call);
2029
    ProcessInlinePars(args, dd);
2030
 
2030
 
2031
    xl = REAL(sxl);
2031
    xl = REAL(sxl);
2032
    xr = REAL(sxr);
2032
    xr = REAL(sxr);
2033
    yb = REAL(syb);
2033
    yb = REAL(syb);
2034
    yt = REAL(syt);
2034
    yt = REAL(syt);
Line 2109... Line 2109...
2109
    PROTECT(lwd = FixupLwd(CAR(args), gpptr(dd)->lwd));
2109
    PROTECT(lwd = FixupLwd(CAR(args), gpptr(dd)->lwd));
2110
    nlwd = length(lwd);
2110
    nlwd = length(lwd);
2111
    args = CDR(args);
2111
    args = CDR(args);
2112
 
2112
 
2113
    GSavePars(dd);
2113
    GSavePars(dd);
2114
    ProcessInlinePars(args, dd, call);
2114
    ProcessInlinePars(args, dd);
2115
 
2115
 
2116
    x0 = REAL(sx0);
2116
    x0 = REAL(sx0);
2117
    y0 = REAL(sy0);
2117
    y0 = REAL(sy0);
2118
    x1 = REAL(sx1);
2118
    x1 = REAL(sx1);
2119
    y1 = REAL(sy1);
2119
    y1 = REAL(sy1);
Line 2184... Line 2184...
2184
 
2184
 
2185
    PROTECT(lty = FixupLty(CAR(args), gpptr(dd)->lty)); args = CDR(args);
2185
    PROTECT(lty = FixupLty(CAR(args), gpptr(dd)->lty)); args = CDR(args);
2186
    nlty = length(lty);
2186
    nlty = length(lty);
2187
 
2187
 
2188
    GSavePars(dd);
2188
    GSavePars(dd);
2189
    ProcessInlinePars(args, dd, call);
2189
    ProcessInlinePars(args, dd);
2190
 
2190
 
2191
    GMode(1, dd);
2191
    GMode(1, dd);
2192
 
2192
 
2193
    x = REAL(sx);
2193
    x = REAL(sx);
2194
    y = REAL(sy);
2194
    y = REAL(sy);
Line 2321... Line 2321...
2321
    y = REAL(sy);
2321
    y = REAL(sy);
2322
    /* n = LENGTH(sx) = LENGTH(sy) */
2322
    /* n = LENGTH(sx) = LENGTH(sy) */
2323
    ntxt = LENGTH(txt);
2323
    ntxt = LENGTH(txt);
2324
 
2324
 
2325
    GSavePars(dd);
2325
    GSavePars(dd);
2326
    ProcessInlinePars(args, dd, call);
2326
    ProcessInlinePars(args, dd);
2327
 
2327
 
2328
    /* Done here so 'vfont' trumps inline 'family' */
2328
    /* Done here so 'vfont' trumps inline 'family' */
2329
    if (!isNull(vfont) && !isExpression(txt)) {
2329
    if (!isNull(vfont) && !isExpression(txt)) {
2330
	strncpy(gpptr(dd)->family, "Her ", 201);
2330
	strncpy(gpptr(dd)->family, "Her ", 201);
2331
	gpptr(dd)->family[3] = (char) INTEGER(vfont)[0];
2331
	gpptr(dd)->family[3] = (char) INTEGER(vfont)[0];
Line 2607... Line 2607...
2607
    if (nfont <= 0) error(_("zero length 'font' specified"));
2607
    if (nfont <= 0) error(_("zero length 'font' specified"));
2608
    if (n < nfont) n = nfont;
2608
    if (n < nfont) n = nfont;
2609
    args = CDR(args);
2609
    args = CDR(args);
2610
 
2610
 
2611
    GSavePars(dd);
2611
    GSavePars(dd);
2612
    ProcessInlinePars(args, dd, call);
2612
    ProcessInlinePars(args, dd);
2613
 
2613
 
2614
    /* If we only scribble in the outer margins, */
2614
    /* If we only scribble in the outer margins, */
2615
    /* we don't want to mark the plot as dirty. */
2615
    /* we don't want to mark the plot as dirty. */
2616
 
2616
 
2617
    dirtyplot = FALSE;
2617
    dirtyplot = FALSE;
Line 2733... Line 2733...
2733
    outer = asLogical(CAR(args));
2733
    outer = asLogical(CAR(args));
2734
    if (outer == NA_LOGICAL) outer = 0;
2734
    if (outer == NA_LOGICAL) outer = 0;
2735
    args = CDR(args);
2735
    args = CDR(args);
2736
 
2736
 
2737
    GSavePars(dd);
2737
    GSavePars(dd);
2738
    ProcessInlinePars(args, dd, call);
2738
    ProcessInlinePars(args, dd);
2739
 
2739
 
2740
    /* override par("xpd") and force clipping to figure region
2740
    /* override par("xpd") and force clipping to figure region
2741
       NOTE: don't override to _reduce_ clipping region */
2741
       NOTE: don't override to _reduce_ clipping region */
2742
    if (gpptr(dd)->xpd < 1)
2742
    if (gpptr(dd)->xpd < 1)
2743
	gpptr(dd)->xpd = 1;
2743
	gpptr(dd)->xpd = 1;
Line 2958... Line 2958...
2958
    PROTECT(lwd = FixupLwd(CAR(args), gpptr(dd)->lwd)); args = CDR(args);
2958
    PROTECT(lwd = FixupLwd(CAR(args), gpptr(dd)->lwd)); args = CDR(args);
2959
    nlwd = length(lwd);
2959
    nlwd = length(lwd);
2960
 
2960
 
2961
    GSavePars(dd);
2961
    GSavePars(dd);
2962
 
2962
 
2963
    ProcessInlinePars(args, dd, call);
2963
    ProcessInlinePars(args, dd);
2964
 
2964
 
2965
    nlines = 0;
2965
    nlines = 0;
2966
 
2966
 
2967
    if (a != R_NilValue) {  /* case where a ans b are supplied */
2967
    if (a != R_NilValue) {  /* case where a ans b are supplied */
2968
	if (b == R_NilValue) {
2968
	if (b == R_NilValue) {
Line 3121... Line 3121...
3121
     * if specified non-NA fg then use that, else ...
3121
     * if specified non-NA fg then use that, else ...
3122
     *
3122
     *
3123
     * else use par("col")
3123
     * else use par("col")
3124
     */
3124
     */
3125
    col= gpptr(dd)->col;
3125
    col= gpptr(dd)->col;
3126
    ProcessInlinePars(args, dd, call);
3126
    ProcessInlinePars(args, dd);
3127
    colsxp = getInlinePar(args, "col");
3127
    colsxp = getInlinePar(args, "col");
3128
    if (isNAcol(colsxp, 0, 1)) {
3128
    if (isNAcol(colsxp, 0, 1)) {
3129
	fgsxp = getInlinePar(args, "fg");
3129
	fgsxp = getInlinePar(args, "fg");
3130
	if (isNAcol(fgsxp, 0, 1))
3130
	if (isNAcol(fgsxp, 0, 1))
3131
	    gpptr(dd)->col = col;
3131
	    gpptr(dd)->col = col;
Line 3493... Line 3493...
3493
	error(_("invalid '%s' value"), "cex");				\
3493
	error(_("invalid '%s' value"), "cex");				\
3494
    args = CDR(args);							\
3494
    args = CDR(args);							\
3495
    PROTECT(font = FixupFont(CAR(args), NA_INTEGER)); args = CDR(args); \
3495
    PROTECT(font = FixupFont(CAR(args), NA_INTEGER)); args = CDR(args); \
3496
    PROTECT(vfont = FixupVFont(CAR(args))); args = CDR(args);		\
3496
    PROTECT(vfont = FixupVFont(CAR(args))); args = CDR(args);		\
3497
    GSavePars(dd);							\
3497
    GSavePars(dd);							\
3498
    ProcessInlinePars(args, dd, call);					\
3498
    ProcessInlinePars(args, dd);					\
3499
									\
3499
									\
3500
    /* 'vfont' trumps inline 'family' */				\
3500
    /* 'vfont' trumps inline 'family' */				\
3501
    if (!isNull(vfont) && !isExpression(str)) {				\
3501
    if (!isNull(vfont) && !isExpression(str)) {				\
3502
	strncpy(gpptr(dd)->family, "Her ", 201);			\
3502
	strncpy(gpptr(dd)->family, "Her ", 201);			\
3503
	gpptr(dd)->family[3] = (char)INTEGER(vfont)[0];			\
3503
	gpptr(dd)->family[3] = (char)INTEGER(vfont)[0];			\
Line 3639... Line 3639...
3639
	goto badargs;
3639
	goto badargs;
3640
    dnd_llabels = CAR(args);
3640
    dnd_llabels = CAR(args);
3641
    args = CDR(args);
3641
    args = CDR(args);
3642
 
3642
 
3643
    GSavePars(dd);
3643
    GSavePars(dd);
3644
    ProcessInlinePars(args, dd, call);
3644
    ProcessInlinePars(args, dd);
3645
    gpptr(dd)->cex = gpptr(dd)->cexbase * gpptr(dd)->cex;
3645
    gpptr(dd)->cex = gpptr(dd)->cexbase * gpptr(dd)->cex;
3646
    dnd_offset = GConvertYUnits(GStrWidth("m", CE_ANY, INCHES, dd), INCHES,
3646
    dnd_offset = GConvertYUnits(GStrWidth("m", CE_ANY, INCHES, dd), INCHES,
3647
				USER, dd);
3647
				USER, dd);
3648
 
3648
 
3649
    /* override par("xpd") and force clipping to figure region
3649
    /* override par("xpd") and force clipping to figure region
Line 3702... Line 3702...
3702
	goto badargs;
3702
	goto badargs;
3703
    llabels = CAR(args);
3703
    llabels = CAR(args);
3704
 
3704
 
3705
    args = CDR(args);
3705
    args = CDR(args);
3706
    GSavePars(dd);
3706
    GSavePars(dd);
3707
    ProcessInlinePars(args, dd, call);
3707
    ProcessInlinePars(args, dd);
3708
    gpptr(dd)->cex = gpptr(dd)->cexbase * gpptr(dd)->cex;
3708
    gpptr(dd)->cex = gpptr(dd)->cexbase * gpptr(dd)->cex;
3709
    dnd_offset = GStrWidth("m", CE_ANY, INCHES, dd);
3709
    dnd_offset = GStrWidth("m", CE_ANY, INCHES, dd);
3710
    vmax = vmaxget();
3710
    vmax = vmaxget();
3711
    /* n is the number of merges, so the points are labelled 1 ... n+1 */
3711
    /* n is the number of merges, so the points are labelled 1 ... n+1 */
3712
    y =  (double*)R_alloc(n+1, sizeof(double));
3712
    y =  (double*)R_alloc(n+1, sizeof(double));
Line 3871... Line 3871...
3871
 
3871
 
3872
    PROTECT(fg = FixupCol(CAR(args), R_TRANWHITE)); args = CDR(args);
3872
    PROTECT(fg = FixupCol(CAR(args), R_TRANWHITE)); args = CDR(args);
3873
    nfg = LENGTH(fg);
3873
    nfg = LENGTH(fg);
3874
 
3874
 
3875
    GSavePars(dd);
3875
    GSavePars(dd);
3876
    ProcessInlinePars(args, dd, call);
3876
    ProcessInlinePars(args, dd);
3877
 
3877
 
3878
    GMode(1, dd);
3878
    GMode(1, dd);
3879
    switch (type) {
3879
    switch (type) {
3880
    case 1: /* circles */
3880
    case 1: /* circles */
3881
	if (nc != 1)
3881
	if (nc != 1)
Line 4152... Line 4152...
4152
	error(_("incorrect length for '%s' argument"), "border");
4152
	error(_("incorrect length for '%s' argument"), "border");
4153
    if(nborder > 1)
4153
    if(nborder > 1)
4154
	warning(_("incorrect length for '%s' argument"), "border");
4154
	warning(_("incorrect length for '%s' argument"), "border");
4155
 
4155
 
4156
    GSavePars(dd);
4156
    GSavePars(dd);
4157
    ProcessInlinePars(args, dd, call);
4157
    ProcessInlinePars(args, dd);
4158
    /* Paul 2008-12-05
4158
    /* Paul 2008-12-05
4159
     * Convert GP to gcontext AFTER ProcessInlinePars
4159
     * Convert GP to gcontext AFTER ProcessInlinePars
4160
     */
4160
     */
4161
    gcontextFromGP(&gc, dd);
4161
    gcontextFromGP(&gc, dd);
4162
 
4162