r - ggplot2 图例标题不尊重 Google 字体的粗体
问题描述
不知道为什么,但是当我使用 showtext::font_add_google 导入“Montserrat”字体时,图例标题不会是粗体:/
require(showtext);require(ggplot2)
font_add_google(name="Montserrat")
ggplot(mpg,aes(cty,hwy,fill=manufacturer))+geom_point()+
theme(text=element_text(family="Montserrat"),legend.title=element_text(face="bold"))
我认为这(部分)有效(尽管没有加粗),因为我在本地安装了蒙特塞拉特。如果我尝试使用尚未安装的字体,即:font_add_google(name="Yesteryear")
我得到这个错误并且没有情节:
Error in grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, :
polygon edge not found
In addition: Warning message:
In grid.Call(C_textBounds, as.graphicsAnnot(x$label), x$x, x$y, :
no font could be found for family "Yesteryear"
解决方案
推荐阅读
- angular - 单击按钮时,Protractor 抛出“等待 Protractor 与页面同步时出错”
- spring-boot - 带有 kubernetes 和 spring boot 应用程序的 Azure 文件存储
- java - 在 Java 中使用通配符作为返回类型
- php - UPDATE 现在没有错误和“成功”,但数据库中仍然没有图像。下面更新了代码
- php - Laravel excel maatwebsite 3.1 导入,excel 单元格中的日期列返回为未知格式数字。如何解决这个问题?
- node.js - 在 AWS ApiGatewayV2 websocket 连接上发出 HTTPs 请求以响应或删除它
- java - 如何洗牌用二维数组制作的牌组
- google-apps-script - 如何将数据从谷歌表单提供给谷歌 bigquery
- javascript - 当他们似乎做同样的事情时,为什么要使用 Enzyme 和 Jest?
- android - 使用谷歌地图颤动单击按钮时如何激活位置?