Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best Unicode characters for line graph containing 45° angles [closed]

Tags:

graph

unicode

I am writing code that draws a simple line graph to the Console, and can use Unicode characters. I am looking for the best way to encode 45° angled lines into my graphs.

For instance, here's a 2x2 block of Unicode characters, representing a 45° angled line intersecting a vertical line:

│ 
│╲

In an ideal world, I'd like to find a set of Unicode characters which fits in the same 2x2 space and touches the edges in the same spots, but the diagonal line reaches all the way to the vertical one somehow.

The closest thing I've found is that you could replace the vertical line with , like this, but then the vertical bar won't touch the edges in the same spots, so it won't cleanly fit the rest of the graph.

▕ 
▕╲

Any other ideas?

like image 983
StilesCrisis Avatar asked Oct 19 '25 02:10

StilesCrisis


1 Answers

Different fonts draw "one eighth block" differently, so you just need to choose the font that better suits your needs, e.g.:

Hack font - Hack font

Segoe UI - Segoe UI

MS Gothic - MS Gothic

Other characters, that may be come in handy:

  • U+2595: (Right one eighth block)
  • U+258F: (Left one eighth block)
  • U+2571: (Light diagonal upper right to lower left)
  • U+2572: (Light diagonal upper left to lower right)
  • U+2573: (Light diagonal cross)

More drawing characters: https://en.wikipedia.org/wiki/Box-drawing_character

like image 191
kobalt Avatar answered Oct 22 '25 05:10

kobalt