NEURON
axis.cpp
Go to the documentation of this file.
1 #include <../../nrnconf.h>
2 /* /local/src/master/nrn/src/oc/axis.cpp,v 1.2 1999/01/04 13:04:55 hines Exp */
3 /*
4 axis.cpp,v
5  * Revision 1.2 1999/01/04 13:04:55 hines
6  * fabs now from include math.h
7  *
8  * Revision 1.1.1.1 1994/10/12 17:22:06 hines
9  * NEURON 3.0 distribution
10  *
11  * Revision 2.63 1993/11/04 15:55:48 hines
12  * port to solaris2 (no more warnings)
13  *
14  * Revision 2.19 1993/02/02 10:34:03 hines
15  * static functions declared before used
16  *
17  * Revision 1.9 92/10/29 09:19:17 hines
18  * some errors in freeing objects fixed and replace usage of getarg for
19  * non numbers.
20  *
21  * Revision 1.8 92/10/14 10:07:55 hines
22  * move oc specific stuff out of axis.cpp and into code2.cpp
23  * new argument function hoc_pgetarg checks for double pointer on stack
24  * and returns it.
25  * hoc_val_pointer(string) returns a pointer to the variable resulting
26  * from parsing the string.
27  *
28  * Revision 1.7 92/10/09 12:13:51 hines
29  * remove old style point process syntax
30  * make hoc_run_expr(sym) much more general
31  * added hoc_run_stmt(sym) as well
32  * create them with hoc_parse_expr(char*, Symlist**) and
33  * hoc_parse_stmt(char*, Symlist**)
34  *
35  * Revision 1.6 92/07/31 08:54:52 hines
36  * following merged from hoc to oc
37  * Stewart Jasloves contribution to axis labels. This can be invoked by
38  * setting #define Jaslove 1. It is 0 by default. The 3rd and 6th arguments
39  * of axis() may have a precision which specifies the number of digits
40  * after the decimal point for axis labels. eg. 5.3 denotes 5 tic marks with
41  * 3 digits after the decimal point for each tic label
42  *
43  *
44  * Revision 1.5 92/04/15 11:22:16 hines
45  * double hoc_run_expr(sym) returns value of expresssion in sym made by
46  * hoc_parse_exper()
47  *
48  * Revision 1.4 92/04/09 12:39:52 hines
49  * ready to add idplot usage with newgraph(), addgraph(), initgraph(), xgraph()
50  * flushgraph().
51  * A facilitating function exists called
52  * Symbol* hoc_parse_expr(char* str, Symlist** psymlist) which
53  * return a procedure symbol which can be used as
54  * hoc_execute(sym->u.u_proc->defn.in);
55  * val = hoc_xpop();
56  *
57  * Revision 1.3 92/03/19 08:57:01 hines
58  * axis labels close to origin set to 0 so label not strange looking.
59  *
60  * Revision 1.2 91/10/18 14:39:40 hines
61  * symbol tables now are type Symlist containing pointers to first and last
62  * symbols. New symbols get added onto the end.
63  *
64  * Revision 1.1 91/10/11 11:11:28 hines
65  * Initial revision
66  *
67  * Revision 4.17 91/03/18 10:38:43 hines
68  * some builtin functions take address of varname. eg. regraph(&name)
69  * regraph saves list of addresses for fast plotting
70  *
71  * Revision 4.11 91/01/23 17:54:20 hines
72  * use emalloc
73  *
74  * Revision 3.99 90/09/18 13:14:31 hines
75  * plotx() and ploty() functions added so that we can hang absolute
76  * location stuff around a scaled point.
77  *
78  * Revision 3.96 90/09/04 08:30:55 hines
79  * try to get dos and unix together again in one RCS directory
80  *
81  * Revision 3.93 90/08/09 09:19:21 hines
82  * axis.cpp placement of labels slightly lowered to look good with FIG
83  *
84  * Revision 3.83 90/07/25 10:39:56 hines
85  * almost lint free on sparc 1+ under sunos 4.1
86  *
87  * Revision 3.82 90/07/25 08:51:10 hines
88  * sun uses color in graph
89  *
90  * Revision 3.53 90/03/22 16:22:18 jamie
91  * correct error with checkin
92  *
93  * Revision 3.47 90/03/22 15:22:18 jamie
94  * Jamie's Additions stopwatch and settext.
95  *
96  * Revision 3.46 90/01/24 06:35:48 mlh
97  * emalloc() and ecalloc() are macros which return null if out of space
98  * and then call execerror. This ensures that pointers are set to null.
99  * If more cleanup necessary then use hoc_Emalloc() followed by hoc_malchk()
100  *
101  * Revision 3.29 89/10/19 06:54:44 mlh
102  * printing directed through plprint(string) instead
103  * of detailed routing at each place
104  *
105  * Revision 3.7 89/07/13 08:20:25 mlh
106  * stack functions involve specific types instead of Datum
107  *
108  * Revision 3.4 89/07/12 10:25:54 mlh
109  * Lint free
110  *
111  * Revision 3.3 89/07/10 15:44:02 mlh
112  * Lint pass1 is silent. Inst structure changed to union.
113  *
114  * Revision 2.0 89/07/07 16:01:42 mlh
115  * ready to add cable stuff
116  *
117 */
118 /* version 7.1.1 12/8/88
119  change graph to not interact with plot. Adding graphmode(mode).
120  */
121 /* version 7.1.2 12/20/88
122  ordinate labels not positioned correctly on laser writer because
123  leading spaces not printed
124  */
125 /* version 7.1.3 12/29/88
126  sometimes doesn't return to last point after flushing
127  because call to axis from setup can destroy xsav and ysav
128  */
129 /* version 7.2.1 2-jan-89
130  make sure graph(t) and graphmode dont try to do anything when graph list is
131  empty. Replace onerr with static badgraph which is one when graph is empty.
132  */
133 
134 #include <stdio.h>
135 #include <stdlib.h>
136 #include <math.h>
137 #include "hoc.h"
138 #include "gui-redirect.h"
139 
140 
141 extern Object** (*nrnpy_gui_helper_)(const char* name, Object* obj);
142 extern double (*nrnpy_object_to_double_)(Object*);
143 
144 # define CLIP 1e9
145 # define XS 500.
146 # define YS 400.
147 # define XO 100.
148 # define YO 100.
149 # define Ret(a) hoc_ret(); hoc_pushx(a);
150 
151 /* This makes it easier to save and restore the 8 plot scale parameters*/
152 #define NPARAM 10
153 static double param[NPARAM] = {
154  XO, YO, XS, YS, -1e9,-1e9,1e9,1e9,0.0,0.0
155 };
156 #define xorg param[0]
157 #define yorg param[1]
158 #define xscale param[2]
159 #define yscale param[3]
160 #define xlow param[4]
161 #define ylow param[5]
162 #define xhigh param[6]
163 #define yhigh param[7]
164 #define xsav param[8]
165 #define ysav param[9]
166 
167 static double XSIZE=XS, YSIZE=YS, XORG=XO, YORG=YO;
168 static double xstart=0., xstop=1., ystart=0., ystop=1.;
169 static double xinc=1., yinc=1.;
170 static double lastmode=1;
171 static double clip=CLIP;
172 static int grphing=0; /* flag true if multiple graphs */
173 
174 static int SaveForRegraph=0;
175 static int regraph_index;
176 static int max_regraph_index = 1000;
177 static int regraph_narg[1000];
178 static int regraph_mode[1000];
179 static int regraph_color[1000];
180 static double regraph_x[1000];
181 static double *regraph_y[1000];
182 
183 static int PLOT(int, int, double, double);
184 static void free_graph(void);
185 static void plotstream(int, int, double);
186 static void plotflush(int);
187 static void do_setup(void);
188 
189 void hoc_regraph(void) {
190  TRY_GUI_REDIRECT_DOUBLE("regraph", NULL);
191 
194  regraph_index++;
195  }
196  Ret(1.)
197 }
198 static void open_regraph(void){
199  SaveForRegraph=1;
200  regraph_index = 0;
201 }
202 static void close_regraph(void) {
203  SaveForRegraph=0;
204 }
205 static void do_regraph(void) {
206  int i;
207  for (i=0; i<regraph_index; i++) {
208  if (regraph_color[i] != color) {
210  }
212  *regraph_y[i]);
213  }
214 }
215 static void save_regraph_item(int narg, int mode, double x)
216 {
218  regraph_mode[regraph_index] = mode;
221  if (narg == 1 && regraph_index < max_regraph_index) {
223  regraph_index++;
224  }
225 }
226 
227 void hoc_Plot(void) {
228  TRY_GUI_REDIRECT_DOUBLE("plot", NULL);
229 
230  double ok;
231  int narg, mode;
232 
233  if (ifarg(3)) {
234  narg = 3;
235  mode = (int)*getarg(1);
236  xsav = *getarg(2);
237  ysav = *getarg(3);
238  }else if (ifarg(2)) {
239  narg = 2; mode=0;
240  xsav = *getarg(1);
241  ysav = *getarg(2);
242  }else if (ifarg(1)) {
243  narg = 1;
244  mode = (int)*getarg(1);
245  if (mode == -10) {
246  open_regraph();
247  Ret(1.); return;
248  }else if (mode == -11) {
249  close_regraph();
250  Ret(1.); return;
251  }else if (mode == -12) {
252  do_regraph();
253  Ret(1.); return;
254  }
255  }else{
256  Printf("plot(mode)\nplot(x, y)\nplot(mode, x, y\n");
257  Printf("axis()\naxis(clip)\naxis(xorg, xsize, yorg, ysize)\n");
258  Printf("axis(xstart, xstop, ntic, ystart, ystop, ntic)\n");
259  Ret(1.);
260  return;
261  }
262  ok = PLOT(narg, mode, xsav, ysav);
263  Ret(ok);
264 }
265 
266 static int PLOT(int narg, int mode, double x, double y)
267 {
268  int ok;
269 
270  ok = 1;
271  if (SaveForRegraph) {
272  save_regraph_item(narg, mode, x);
273  }
274  if (narg==1)
275  {
276  lastmode = mode;
277  return ok;
278  }
279  else if (narg==2)
280  {
281  if((mode = lastmode) == 1)
282  lastmode = 2;
283  }
284  else
285  {
286  lastmode = mode;
287  if((mode = lastmode) == 1)
288  lastmode=2;
289  }
290  x = xorg + xscale*x; y = yorg + yscale*y;
291  if (x <= xhigh && x >= xlow && y <=yhigh && y >= ylow) {
292  plt(mode, x, y);
293  } else if (mode > 0) {
294  lastmode = 1;
295  ok = 0;
296  }
297  return ok;
298 }
299 void hoc_plotx(void) {
300  double val;
301  val = xorg + *getarg(1)*xscale;
302  Ret(val);
303 }
304 void hoc_ploty(void) {
305  double val;
306  val = yorg + *getarg(1)*yscale;
307  Ret(val);
308 }
309 
310 # define WIDTH 10.
311 # define HEIGHT 10.
312 void hoc_axis(void)
313 {
314  TRY_GUI_REDIRECT_DOUBLE("axis", NULL);
315 
316 #if DOS
317  extern int newstyle;
318  extern unsigned text_style, text_orient, text_size;
319 #endif
320  int width, height;
321  double x, y;
322  double i, j, offset;
323  char s[200];
324  double x0, y0;
325 #define Jaslove 0
326 #if Jaslove
327 /* tick mark values are printed with the precision indicated in the call
328  to axis() from hoc. For example, if x ticks is 10.2 then the number
329  of ticks (xinc) is 10, and the precision (xprec) is 2 decimal places.
330  The first Sprintf() below builds the precision for the second Sprintf(),
331  so in the above example values would essentially be output as
332  printf("%.2f",x), in which x is the real value of the tick mark.
333 */
334  char ss[6];
335  static double xprec=.1, yprec=.1;
336 #endif /*Jaslove*/
337  if (ifarg(6))
338  {
339  xstart = *getarg(1);
340  xstop = *getarg(2);
341  xinc = *getarg(3);
342  ystart = *getarg(4);
343  ystop = *getarg(5);
344  yinc = *getarg(6);
345 #if Jaslove
346  xprec = xinc - floor(xinc);
347  yprec = yinc - floor(yinc);
348 #endif
349  xinc = floor(xinc);
350  yinc = floor(yinc);
351  }
352  else if (ifarg(4)) {
353  XORG = *getarg(1);
354  XSIZE = *getarg(2);
355  YORG = *getarg(3);
356  YSIZE = *getarg(4);
357  }
358  else if (ifarg(1)) {
359  clip = *getarg(1);
360  }
361  xscale = XSIZE/(xstop - xstart);
362  yscale = YSIZE/(ystop - ystart);
363  xorg = XORG - xstart*xscale;
364  yorg = YORG - ystart*yscale;
365  xlow = xstop - clip*(xstop - xstart); xlow = xorg + xscale*xlow;
366  xhigh = xstart + clip*(xstop - xstart); xhigh = xorg + xscale*xhigh;
367  ylow = ystop - clip*(ystop - ystart); ylow = yorg + yscale*ylow;
368  yhigh = ystart + clip*(ystop - ystart); yhigh = yorg + yscale*yhigh;
369  if (xorg < XORG || xorg > XORG+XSIZE)
370  x0 = XORG;
371  else
372  x0 = xorg;
373  if (yorg < YORG || yorg > YORG+YSIZE)
374  y0 = YORG;
375  else
376  y0 = yorg;
377 
378  if (!ifarg(1)) {
379  plt(1,XORG,y0);
380  for (x = xstart; x <= xstop+1e-10; x=x+(xstop-xstart)/xinc){
381  i = xorg + xscale*x;
382  plt(2,i,y0); plt(2,i,y0+10.); plt(1,i,y0);
383  }
384  plt(1,x0,YORG);
385  for (y = ystart; y <= ystop+1e-10; y = y+(ystop-ystart)/yinc){
386  j = yorg + yscale*y;
387  plt(2,x0,j); plt(2,x0+10.,j); plt(1,x0,j);
388  }
389 
390 #if DOS
391  if (newstyle) {
392  settextstyle(text_style,text_orient,text_size);
393  newstyle = 0;
394  }
395  width = textwidth("O")*1.5;
396  height = textheight("O");
397 #else
398  width = WIDTH;
399  height = HEIGHT;
400 #endif
401 
402 
403 #if Jaslove
404  Sprintf(ss, "%%%.1ff", xprec);
405 #endif
406  for (x = xstart; x <= xstop+1e-10; x=x + (xstop-xstart)/xinc){
407  i = xorg + xscale*x;
408 #if Jaslove
409  Sprintf(s, ss, x);
410 #else
411  if (fabs(x) < 1e-10) {
412  x = 0.;
413  }
414  Sprintf(s, "%g", x);
415 #endif
416  offset = width*(int)strlen(s)/2;
417  if( i == x0 && y0 != YORG )
418  offset = -width/2;
419 #if DOS
420  plt(1,i-offset,y0-height); plt(-2,0.,0.);
421 #else
422  plt(1,i-offset,y0-1.5*height); plt(-2,0.,0.);
423 #endif
424  plprint(s);
425  }
426 
427 #if Jaslove
428  Sprintf(ss, "%%%.1ff", yprec);
429 #endif
430  for (y = ystart; y <= ystop+1e-10; y = y+(ystop-ystart)/yinc){
431 #if Jaslove
432  Sprintf(s, ss, y);
433 #else
434  if (fabs(y) < 1e-10) {
435  y = 0.;
436  }
437  Sprintf(s, "%g", y);
438 #endif
439  offset = width*(int)strlen(s) + width;
440  j = yorg + yscale*y;
441  if ( j == y0 && x0 != XORG )
442 #if DOS
443  plt(1, x0-offset, j+height);
444 #else
445  plt(1, x0-offset, j+2.);
446 #endif
447  else
448 #if DOS
449  plt(1,x0-offset,j+height/2);
450 #else
451  plt(1,x0-offset,j-6.);
452 #endif
453 
454  plt(-2,0.,0.);
455  plprint(s);
456  }
457  plt(-1,0.,0.);
458  }
459  Ret(1.);
460 }
461 
462 /* prior to version 7.1.1
463 graph connects with the plot functions in such a way that multiple
464 line graphs can be generated by using the plot function in the same way
465 that one creates a single plot.
466 
467 graph() starts a new list of expressions and setup statements
468 graph("expr", "setup") adds this spec to the list
469 graph(1) executes the setup statements
470 graph(-1) flushes remaining part of graph
471  version 7.1.1
472  graph(t) accumulates a point with this abscissa for all expr in list.
473  graphmode(1) executes setup statements
474  graphmode(-1) flushes remaining part of graph, next graphs with start
475  new lines
476  graphmode(2...) flushes, but next graphs don't start new lines
477 */
478 
479 /* local info for graph */
480 static int initialized; /* true if the setup statements have been executed*/
481 static Symlist *graph_sym_list; /*list of expressions and setup statements*/
482 #define MAXCNT 50
483 static int pcnt; /* points per plot already stored */
484 static int badgraph=1; /* graph data structure is no good or empty */
485 static double *lx; /* points to array which holds abscissa values */
486 
487 typedef struct Grph { /* holds info for graphing */
488  struct Grph *g_next; /*next one in the queue*/
489  Symbol *g_sexp; /* symbol for the expression */
490  Symbol *g_setup; /* symbol for the setup statement */
491  int g_color;
492  double g_param[NPARAM]; /* holds plot scale factors, etc. */
493  double g_val[MAXCNT]; /* y value buffer to plot */
494 } Grph;
495 
496 static Grph *glist_head, *glist_tail; /* access for the queue */
497 
498 void hoc_Graph(void) {
499  TRY_GUI_REDIRECT_DOUBLE("graph", NULL);
500 
501  Grph *g;
502 
503 if (ifarg(2)) {
504  if (badgraph) {
505  free_graph();
506  }
507  badgraph = 1; /* if this is not reset at end then we had an execerror*/
508  initialized = pcnt = 0;
509  if (glist_head == (Grph *)0) {
510  lx = (double *)emalloc(sizeof(double)*MAXCNT);
511  }
512  g = (Grph *)emalloc(sizeof(Grph));
513  g->g_next = (Grph *)0;
514  g->g_sexp = g->g_setup = (Symbol *)0;
515  if (glist_tail != (Grph *)0) {
516  glist_tail->g_next = g;
517  }else{
518  glist_head = g;
519  }
520  glist_tail = g;
521 
522  g->g_sexp = hoc_parse_expr(gargstr(1), &graph_sym_list);
523  g->g_setup = hoc_parse_stmt(gargstr(2), &graph_sym_list);
524  badgraph = 0; /* successful */
525  grphing = 1;
526 
527 }else if (ifarg(1) && !badgraph) {
528  plotstream(2,2,*getarg(1));
529 }else{
530  free_graph();
531  badgraph = 1;
532 }
533  Ret(0.);
534 }
535 
536 void hoc_Graphmode(void)
537 {
538  TRY_GUI_REDIRECT_DOUBLE("graphmode", NULL);
539  int mode;
540 if (!badgraph) {
541  mode = *getarg(1);
542  if (mode == 1) {
543  do_setup();
544  }
545  if (mode == -1) {
546  plotflush(1);
547  }
548  if (mode > 1 && pcnt > 0) {
549  plotflush(2);
550  }
551 }
552  Ret(0.);
553 }
554 
555 static void free_graph(void) {
556  Grph *g, *gnext;
557  /* free all graph space and reinitialize */
558  hoc_free_list(&graph_sym_list);
559  for (g = glist_head; g != (Grph *)0; g = gnext) {
560  gnext = g->g_next;
561  free((char *)g);
562  }
563  if (lx) {
564  free((char *)lx);
565  lx = (double *)0;
566  }
567  glist_head = glist_tail = (Grph *)0;
568  grphing = initialized = pcnt = 0;
569 }
570 
571 static void plotstream(int narg, int mode, double x)
572 {
573  Grph *g;
574 
575  if (narg == 1 || narg == 3) {
576  plotflush(1);
577  IGNORE(PLOT(narg, mode, xsav, ysav));
578  }
579  if (pcnt >= MAXCNT) {
580  plotflush(2);
581  }
582  if (narg == 2 || narg == 3) {
583  lx[pcnt] = x;
584  for (g = glist_head; g != (Grph *)0; g = g->g_next) {
585  g->g_val[pcnt] = hoc_run_expr(g->g_sexp);
586  }
587  pcnt++;
588  }
589 }
590 
591 static void plotflush(int contin)
592 {
593  /* contin = 1 then flush after this will start with new points
594  contin = 2 then it will start with last points of this flush
595  */
596  int savcolor;
597  int i, savmode;
598  double parsav[NPARAM];
599  Grph *g;
600 
601  savmode = lastmode;
602  if (!initialized) {
603  do_setup();
604  }
605  for (i=0; i<NPARAM; i++ ) {
606  parsav[i] = param[i];
607  }
608  savcolor = color;
609  for (g = glist_head; g != (Grph *)0; g=g->g_next) {
610  for (i=0; i<NPARAM; i++) {
611  param[i] = g->g_param[i];
612  }
613  if (color != g->g_color) {
614  IGNORE(set_color(g->g_color));
615  }
616  IGNORE(PLOT(1,1,0.,0.));
617  for (i=0; i<pcnt; i++) {
618  IGNORE(PLOT(2, 0, lx[i], g->g_val[i]));
619  }
620  if (contin == 2) {
621  g->g_val[0] = g->g_val[pcnt-1];
622  }
623  }
624  for (i=0; i<NPARAM; i++ ) {
625  param[i] = parsav[i];
626  }
627  if (savcolor != color) {
628  IGNORE(set_color(savcolor));
629  }
630  if (contin == 2 && pcnt > 0) {
631  lx[0] = lx[pcnt-1];
632  pcnt = 1;
633  IGNORE(PLOT(3,1,xsav,ysav)); /* last point of explicit plot */
634  }
635  lastmode = savmode;
636  if (contin == 1) {
637  pcnt = 0;
638  }
639 }
640 
641 static void do_setup(void) {
642  Grph *g;
643  double parsav[NPARAM];
644  int i;
645  int savcolor;
646 
647  for (i=0; i<NPARAM; i++ ) {
648  parsav[i] = param[i];
649  }
650  savcolor = color;
651  for (g = glist_head; g != (Grph *)0; g = g->g_next) {
652  hoc_run_stmt(g->g_setup);
653  for (i=0; i<NPARAM; i++ ) {
654  g->g_param[i] = param[i];
655  }
656  g->g_color = color;
657  }
658  for (i=0; i<NPARAM; i++ ) {
659  param[i] = parsav[i];
660  }
661  if (savcolor != color) {
662  IGNORE(set_color(savcolor));
663  }
664  initialized = 1;
665 }
666 
667 
Definition: hocdec.h:84
static int regraph_mode[1000]
Definition: axis.cpp:178
#define Printf
Definition: model.h:252
static int max_regraph_index
Definition: axis.cpp:176
static double XSIZE
Definition: axis.cpp:167
Symbol * g_setup
Definition: axis.cpp:490
double(* nrnpy_object_to_double_)(Object *)
Definition: xmenu.cpp:14
void hoc_free_list(Symlist **)
static void do_regraph(void)
Definition: axis.cpp:205
#define yscale
Definition: axis.cpp:159
static double ystart
Definition: axis.cpp:168
#define NPARAM
Definition: axis.cpp:152
static double xstart
Definition: axis.cpp:168
struct Grph * g_next
Definition: axis.cpp:488
#define WIDTH
Definition: axis.cpp:310
#define YS
Definition: axis.cpp:146
static void close_regraph(void)
Definition: axis.cpp:202
#define g
Definition: passive0.cpp:23
Symbol * hoc_parse_stmt(const char *, Symlist **)
Definition: code2.cpp:664
static void plotflush(int)
Definition: axis.cpp:591
#define Ret(a)
Definition: axis.cpp:149
unsigned int text_orient
Definition: settext.cpp:10
static double clip
Definition: axis.cpp:171
static int regraph_narg[1000]
Definition: axis.cpp:177
#define xsav
Definition: axis.cpp:164
unsigned int text_style
Definition: settext.cpp:10
static int narg()
Definition: ivocvect.cpp:135
void hoc_run_stmt(Symbol *)
Definition: code2.cpp:657
static double param[NPARAM]
Definition: axis.cpp:153
static double XORG
Definition: axis.cpp:167
#define plprint
Definition: redef.h:110
static double regraph_x[1000]
Definition: axis.cpp:180
static Grph * glist_head
Definition: axis.cpp:496
void hoc_Graph(void)
Definition: axis.cpp:498
#define e
Definition: passive0.cpp:24
#define gargstr
Definition: hocdec.h:14
Definition: axis.cpp:487
static void plotstream(int, int, double)
Definition: axis.cpp:571
double * hoc_pgetarg(int narg)
Definition: code.cpp:1604
#define IGNORE(arg)
Definition: model.h:262
int newstyle
Definition: settext.cpp:9
Symbol * hoc_parse_expr(const char *str, Symlist **psymlist)
Definition: code2.cpp:630
#define ylow
Definition: axis.cpp:161
static double * regraph_y[1000]
Definition: axis.cpp:181
static int grphing
Definition: axis.cpp:172
#define color
Definition: rbtqueue.cpp:50
double g_val[MAXCNT]
Definition: axis.cpp:493
#define TRY_GUI_REDIRECT_DOUBLE(name, obj)
Definition: gui-redirect.h:54
_CONST char * s
Definition: system.cpp:74
#define plt
Definition: redef.h:14
static Symlist * graph_sym_list
Definition: axis.cpp:481
static double YORG
Definition: axis.cpp:167
#define XO
Definition: axis.cpp:147
int val
Definition: dll.cpp:167
#define xorg
Definition: axis.cpp:156
#define xhigh
Definition: axis.cpp:162
struct Grph Grph
static int regraph_index
Definition: axis.cpp:175
static double lastmode
Definition: axis.cpp:170
static Grph * glist_tail
Definition: axis.cpp:496
int
Definition: nrnmusic.cpp:71
static void open_regraph(void)
Definition: axis.cpp:198
static int initialized
Definition: axis.cpp:480
double hoc_run_expr(Symbol *sym)
Definition: code2.cpp:622
int set_color(int c)
Definition: plot.cpp:865
#define MAXCNT
Definition: axis.cpp:482
#define YO
Definition: axis.cpp:148
void hoc_Graphmode(void)
Definition: axis.cpp:536
#define yhigh
Definition: axis.cpp:163
size_t j
Definition: model.h:57
char * name
Definition: init.cpp:16
char * emalloc(unsigned n)
Definition: list.cpp:189
int g_color
Definition: axis.cpp:491
void hoc_regraph(void)
Definition: axis.cpp:189
static void free_graph(void)
Definition: axis.cpp:555
int ifarg(int)
Definition: code.cpp:1562
static double xinc
Definition: axis.cpp:169
static double YSIZE
Definition: axis.cpp:167
static double yinc
Definition: axis.cpp:169
static int PLOT(int, int, double, double)
Definition: axis.cpp:266
#define xlow
Definition: axis.cpp:160
static int pcnt
Definition: axis.cpp:483
void hoc_Plot(void)
Definition: axis.cpp:227
#define ysav
Definition: axis.cpp:165
unsigned int text_size
Definition: settext.cpp:10
Definition: hocdec.h:226
#define HEIGHT
Definition: axis.cpp:311
#define getarg
Definition: hocdec.h:15
#define i
Definition: md1redef.h:12
#define yorg
Definition: axis.cpp:157
static double ystop
Definition: axis.cpp:168
static int badgraph
Definition: axis.cpp:484
static double * lx
Definition: axis.cpp:485
static void save_regraph_item(int narg, int mode, double x)
Definition: axis.cpp:215
floor
Definition: extdef.h:3
fabs
Definition: extdef.h:3
static double xstop
Definition: axis.cpp:168
void hoc_plotx(void)
Definition: axis.cpp:299
#define Sprintf
Definition: model.h:248
static int regraph_color[1000]
Definition: axis.cpp:179
void hoc_ploty(void)
Definition: axis.cpp:304
double g_param[NPARAM]
Definition: axis.cpp:492
#define xscale
Definition: axis.cpp:158
static int SaveForRegraph
Definition: axis.cpp:174
return NULL
Definition: cabcode.cpp:461
Symbol * g_sexp
Definition: axis.cpp:489
static void do_setup(void)
Definition: axis.cpp:641
void hoc_axis(void)
Definition: axis.cpp:312
#define CLIP
Definition: axis.cpp:144
#define XS
Definition: axis.cpp:145