diff -uNr orig/docs/gnuplot.doc bbsize/docs/gnuplot.doc --- orig/docs/gnuplot.doc 2005-10-10 15:27:35.000000000 +0200 +++ bbsize/docs/gnuplot.doc 2005-10-12 13:22:06.000000000 +0200 @@ -7851,7 +7851,10 @@ show size The and values are the scaling factors for the size of the - plot, which includes the graph and the margins. + plot, which includes the graph and the margins. If `set size` is used before + the `set terminal` command also the bounding box of the output is changed in + case the terminal is capable to do this. If `set size` is used after the + `set terminal` command only the size of the plot is changed. `ratio` causes `gnuplot` to try to create a graph with an aspect ratio of (the ratio of the y-axis length to the x-axis length) within the portion of diff -uNr orig/src/gadgets.c bbsize/src/gadgets.c --- orig/src/gadgets.c 2005-09-16 21:37:13.000000000 +0200 +++ bbsize/src/gadgets.c 2005-10-12 13:32:33.000000000 +0200 @@ -61,6 +61,8 @@ float xsize = 1.0; /* scale factor for size */ float ysize = 1.0; /* scale factor for size */ float zsize = 1.0; /* scale factor for size */ +float global_xsize = 1.0; /* scale factor for size */ +float global_ysize = 1.0; /* scale factor for size */ float xoffset = 0.0; /* x origin */ float yoffset = 0.0; /* y origin */ float aspect_ratio = 0.0; /* don't attempt to force it */ @@ -488,6 +490,8 @@ int htic, vtic; int justify = JUST_TOP; /* This was the 2D default; 3D had CENTRE */ + FPRINTF((stderr, "write_label()\n")); + apply_pm3dcolor(&(this_label->textcolor),term); ignore_enhanced(this_label->noenhanced); diff -uNr orig/src/gadgets.h bbsize/src/gadgets.h --- orig/src/gadgets.h 2005-10-03 23:50:26.000000000 +0200 +++ bbsize/src/gadgets.h 2005-10-12 13:22:06.000000000 +0200 @@ -255,6 +255,8 @@ extern float xsize; /* x scale factor for size */ extern float ysize; /* y scale factor for size */ extern float zsize; /* z scale factor for size */ +extern float global_xsize; /* x scale factor for size */ +extern float global_ysize; /* y scale factor for size */ extern float xoffset; /* x origin setting */ extern float yoffset; /* y origin setting */ extern float aspect_ratio; /* 1.0 for square */ diff -uNr orig/src/graph3d.c bbsize/src/graph3d.c --- orig/src/graph3d.c 2005-10-12 11:35:15.000000000 +0200 +++ bbsize/src/graph3d.c 2005-10-12 13:22:06.000000000 +0200 @@ -451,8 +451,15 @@ /* EAM FIXME - Is this a sufficiently general test for out-of-bounds? */ /* Should we test the other end of the arrow also? */ - if (*sx < 0 || *sx > term->xmax || *sy < 0 || *sy > term->ymax) + if ((*sx < 0) || + (multiplot && (*sx > term->xmax * global_xsize)) || + (!multiplot && (*sx > term->xmax * xsize)) || + (*sy < 0) || + (multiplot && (*sy > term->ymax * global_ysize)) || + (!multiplot && (*sy > term->ymax * ysize))) { + FPRINTF((stderr,"get_arrow3d: skipping out-of-bounds arrow\n")); return FALSE; + } if (arrow->relative) { map3d_position_r(&(arrow->end), ex, ey, "arrow"); @@ -491,7 +498,12 @@ map3d_position(&this_label->place, &x, &y, "label"); /* EAM FIXME - Is this a sufficient test for out-of-bounds? */ - if (x < 0 || x > term->xmax || y < 0 || y > term->ymax) { + if ((x < 0) || + (multiplot && (x > term->xmax * global_xsize)) || + (!multiplot && (x > term->xmax * xsize)) || + (y < 0) || + (multiplot && (y > term->ymax * global_ysize)) || + (!multiplot && (y > term->ymax * ysize))) { FPRINTF((stderr, "place_labels3d: skipping out-of-bounds label\n")); continue; diff -uNr orig/src/set.c bbsize/src/set.c --- orig/src/set.c 2005-10-10 15:27:44.000000000 +0200 +++ bbsize/src/set.c 2005-10-12 13:22:06.000000000 +0200 @@ -3268,6 +3268,10 @@ } } } + if (!multiplot) { + global_xsize = xsize; + global_ysize = ysize; + } } diff -uNr orig/src/term.c bbsize/src/term.c --- orig/src/term.c 2005-10-03 23:50:37.000000000 +0200 +++ bbsize/src/term.c 2005-10-12 13:41:19.000000000 +0200 @@ -631,6 +631,9 @@ mp_layout.auto_layout = FALSE; + global_xsize = xsize; + global_ysize = ysize; + /* Parse options (new in version 4.1 */ while (!END_OF_COMMAND) { struct value a; @@ -943,6 +946,8 @@ if (!p) return; + FPRINTF((stderr, "write_multiline(%s)\n",p)); + /* EAM 9-Feb-2003 - Set font before calculating sizes */ if (font && *font && t->set_font) (*t->set_font) (font); @@ -2667,7 +2672,10 @@ if (term->flags & TERM_CAN_CLIP) return TRUE; - if ((0 < x && x < term->xmax) && (0 < y && y < term->ymax)) + FPRINTF((stderr,"on_page(): %d,%g %d,%g\n", + term->xmax,global_xsize,term->ymax,global_ysize)); + if ((0 < x && x < term->xmax * global_xsize) + && (0 < y && y < term->ymax * global_ysize)) return TRUE; return FALSE; diff -uNr orig/term/gd.trm bbsize/term/gd.trm --- orig/term/gd.trm 2005-10-06 21:24:18.000000000 +0200 +++ bbsize/term/gd.trm 2005-10-12 13:35:10.000000000 +0200 @@ -1372,6 +1372,8 @@ TERM_PUBLIC void PNG_put_text(unsigned int x, unsigned int y, const char *string) { + FPRINTF((stderr, "PNG_put_text(%d,%d,%s)\n",x,y,string)); + if (*png_state.ttffont) { int brect[8]; char *err; /* Draw once with a NULL image to get the bounding rectangle */