olavolav / uniplot

Lightweight plotting to the terminal. 4x resolution via Unicode.
MIT License
370 stars 16 forks source link

Incorrect centering of labels with units #11

Closed olavolav closed 2 years ago

olavolav commented 2 years ago

See this example:

>>> plot([1,3,2], height=2)
┌────────────────────────────────────────────────────────────┐
│                              ▘                            ▗│ 3
│▖                                                           │ 1
└────────────────────────────────────────────────────────────┘
 1                             2                            3
>>> plot([1,3,2], height=2, x_unit=" microns")
┌────────────────────────────────────────────────────────────┐
│                              ▘                            ▗│ 3
│▖                                                           │ 1
└────────────────────────────────────────────────────────────┘
 1 microns                     2 microns                    3 microns

What should happen is that the labels are centered, including the units.