home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume8 / graph+ / part03 / reset.c < prev    next >
Encoding:
C/C++ Source or Header  |  1987-03-01  |  1.3 KB  |  61 lines

  1. /*
  2.  * Copyright (C) 1986   Alan Kent
  3.  *
  4.  * Permission is granted to freely distribute part or
  5.  * all of this code as long as it is not for profit
  6.  * and this message is retained in the code.
  7.  *
  8.  * No resposibility is taken for any damage or incorect
  9.  * results this program generates.
  10.  * 
  11.  */
  12.  
  13.  
  14. #include <stdio.h>
  15. #include "graph.h"
  16. #include "y.tab.h"
  17.  
  18. extern char *PROG_NAME;
  19. extern axis_st xaxis;
  20. extern axis_st yaxis;
  21. extern graph_st graph[];
  22. extern int num_graphs;
  23. extern char *graph_label;
  24. extern int horiz_legend;
  25. extern int vert_legend;
  26.  
  27.  
  28. reset_graphs ()
  29. {
  30.     int i;
  31.  
  32.     xaxis.format = yaxis.format = "%.1f";
  33.     xaxis.user_format = yaxis.user_format = NULL;
  34.     xaxis.label = yaxis.label = "";
  35.     xaxis.scale = yaxis.scale = AUTO;
  36.     xaxis.frame = yaxis.frame = GRID;
  37.     xaxis.linear = yaxis.linear = LINEAR;
  38.     xaxis.auto_tick_size = yaxis.auto_tick_size = 1;
  39.     xaxis.range.min = yaxis.range.min = 0.0;
  40.     xaxis.range.max = yaxis.range.max = -1.0;
  41.     xaxis.interval = yaxis.interval = NULL;
  42.  
  43.     for ( i = 0; i < num_graphs; i++ ) {
  44.     if ( graph[i].label != NULL )
  45.         release ( graph[i].label );
  46.     if ( graph[i].legend != NULL )
  47.         release ( graph[i].legend );
  48.     free_table ( graph[i].table );
  49.     }
  50.  
  51.     if ( graph_label != NULL ) {
  52.     release ( graph_label );
  53.     graph_label = NULL;
  54.     }
  55.  
  56.     num_graphs = 0;
  57.     horiz_legend = RIGHT;
  58.     vert_legend = TOP;
  59. }
  60.  
  61.