You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sometimes, one thinks that one has set a theme element, but it turns out some downstream theme element overrides your settings.
In the example below, I want the markdown element to display the x-axis title in bold. However, it doesn't because axis.title.x already is a defined theme element in the default theme, which overrules the element_markdown().
Of course, there are plenty of ways to display the axis title in bold, such as setting a more appropriate theme element.
p+ theme(axis.title.x=ggtext::element_markdown())
Since <element_markdown> is a subclass of <element_text>, I think it would be appropriate that the calculation below returns an <element_markdown> object.
calc_element(
"axis.text.x.top",
theme_get() + theme(axis.text=ggtext::element_markdown(colour="red"))
)
#> List of 11#> $ family : chr ""#> $ face : chr "plain"#> $ colour : chr "red"#> $ size : num 8.8#> $ hjust : num 0.5#> $ vjust : num 0#> $ angle : num 0#> $ lineheight : num 0.9#> $ margin : 'margin' num [1:4] 0points 0points 2.2points 0points#> ..- attr(*, "unit")= int 8#> $ debug : logi FALSE#> $ inherit.blank: logi TRUE#> - attr(*, "class")= chr [1:2] "element_text" "element"
Sometimes, one thinks that one has set a theme element, but it turns out some downstream theme element overrides your settings.
In the example below, I want the markdown element to display the x-axis title in bold. However, it doesn't because
axis.title.x
already is a defined theme element in the default theme, which overrules theelement_markdown()
.Of course, there are plenty of ways to display the axis title in bold, such as setting a more appropriate theme element.
Since
<element_markdown>
is a subclass of<element_text>
, I think it would be appropriate that the calculation below returns an<element_markdown>
object.Created on 2023-10-05 with reprex v2.0.2
The text was updated successfully, but these errors were encountered: