static void array_define_yrange(t_glist *x, t_floatarg ylo, t_floatarg yhi) { t_glist *gl = (x->gl_list ? pd_checkglist(&x->gl_list->g_pd) : 0); if (gl && gl->gl_list && pd_class(&gl->gl_list->g_pd) == garray_class) { int n = garray_getarray((t_garray *)gl->gl_list)->a_n; vmess(&x->gl_list->g_pd, gensym("bounds"), "ffff", 0., yhi, (double)(n == 1 ? n : n-1), ylo); vmess(&x->gl_list->g_pd, gensym("xlabel"), "fff", ylo + glist_pixelstoy(gl, 2) - glist_pixelstoy(gl, 0), 0., (float)(n-1)); vmess(&x->gl_list->g_pd, gensym("ylabel"), "fff", glist_pixelstox(gl, 0) - glist_pixelstox(gl, 5), ylo, yhi); } else bug("array_define_yrange"); }
t_float glist_dpixtody(t_glist *x, t_float dypix) { return (dypix * (glist_pixelstoy(x, 1) - glist_pixelstoy(x, 0))); }