Skip to content

ggplot2's Chinese axis label display #6058

Closed
@trafficfan

Description

@trafficfan

I found a problem with ggplot2 Chinese axis label display, the vertical axis of the Chinese axis label font is always larger than the horizontal axis, the following code in the vertical axis and the horizontal axis of the label are ‘测试中文’, please observe the size of the X Y axis label

I expected These two axis labels are displayed the same large

Here is the code to reproduce the bug:

``` r
library(mlr3verse)
#> Loading required package: mlr3
task = tsk("german_credit")
learner = lrn("classif.ranger", predict_type = 'prob')
split = partition(task)
learner$train(task,row_ids = split$train)
pred = learner$predict(task, row_ids = split$test)
measure = msr("classif.auc")
pred$score(measure)
#> classif.auc 
#>    0.810617
library(ggplot2)
autoplot(pred,type = "roc") +
  labs(x = "测试中文", y = "测试中文") 

Created on 2024-08-26 with reprex v2.1.1


Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions