mirror of
https://github.com/dankamongmen/notcurses.git
synced 2024-11-06 03:20:26 +00:00
label dependent axis when requested #438
This commit is contained in:
parent
dfd54f540a
commit
3e202d6fa6
@ -146,6 +146,13 @@ redraw_plot(ncplot* n){
|
||||
double interval = (n->maxy - n->miny + 1) / ((double)dimy * states); // FIXME
|
||||
int idx = n->slotstart;
|
||||
const int startx = n->labelaxisd ? PREFIXSTRLEN : 0;
|
||||
if(n->labelaxisd){
|
||||
for(int y = 0 ; y < dimy ; ++y){
|
||||
char buf[PREFIXSTRLEN + 1];
|
||||
ncmetric(interval * states * y, 1, buf, 0, 1000, '\0');
|
||||
ncplane_putstr_yx(ncplot_plane(n), dimy - y - 1, PREFIXSTRLEN - strlen(buf), buf);
|
||||
}
|
||||
}
|
||||
for(uint64_t x = startx ; x < n->slotcount + startx ; ++x){
|
||||
if(x >= (unsigned)dimx){
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user