rfortherestofus / omni

RMarkdown template, ggplot2 theme, and table function for OMNI Institute
https://rfortherestofus.github.io/omni/
Other
20 stars 3 forks source link

Unable to interactively make ggplots #86

Open dgkeyes opened 4 days ago

dgkeyes commented 4 days ago

Video explanation of issue

@OskaratOmni can you please use the code below to make a new R Markdown document and let me know if this works? Here's a video explanation of a couple things to try as well.

---
title: "OMNI Plot"
author: "David Keyes"
date: "2024-06-28"
output: html_document
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
library(tidyverse)
library(omni)
xx = runif(100, 1, 100)

d_data = data.frame(
  x = xx,
  y = .5 * xx + 2
)

ggplot(d_data, aes(x, y)) +
  geom_point() +
  theme_omni()
dgkeyes commented 4 days ago

Also, the video recording of our last call is here.

OskaratOmni commented 4 days ago

Hey @dgkeyes I just tried this both ways - with and without theme_omni and going to the console and inline.

In all cases when I call theme_omni() i only get a blank square (inline or in the viewer).

I just uploaded a video showing this as well. I know its weird behavior so it might help to see it with your own eyes. :-)

One other thing I tried is adding library(ragg) to the packages and that didn't seem to make a difference.

OskaratOmni commented 4 days ago

@dgkeyes , I uploaded a second video. Now if I switch global settings back to default, from AGG, on the backend graphics device, it works.

I find this really puzzling but wanted you to see that.

dgkeyes commented 4 days ago

Ok, so just to summarize:

With AGG set as the backend graphics device in RStudio:

With the default backend graphics device:

Is that all accurate?

One other question: what version of RStudio do you have? If it's not the newest version, could you update it and let me know if that changes anything?

OskaratOmni commented 1 day ago

Hey @dgkeyes, My first thought was 'yes' this is all correct, but I played with it a little more and so this is current as you've written it with one additional wrinkle. If I set base_family in the them_omni() call to something really basic, like "Arial" the graph will show up interactively with the backend set to AGG. It doesn't show up if it uses Calibri.

It wasn't that long ago that I downloaded fonts, but maybe they get removed at some point during some package downloads? Not sure. But I can double check that.

I am using the current version of R studio.

dgkeyes commented 5 hours ago

Can you try using a different font? Try doing theme_omni(base_family = "Times New Roman") and see what happens. I'm working if it's specific to Calibri or something else.