I would like to put a black border around some text information displayed on a plot. And I haven't been successful. The text information is displayed in 2 columns. The first column is right justified with text and the second column is left justified with number values. The number values don't seem to be fully left justified at the end of the box. This is the code I use:
This is somewhat related to another question that was previously asked 4 years ago but without an answer yet:
GNUPLOT screen position at the end of a "set label" command
reset session
mean = 1.85
variance = 961.67
median = 23.12
lowQuartile = .23
upQuartile = 2.25
set yrange[0:1]
set xrange[0:1]
infostat = sprintf("Mean : \nVariance : \nMedian : \nFirst Quartile : \nThird Quartile : ")
infonumber = sprintf(" %6.2f\n %6.2f\n %6.2f\n %6.2f\n %6.2f", mean, variance, median, lowQuartile, upQuartile)
set style textbox 2 opaque fc rgb 0xffff00 noborder
set style textbox 3 transparent fc rgb 0xffff00 border lc "black"
set label 10 infostat at graph .6,.8 right boxed bs 2 front
set label 11 infonumber at graph .6,.8 left boxed bs 2 front
plot NaN notitle

About text alignment in columns, it's probably the easiest to use a monospace font. I had a related question about space for proportional fonts. It seems it's difficult for gnuplot to get back the exact space from the used graphics libraries. So, any attempt to nicely align numbers will most likely fail with proportional fonts, because the space depends on the numbers themselves. See label 3 and 4 in the example below.
Hence, my suggestion for "tabular" labels would be: use a monospace font.
Script:
Result: (from wxt terminal)