[BACK]Return to graphics.c CVS log [TXT][DIR] Up to [local] / OpenXM_contrib / gnuplot

Diff for /OpenXM_contrib/gnuplot/Attic/graphics.c between version 1.1.1.1 and 1.1.1.2

version 1.1.1.1, 2000/01/09 17:00:51 version 1.1.1.2, 2000/01/22 14:15:57
Line 593  int count;
Line 593  int count;
             top_margin = y2label_textheight;              top_margin = y2label_textheight;
   
         top_margin += x2tic_height + x2tic_textheight;          top_margin += x2tic_height + x2tic_textheight;
 /* FIXME: what is this additional space reservation for??? */          /* x2tic_height and x2tic_textheight are computed as only the
            *     relevant heights, but they nonetheless need a blank
            *     space above them  */
         if (top_margin > x2tic_height)          if (top_margin > x2tic_height)
             top_margin += (int) (t->v_char);              top_margin += (int) (t->v_char);
   
         ytop -= top_margin;          ytop -= top_margin;
         if (ytop == (int) ((ysize + yoffset) * (t->ymax))) {          if (ytop == (int) (0.5 + (ysize + yoffset) * (t->ymax))) {
             /* make room for the end of rotated ytics or y2tics */              /* make room for the end of rotated ytics or y2tics */
             ytop -= (int) ((t->h_char) * 2);              ytop -= (int) ((t->h_char) * 2);
         }          }
Line 646  int count;
Line 648  int count;
   
     /* xlabel */      /* xlabel */
     if (xlablin) {      if (xlablin) {
         /* offset is subtracted because if . 0, the margin is smaller */          /* offset is subtracted because if > 0, the margin is smaller */
         xlabel_textheight = (int) ((xlablin - xlabel.yoffset) * (t->v_char));          xlabel_textheight = (int) ((xlablin - xlabel.yoffset) * (t->v_char));
         if (!xtics)          if (!xtics)
             xlabel_textheight += 0.5 * t->v_char;              xlabel_textheight += 0.5 * t->v_char;
Line 659  int count;
Line 661  int count;
          * DBT 11-18-98 resize plot for vertical timelabels too !           * DBT 11-18-98 resize plot for vertical timelabels too !
          */           */
         /* offset is subtracted because if . 0, the margin is smaller */          /* offset is subtracted because if . 0, the margin is smaller */
         timebot_textheight = (int) ((timelin - timelabel.yoffset + 1.5) * (t->v_char));          timebot_textheight = (int) ((timelin - timelabel.yoffset) * (t->v_char));
     }      } else
     else  
         timebot_textheight = 0;          timebot_textheight = 0;
   
     /* compute ybot from the various components      /* compute ybot from the various components
Line 671  int count;
Line 672  int count;
   
     if (bmargin < 0) {      if (bmargin < 0) {
         ybot += xtic_height + xtic_textheight;          ybot += xtic_height + xtic_textheight;
         if (timebot_textheight > 0 || xlabel_textheight > 0)          if (xlabel_textheight > 0)
             ybot += (timebot_textheight > xlabel_textheight) ? timebot_textheight : xlabel_textheight;              ybot += xlabel_textheight;
         if (ybot == (t->ymax) * yoffset) {          if (timebot_textheight > 0)
               ybot += timebot_textheight;
           /* HBB 19990616: round to nearest integer, required to escape
            * floating point inaccuracies */
           if (ybot == (int)(0.5 + (t->ymax) * yoffset)) {
             /* make room for the end of rotated ytics or y2tics */              /* make room for the end of rotated ytics or y2tics */
             ybot += (int) ((t->h_char) * 2);              ybot += (int) ((t->h_char) * 2);
         }          }
Line 845  int count;
Line 850  int count;
         xleft += (timelabel_textwidth > ylabel_textwidth ? timelabel_textwidth : ylabel_textwidth)          xleft += (timelabel_textwidth > ylabel_textwidth ? timelabel_textwidth : ylabel_textwidth)
             + ytic_width + ytic_textwidth;              + ytic_width + ytic_textwidth;
   
         if (xleft == (t->xmax) * xoffset) {          /* make sure xleft is wide enough for a negatively
            * x-offset horizontal timestamp
            */
           if (!vertical_timelabel && xleft - ytic_width - ytic_textwidth < -(int) (timelabel.xoffset * (t->h_char)))
           xleft = ytic_width + ytic_textwidth - (int) (timelabel.xoffset * (t->h_char));
           if (xleft == (int)(0.5 + (t->xmax) * xoffset)) {
             /* make room for end of xtic or x2tic label */              /* make room for end of xtic or x2tic label */
             xleft += (int) ((t->h_char) * 2);              xleft += (int) ((t->h_char) * 2);
         }          }
Line 854  int count;
Line 864  int count;
     } else      } else
         xleft += (int) (lmargin * (t->h_char));          xleft += (int) (lmargin * (t->h_char));
   
     /* make sure xleft is wide enough for a negatively  
      * x-offset horizontal timestamp  
      */  
     if (!vertical_timelabel && xleft - ytic_width - ytic_textwidth < -(int) (timelabel.xoffset * (t->h_char)))  
         xleft = ytic_width + ytic_textwidth - (int) (timelabel.xoffset * (t->h_char));  
     /*  end of xleft calculation }}} */      /*  end of xleft calculation }}} */
   
   
Line 913  int count;
Line 918  int count;
             xright -= key_col_wth * key_cols;              xright -= key_col_wth * key_cols;
             key_xl = xright + (int) (t->h_tic);              key_xl = xright + (int) (t->h_tic);
         }          }
         if (xright == (t->xmax) * (xsize + xoffset)) {          if (xright == (int)(0.5 + (t->xmax) * (xsize + xoffset))) {
             /* make room for end of xtic or x2tic label */              /* make room for end of xtic or x2tic label */
             xright -= (int) ((t->h_char) * 2);              xright -= (int) ((t->h_char) * 2);
         }          }
Line 929  int count;
Line 934  int count;
         double current_aspect_ratio;          double current_aspect_ratio;
   
         if (aspect_ratio < 0 && (max_array[x_axis] - min_array[x_axis]) != 0.0) {          if (aspect_ratio < 0 && (max_array[x_axis] - min_array[x_axis]) != 0.0) {
             current_aspect_ratio = -aspect_ratio * (max_array[y_axis] - min_array[y_axis]) / (max_array[x_axis] - min_array[x_axis]);              current_aspect_ratio = -aspect_ratio * fabs((max_array[y_axis] - min_array[y_axis]) / (max_array[x_axis] - min_array[x_axis]));
         } else          } else
             current_aspect_ratio = aspect_ratio;              current_aspect_ratio = aspect_ratio;
   
Line 942  int count;
Line 947  int count;
                 /* too tall */                  /* too tall */
                 ytop = ybot + required * (xright - xleft);                  ytop = ybot + required * (xright - xleft);
             } else {              } else {
                 /* HBB: y2label_x wasn't defined yet, and would be  
                  * overwritten later */  
                 xright = xleft + (ytop - ybot) / required;                  xright = xleft + (ytop - ybot) / required;
             }              }
         }          }
Line 973  int count;
Line 976  int count;
     if (tmargin < 0 && x2tics & TICS_ON_BORDER && vertical_x2tics) {      if (tmargin < 0 && x2tics & TICS_ON_BORDER && vertical_x2tics) {
         widest_tic = 0;         /* reset the global variable ... */          widest_tic = 0;         /* reset the global variable ... */
         gen_tics(SECOND_X_AXIS, &x2ticdef, 0, 0, 0.0, widest2d_callback);          gen_tics(SECOND_X_AXIS, &x2ticdef, 0, 0, 0.0, widest2d_callback);
 /* HBB: redid this: remove rough guess value first. Among other reasons,  
  * I suspected the '-4 lines' of the original code to be in error, as the  
  * original calc. of x2tic_textheight uses *5* lines */  
         ytop += x2tic_textheight;          ytop += x2tic_textheight;
 /* Now compute a new one and use that instead: */          /* Now compute a new one and use that instead: */
         x2tic_textheight = (int) ((t->h_char) * (widest_tic));          x2tic_textheight = (int) ((t->h_char) * (widest_tic));
         ytop -= x2tic_textheight;          ytop -= x2tic_textheight;
     }      }
     if (bmargin < 0 && xtics & TICS_ON_BORDER && vertical_xtics) {      if (bmargin < 0 && xtics & TICS_ON_BORDER && vertical_xtics) {
         widest_tic = 0;         /* reset the global variable ... */          widest_tic = 0;         /* reset the global variable ... */
         gen_tics(FIRST_X_AXIS, &xticdef, 0, 0, 0.0, widest2d_callback);          gen_tics(FIRST_X_AXIS, &xticdef, 0, 0, 0.0, widest2d_callback);
 /* HBB: same changes as for tmargin/ytop above */  
         ybot -= xtic_textheight;          ybot -= xtic_textheight;
         xtic_textheight = (int) ((t->h_char) * widest_tic);          xtic_textheight = (int) ((t->h_char) * widest_tic);
         ybot += xtic_textheight;          ybot += xtic_textheight;
Line 1002  int count;
Line 1001  int count;
   
     y2label_y = ytop + x2tic_height + x2tic_textheight + y2label_textheight;      y2label_y = ytop + x2tic_height + x2tic_textheight + y2label_textheight;
   
     xlabel_y = ybot - xtic_height - xtic_textheight - xlabel_textheight + t->v_char;      xlabel_y = ybot - xtic_height - xtic_textheight - xlabel_textheight + xlablin*(t->v_char);
     ylabel_x = xleft - ytic_width - ytic_textwidth;      ylabel_x = xleft - ytic_width - ytic_textwidth;
     if (*ylabel.text && can_rotate)      if (*ylabel.text && can_rotate)
         ylabel_x -= ylabel_textwidth;          ylabel_x -= ylabel_textwidth;
   
     y2label_x = xright + y2tic_width + y2tic_textwidth;      y2label_x = xright + y2tic_width + y2tic_textwidth;
     if (*y2label.text && can_rotate)      if (*y2label.text && can_rotate)
         y2label_x += y2label_textwidth - t->v_char;          y2label_x += y2label_textwidth - y2lablin * t->v_char;
   
     if (vertical_timelabel) {      if (vertical_timelabel) {
         if (timelabel_bottom)          if (timelabel_bottom)
Line 1019  int count;
Line 1018  int count;
         }          }
     } else {      } else {
         if (timelabel_bottom)          if (timelabel_bottom)
             time_y = xlabel_y - timebot_textheight + xlabel_textheight;              time_y = ybot - xtic_height - xtic_textheight - xlabel_textheight - timebot_textheight + t->v_char;
         else if (ylabel_textheight > 0)          else if (ylabel_textheight > 0)
             time_y = ylabel_y + timetop_textheight;              time_y = ylabel_y + timetop_textheight;
         else          else
Line 1304  int pcount;   /* count of plots in linked list */
Line 1303  int pcount;   /* count of plots in linked list */
     struct text_label *this_label;      struct text_label *this_label;
     struct arrow_def *this_arrow;      struct arrow_def *this_arrow;
     TBOOLEAN scaling;      TBOOLEAN scaling;
     char ss[MAX_LINE_LEN + 1], *s, *e;      char *s, *e;
   
     /* so that macros for x_min etc pick up correct values      /* so that macros for x_min etc pick up correct values
      * until this is done properly       * until this is done properly
Line 1561  int pcount;   /* count of plots in linked list */
Line 1560  int pcount;   /* count of plots in linked list */
   
     x_axis = FIRST_X_AXIS;      x_axis = FIRST_X_AXIS;
     y_axis = FIRST_Y_AXIS;      /* chose scaling */      y_axis = FIRST_Y_AXIS;      /* chose scaling */
     axis_zero[FIRST_X_AXIS] = map_y(0.0);      axis_zero[FIRST_Y_AXIS] = map_y(0.0);
     axis_zero[FIRST_Y_AXIS] = map_x(0.0);      axis_zero[FIRST_X_AXIS] = map_x(0.0);
   
     if (axis_zero[FIRST_X_AXIS] < ybot || is_log_y)      if (axis_zero[FIRST_Y_AXIS] < ybot || is_log_y)
         axis_zero[FIRST_X_AXIS] = ybot;         /* save for impulse plotting */          axis_zero[FIRST_Y_AXIS] = ybot;         /* save for impulse plotting */
     else if (axis_zero[FIRST_X_AXIS] >= ytop)      else if (axis_zero[FIRST_Y_AXIS] >= ytop)
         axis_zero[FIRST_X_AXIS] = ytop;          axis_zero[FIRST_Y_AXIS] = ytop;
     else if (xzeroaxis.l_type > -3) {      else if (xzeroaxis.l_type > -3) {
         term_apply_lp_properties(&xzeroaxis);          term_apply_lp_properties(&xzeroaxis);
         (*t->move) (xleft, axis_zero[FIRST_X_AXIS]);          (*t->move) (xleft, axis_zero[FIRST_Y_AXIS]);
         (*t->vector) (xright, axis_zero[FIRST_X_AXIS]);          (*t->vector) (xright, axis_zero[FIRST_Y_AXIS]);
     }      }
     if ((yzeroaxis.l_type > -3) && !is_log_x      if ((yzeroaxis.l_type > -3) && !is_log_x
                                 && axis_zero[FIRST_Y_AXIS] >= xleft          && axis_zero[FIRST_X_AXIS] >= xleft
                                 && axis_zero[FIRST_Y_AXIS] < xright) {          && axis_zero[FIRST_X_AXIS] < xright) {
         term_apply_lp_properties(&yzeroaxis);          term_apply_lp_properties(&yzeroaxis);
         (*t->move) (axis_zero[FIRST_Y_AXIS], ybot);          (*t->move) (axis_zero[FIRST_X_AXIS], ybot);
         (*t->vector) (axis_zero[FIRST_Y_AXIS], ytop);          (*t->vector) (axis_zero[FIRST_X_AXIS], ytop);
     }      }
     x_axis = SECOND_X_AXIS;      x_axis = SECOND_X_AXIS;
     y_axis = SECOND_Y_AXIS;     /* chose scaling */      y_axis = SECOND_Y_AXIS;     /* chose scaling */
     axis_zero[SECOND_X_AXIS] = map_y(0.0);      axis_zero[SECOND_Y_AXIS] = map_y(0.0);
     axis_zero[SECOND_Y_AXIS] = map_x(0.0);      axis_zero[SECOND_X_AXIS] = map_x(0.0);
   
     if (axis_zero[SECOND_X_AXIS] < ybot || is_log_y2)      if (axis_zero[SECOND_Y_AXIS] < ybot || is_log_y2)
         axis_zero[SECOND_X_AXIS] = ybot;        /* save for impulse plotting */          axis_zero[SECOND_Y_AXIS] = ybot;  /* save for impulse plotting */
     else if (axis_zero[SECOND_X_AXIS] >= ytop)      else if (axis_zero[SECOND_Y_AXIS] >= ytop)
         axis_zero[SECOND_X_AXIS] = ytop;          axis_zero[SECOND_Y_AXIS] = ytop;
     else if (x2zeroaxis.l_type > -3) {      else if (x2zeroaxis.l_type > -3) {
         term_apply_lp_properties(&x2zeroaxis);          term_apply_lp_properties(&x2zeroaxis);
         (*t->move) (xleft, axis_zero[SECOND_X_AXIS]);          (*t->move) (xleft, axis_zero[SECOND_Y_AXIS]);
         (*t->vector) (xright, axis_zero[SECOND_X_AXIS]);          (*t->vector) (xright, axis_zero[SECOND_Y_AXIS]);
     }      }
     if ((y2zeroaxis.l_type > -3) && !is_log_x2 && axis_zero[SECOND_Y_AXIS] >= xleft &&      if ((y2zeroaxis.l_type > -3) && !is_log_x2 &&
         axis_zero[SECOND_Y_AXIS] < xright) {          axis_zero[SECOND_X_AXIS] >= xleft &&
           axis_zero[SECOND_X_AXIS] < xright) {
         term_apply_lp_properties(&y2zeroaxis);          term_apply_lp_properties(&y2zeroaxis);
         (*t->move) (axis_zero[SECOND_Y_AXIS], ybot);          (*t->move) (axis_zero[SECOND_X_AXIS], ybot);
         (*t->vector) (axis_zero[SECOND_Y_AXIS], ytop);          (*t->vector) (axis_zero[SECOND_X_AXIS], ytop);
     }      }
     /* DRAW PLOT BORDER */      /* DRAW PLOT BORDER */
     if (draw_border) {      if (draw_border) {
Line 1629  int pcount;   /* count of plots in linked list */
Line 1629  int pcount;   /* count of plots in linked list */
     }      }
 /* YLABEL */  /* YLABEL */
     if (*ylabel.text) {      if (*ylabel.text) {
         strcpy(ss, ylabel.text);  
         /* we worked out x-posn in boundary() */          /* we worked out x-posn in boundary() */
         if ((*t->text_angle) (1)) {          if ((*t->text_angle) (1)) {
             unsigned int x = ylabel_x + (t->v_char / 2);              unsigned int x = ylabel_x + (t->v_char / 2);
             unsigned int y = (ytop + ybot) / 2 + ylabel.yoffset * (t->h_char);              unsigned int y = (ytop + ybot) / 2 + ylabel.yoffset * (t->h_char);
             write_multiline(x, y, ss, CENTRE, JUST_TOP, 1, ylabel.font);              write_multiline(x, y, ylabel.text, CENTRE, JUST_TOP, 1, ylabel.font);
             (*t->text_angle) (0);              (*t->text_angle) (0);
         } else {          } else {
             /* really bottom just, but we know number of lines              /* really bottom just, but we know number of lines
                so we need to adjust x-posn by one line */                 so we need to adjust x-posn by one line */
             unsigned int x = ylabel_x;              unsigned int x = ylabel_x;
             unsigned int y = ylabel_y;              unsigned int y = ylabel_y;
             write_multiline(x, y, ss, LEFT, JUST_TOP, 0, ylabel.font);              write_multiline(x, y, ylabel.text, LEFT, JUST_TOP, 0, ylabel.font);
         }          }
     }      }
 /* Y2LABEL */  /* Y2LABEL */
     if (*y2label.text) {      if (*y2label.text) {
         strcpy(ss, y2label.text);  
         /* we worked out coordinates in boundary() */          /* we worked out coordinates in boundary() */
         if ((*t->text_angle) (1)) {          if ((*t->text_angle) (1)) {
             unsigned int x = y2label_x + (t->v_char / 2) - 1;              unsigned int x = y2label_x + (t->v_char / 2) - 1;
             unsigned int y = (ytop + ybot) / 2 + y2label.yoffset * (t->h_char);              unsigned int y = (ytop + ybot) / 2 + y2label.yoffset * (t->h_char);
             write_multiline(x, y, ss, CENTRE, JUST_TOP, 1, y2label.font);              write_multiline(x, y, y2label.text, CENTRE, JUST_TOP, 1, y2label.font);
             (*t->text_angle) (0);              (*t->text_angle) (0);
         } else {          } else {
             /* really bottom just, but we know number of lines */              /* really bottom just, but we know number of lines */
             unsigned int x = y2label_x;              unsigned int x = y2label_x;
             unsigned int y = y2label_y;              unsigned int y = y2label_y;
             write_multiline(x, y, ss, RIGHT, JUST_TOP, 0, y2label.font);              write_multiline(x, y, y2label.text, RIGHT, JUST_TOP, 0, y2label.font);
         }          }
     }      }
 /* XLABEL */  /* XLABEL */
     if (*xlabel.text) {      if (*xlabel.text) {
         unsigned int x = (xright + xleft) / 2 + xlabel.xoffset * (t->h_char);          unsigned int x = (xright + xleft) / 2 + xlabel.xoffset * (t->h_char);
         unsigned int y = xlabel_y - t->v_char / 2;      /* HBB */          unsigned int y = xlabel_y - t->v_char / 2;      /* HBB */
         strcpy(ss, xlabel.text);          write_multiline(x, y, xlabel.text, CENTRE, JUST_TOP, 0, xlabel.font);
         write_multiline(x, y, ss, CENTRE, JUST_TOP, 0, xlabel.font);  
     }      }
 /* PLACE TITLE */  /* PLACE TITLE */
     if (*title.text) {      if (*title.text) {
         /* we worked out y-coordinate in boundary() */          /* we worked out y-coordinate in boundary() */
         unsigned int x = (xleft + xright) / 2 + title.xoffset * t->h_char;          unsigned int x = (xleft + xright) / 2 + title.xoffset * t->h_char;
         unsigned int y = title_y - t->v_char / 2;          unsigned int y = title_y - t->v_char / 2;
         strcpy(ss, title.text);          write_multiline(x, y, title.text, CENTRE, JUST_TOP, 0, title.font);
         write_multiline(x, y, ss, CENTRE, JUST_TOP, 0, title.font);  
     }      }
 /* X2LABEL */  /* X2LABEL */
     if (*x2label.text) {      if (*x2label.text) {
         /* we worked out y-coordinate in boundary() */          /* we worked out y-coordinate in boundary() */
         unsigned int x = (xright + xleft) / 2 + x2label.xoffset * (t->h_char);          unsigned int x = (xright + xleft) / 2 + x2label.xoffset * (t->h_char);
         unsigned int y = x2label_y - t->v_char / 2 - 1;          unsigned int y = x2label_y - t->v_char / 2 - 1;
         strcpy(ss, x2label.text);          write_multiline(x, y, x2label.text, CENTRE, JUST_TOP, 0, x2label.font);
         write_multiline(x, y, ss, CENTRE, JUST_TOP, 0, x2label.font);  
     }      }
 /* PLACE TIMEDATE */  /* PLACE TIMEDATE */
     if (*timelabel.text) {      if (*timelabel.text) {
         /* we worked out coordinates in boundary() */          /* we worked out coordinates in boundary() */
         char str[MAX_LINE_LEN + 1];          char *str;
         time_t now;          time_t now;
         unsigned int x = time_x;          unsigned int x = time_x;
         unsigned int y = time_y;          unsigned int y = time_y;
         time(&now);          time(&now);
           /* there is probably now way to find out in advance how many
            * chars strftime() writes */
           str = gp_alloc(MAX_LINE_LEN + 1, "timelabel.text");
         strftime(str, MAX_LINE_LEN, timelabel.text, localtime(&now));          strftime(str, MAX_LINE_LEN, timelabel.text, localtime(&now));
   
         if (timelabel_rotate && (*t->text_angle) (1)) {          if (timelabel_rotate && (*t->text_angle) (1)) {
Line 1713  int pcount;   /* count of plots in linked list */
Line 1711  int pcount;   /* count of plots in linked list */
          this_label = this_label->next) {           this_label = this_label->next) {
         unsigned int x, y;          unsigned int x, y;
         map_position(&this_label->place, &x, &y, "label");          map_position(&this_label->place, &x, &y, "label");
         strcpy(ss, this_label->text);  
         if (this_label->rotate && (*t->text_angle) (1)) {          if (this_label->rotate && (*t->text_angle) (1)) {
             write_multiline(x, y, ss, this_label->pos, JUST_TOP, 1, this_label->font);              write_multiline(x, y, this_label->text, this_label->pos, JUST_TOP, 1, this_label->font);
             (*t->text_angle) (0);              (*t->text_angle) (0);
         } else {          } else {
             write_multiline(x, y, ss, this_label->pos, JUST_TOP, 0, this_label->font);              write_multiline(x, y, this_label->text, this_label->pos, JUST_TOP, 0, this_label->font);
         }          }
     }      }
   
Line 1742  int pcount;   /* count of plots in linked list */
Line 1739  int pcount;   /* count of plots in linked list */
         yl = key_yt;          yl = key_yt;
   
         if (*key_title) {          if (*key_title) {
             sprintf(ss, "%s\n", key_title);              char *ss = gp_alloc(strlen(key_title) + 2, "tmp string ss");
               strcpy(ss, key_title);
               strcat(ss, "\n");
   
             s = ss;              s = ss;
             yl -= t->v_char / 2;              yl -= t->v_char / 2;
             while ((e = (char *) strchr(s, '\n')) != NULL) {              while ((e = (char *) strchr(s, '\n')) != NULL) {
Line 1763  int pcount;   /* count of plots in linked list */
Line 1763  int pcount;   /* count of plots in linked list */
                 yl -= t->v_char;                  yl -= t->v_char;
             }              }
             yl += t->v_char / 2;              yl += t->v_char / 2;
               free(ss);
         }          }
         yl_ref = yl -= key_entry_height / 2;    /* centralise the keys */          yl_ref = yl -= key_entry_height / 2;    /* centralise the keys */
         key_count = 0;          key_count = 0;
Line 1841  int pcount;   /* count of plots in linked list */
Line 1842  int pcount;   /* count of plots in linked list */
         switch (this_plot->plot_style) {          switch (this_plot->plot_style) {
             /*{{{  IMPULSE */              /*{{{  IMPULSE */
         case IMPULSES:          case IMPULSES:
             plot_impulses(this_plot, axis_zero[y_axis], axis_zero[x_axis]);              plot_impulses(this_plot, axis_zero[x_axis], axis_zero[y_axis]);
             break;              break;
             /*}}} */              /*}}} */
             /*{{{  LINES */              /*{{{  LINES */
Line 1905  int pcount;   /* count of plots in linked list */
Line 1906  int pcount;   /* count of plots in linked list */
             /*}}} */              /*}}} */
             /*{{{  BOXXYERROR */              /*{{{  BOXXYERROR */
         case BOXXYERROR:          case BOXXYERROR:
             plot_boxes(this_plot, axis_zero[x_axis]);              plot_boxes(this_plot, axis_zero[y_axis]);
             break;              break;
             /*}}} */              /*}}} */
             /*{{{  BOXERROR (falls through to) */              /*{{{  BOXERROR (falls through to) */
Line 1916  int pcount;   /* count of plots in linked list */
Line 1917  int pcount;   /* count of plots in linked list */
             /*}}} */              /*}}} */
             /*{{{  BOXES */              /*{{{  BOXES */
         case BOXES:          case BOXES:
             plot_boxes(this_plot, axis_zero[x_axis]);              plot_boxes(this_plot, axis_zero[y_axis]);
             break;              break;
             /*}}} */              /*}}} */
             /*{{{  VECTOR */              /*{{{  VECTOR */
Line 3667  int vert;   /* ... and vertical just - text in hor dir
Line 3668  int vert;   /* ... and vertical just - text in hor dir
 int angle;                      /* assume term has already been set for this */  int angle;                      /* assume term has already been set for this */
 char *font;                     /* NULL or "" means use default */  char *font;                     /* NULL or "" means use default */
 {  {
     /* assumes we are free to mangle the text */  
     register struct termentry *t = term;      register struct termentry *t = term;
     char *p;      char *p = text;
   
       if (!p)
           return;
   
     if (vert != JUST_TOP) {      if (vert != JUST_TOP) {
         /* count lines and adjust y */          /* count lines and adjust y */
         int lines = 0;          /* number of linefeeds - one fewer than lines */          int lines = 0;          /* number of linefeeds - one fewer than lines */
         for (p = text; *p; ++p)          while (*p++) {
             if (*p == '\n')              if (*p == '\n')
                 ++lines;                  ++lines;
           }
         if (angle)          if (angle)
             x -= (vert * lines * t->v_char) / 2;              x -= (vert * lines * t->v_char) / 2;
         else          else
Line 3687  char *font;   /* NULL or "" means use default */
Line 3692  char *font;   /* NULL or "" means use default */
   
     for (;;) {                  /* we will explicitly break out */      for (;;) {                  /* we will explicitly break out */
   
         if ((p = strchr(text, '\n')) != NULL)          if ((text != NULL) && (p = strchr(text, '\n')) != NULL)
             *p = 0;             /* terminate the string */              *p = 0;             /* terminate the string */
   
         if ((*t->justify_text) (hor)) {          if ((*t->justify_text) (hor)) {
Line 3706  char *font;   /* NULL or "" means use default */
Line 3711  char *font;   /* NULL or "" means use default */
   
         if (!p)          if (!p)
             break;              break;
           else {
               /* put it back */
               *p = '\n';
           }
   
         text = p + 1;          text = p + 1;
     }                           /* unconditional branch back to the for(;;) - just a goto ! */      }                           /* unconditional branch back to the for(;;) - just a goto ! */
   
     if (font && *font)      if (font && *font)
         (*t->set_font) (default_font);          (*t->set_font) (default_font);
   
 }  }
   
 /* display a x-axis ticmark - called by gen_ticks */  /* display a x-axis ticmark - called by gen_ticks */
Line 4413  tic_callback callback;  /* fn to call to actually do t
Line 4423  tic_callback callback;  /* fn to call to actually do t
                             gstrftime(label, 24, ticfmt[axis], (double) user);                              gstrftime(label, 24, ticfmt[axis], (double) user);
                         } else if (polar) {                          } else if (polar) {
                             /* if rmin is set, we stored internally with r-rmin */                              /* if rmin is set, we stored internally with r-rmin */
 #if 0                           /* Igor's polar-grid patch */  /* Igor's polar-grid patch */
   #if 1
                               /* HBB 990327: reverted to 'pre-Igor' version... */
                             double r = fabs(user) + (autoscale_r & 1 ? 0 : rmin);                              double r = fabs(user) + (autoscale_r & 1 ? 0 : rmin);
 #else  #else
                             /* Igor removed fabs to allow -ve labels */                              /* Igor removed fabs to allow -ve labels */

Legend:
Removed from v.1.1.1.1  
changed lines
  Added in v.1.1.1.2

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>