JuliaPlots / UnicodePlots.jl

Unicode-based scientific plotting for working in the terminal
Other
1.42k stars 77 forks source link

Plot border and axis markers are the same color as background #336

Closed marekdedic closed 1 year ago

marekdedic commented 1 year ago

Hi, I thought my plot was missing the plot border, axes and their markers:

Screenshot from 2023-02-23 11-21-54

However, when I select over the whole plot, it reveals they are there, just not shown:

Screenshot from 2023-02-23 11-22-02

I am using alacritty as my terminal emulator with the tomorrow night color theme.

t-bltg commented 1 year ago

You can change the border color like this, if the current overlaps with your terminal background color:

julia> using UnicodePlots
julia> UnicodePlots.BORDER_COLOR[] = :white  # default is :dark_gray
julia> lineplot(1:2)
[...]

This is terminal dependent, and I don't think we can find a suitable default value for all terminals and colorschemes out there.

marekdedic commented 1 year ago

Hi, thanks, if I may, I have 2 further questions:

  1. Could this not be set automatically?
  2. Is there a way to do this through the Plots.jl API?

Thanks!

t-bltg commented 1 year ago
  1. Automatically ... to what ? We unfortunately cannot detect the type of terminal / colorscheme you are working with. But I may be missing something here ?
  2. Apart from doing the following, there is no other way:
    julia> using Plots
    julia> unicodeplots()
    julia> Plots.UnicodePlots.BORDER_COLOR[] = :white
marekdedic commented 1 year ago
  1. Well I thought there was a way to detect the fg/bg color of the terminal - if there isn't, then yeah, there is no universal good choice...
t-bltg commented 1 year ago

I'd like to precise: there is no method to determine the colours to my current knowledge, which might be limited and of course I'm open to contributions regarding that matter. Furthermore, I use Linux, so I'm incompetent in anything related to other OSs.