I'm creating an image using ggplot2 and ggiraph to my API in plumber.
I am using RStudio on Windows.
When I create an local API (that plumber provides in Swagger) everything seems ok to me.
But, when i use my Docker File with the command docker compose build api
and then docker compose up ap
for an Ubuntu image, the center dont look well.
By center i mean the arg hjust = 0.5
Right below is a piece of my image.
Both annotate
and geom_text()
works locally in my RStudio, but when i use my docker image, the centering dont looks well.
The labels start in center, but when use more and more characters, the string start going to the left.
The code for geom_text
and annotate
:
[...] +
geom_text(data=data.frame(),
aes(label = 'aaaaaaaaaaa',
x = mean(c(df_user$xmin, df_user$xmax)),
y = ymax_rect - (2/7)*(ymax_rect - ymin_rect)),
hjust = 0.5) +
annotate("text",
size = text_size,
label = "a",
color = "#E9EAF9",
x = mean(c(df_user$xmin, df_user$xmax)),
y = ymin_rect + (2/7)*(ymax_rect - ymin_rect),
hjust = 0.5)
I'm start thinking if there is some lib/dependency that i need to install on my docker image to centering labels work properly (that maybe RStudio already does to me, without my knowledge)
The libs I alredy installed are:
FROM rocker/r-ver:4.0.2 as base
# Install gcsfuse
RUN apt-get update && apt-get install gnupg curl fuse -y && apt-get install -y wget
ENV GCSFUSE_REPO=gcsfuse-stretch
RUN apt-get update -y
RUN curl -L -O https://github.com/GoogleCloudPlatform/gcsfuse/releases/download/v0.30.0/gcsfuse_0.30.0_amd64.deb
RUN dpkg --install gcsfuse_0.30.0_amd64.deb
RUN apt-get remove -y curl --purge && apt-get autoremove -y && rm -rf /var/lib/apt/lists/*
# Pandoc
RUN wget https://github.com/jgm/pandoc/releases/download/2.9.2.1/pandoc-2.9.2.1-1-amd64.deb
RUN dpkg -i pandoc-2.9.2.1-1-amd64.deb
# install the linux libraries needed for plumber
RUN apt-get update -qq && apt-get install -y
libssl-dev
libcurl4-gnutls-dev
#libpq-dev # This for RPostgreSQL, if we need someday to use
Any suggestion will help.
Thanks!