Questions tagged [latex2exp]

7 questions
1
vote
1 answer

Using Latex math fonts in R plots

I am frequently using Latex to use custom math expressions in titles and axis labels of R plots. As described here, this can be achieved using the latex2exp package. Is it somehow possible to include Latex special fonts for mathmode? Specifically, I…
chm
  • 51
  • 6
1
vote
0 answers

Error: '\c' is an unrecognized escape in character string starting

I am trying to add labels into a factor with Latex expressions with latex2exp with the following reproducible code: library(latex2exp) datplot <- setNames(data.frame(matrix(ncol = 4,nrow = 216000)), c('Fz','Cz','Pz','bta')) datplot$bta <-…
Unai Vicente
  • 367
  • 3
  • 10
1
vote
1 answer

Latex2exp (TeX command) affects label alignment in ggplot?

A geom_boxplot that has x-axis labels with linebreaks ("\n") works great. library(ggplot2) library(latex2exp) theme_set(theme_grey()) set.seed(10) df <- data.frame(y=rnorm(120), x=rep(c("bar", …
1
vote
0 answers

R latex2exp, Error in str2expression(rendered): "could not find function "str2expression"

I am trying to write LaTex formulas in ggplot titles and labels by using Tex function from latex2exp, like library(tidyverse) library(latex2exp) x = c(1,2,3) y = c(10, 3, 2) ggplot(data = data.frame(x = x, y = y), aes(x,y)) + geom_point() + …
Brzoskwinia
  • 371
  • 2
  • 11
0
votes
0 answers

Wrong output for latex2exp commands

I have been using the latex2exp package for many years, but ever since it switched to the latest version (using the "raw" syntaxis), it has ceased to function (the old syntaxis does not work either). I am working on Windows and have updated all my R…
JCano
  • 25
  • 5
0
votes
1 answer

Legend text cuts off using latex2exp in R plot

The text in my legend cuts off using library(latex2exp) in a…
AlexLee
  • 429
  • 4
  • 11
0
votes
1 answer

Problem with ggpubr and latex2exp expression

I have an arranged plot (using ggpubr::ggarrange) containing a LaTeX expression (math symbol for "times") in the title. Consider the following code: # install.packages("ggplot2) # install.packages("latex2exp) #…
Ivo
  • 3,890
  • 5
  • 22
  • 53