nx10 / httpgd

Asynchronous http server graphics device for R.
https://nx10.github.io/httpgd
GNU General Public License v2.0
363 stars 19 forks source link

not respecting spacings in ggplot #143

Open fernandoroa opened 6 months ago

fernandoroa commented 6 months ago

Description In VSCode, while using

{
  "r.plot.useHttpgd": true,
}

in settings.json, instead of false, which doesn't show the problem, the font, or the spacings of it are not respected

To Reproduce Make a ggplot and use mono

library(readr)
library(dplyr)
library(ggplot2)

salary_data_file <- "https://raw.githubusercontent.com/datavizpyr/data/master/SO_data_2019/2019_Stack_Overflow_Survey_Education_Salary_US.tsv"
salary_data <- read_tsv(salary_data_file)
salary_data[salary_data$Education == "Bachelor's",]$Education <- "123   789   345"
salary_data[salary_data$Education == "Master's",]$Education   <- "12345 789 12345"

salary_data %>% 
  ggplot(aes(x=Education, y=CompTotal)) +
  geom_boxplot()+
    coord_flip() +
    theme(
      axis.text.y = element_text(family = "mono", size = rel(1))
    )

Expected behavior To see correctly the font and spacing as when using false, respect number of spaces

Screenshots with: false Screenshot from 2023-12-17 09-19-25

with: true Screenshot from 2023-12-17 09-14-03

Environment:

eitsupi commented 6 months ago

Maybe font issue? #138

benz0li commented 5 months ago

@fernandoroa Use figure spaces. See also non-breaking space.