Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fullscreen-width figure #94

Open
jtrakk opened this issue Mar 21, 2021 · 2 comments
Open

Fullscreen-width figure #94

jtrakk opened this issue Mar 21, 2021 · 2 comments

Comments

@jtrakk
Copy link

jtrakk commented Mar 21, 2021

I often have a figure that has enough detail that it would benefit from being 100% fullscreen width. That is, all the way from the left edge of the browser to the right edge. Instead of being constrained to between the margins.

image

---
title: Title
author: Author name
output:
  tufte::tufte_handout: default
  tufte::tufte_html: default
  bookdown::tufte_html_book: default

---



Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam mollis erat nec augue dignissim, at fringilla risus dictum. Aliquam venenatis semper ligula nec posuere. Pellentesque dictum quam nec neque varius consequat. Cras consequat est non faucibus convallis. Ut faucibus tempus augue et sagittis. Maecenas nibh lacus, lacinia ac pulvinar aliquet, suscipit in nulla. Aenean nec sapien nec nulla ultrices egestas sit amet nec erat. In finibus turpis velit, eu gravida risus porta nec. In congue, purus quis congue varius, tellus ipsum tempor est, in cursus tortor mauris sit amet odio. Pellentesque id tellus lacinia, molestie magna id, tincidunt libero. Etiam aliquam lorem in ultricies scelerisque. Vestibulum nulla lectus, tempus eu gravida at, vehicula eget eros.

Proin tempor pulvinar fringilla. Morbi elementum sagittis enim sit amet ullamcorper. Nulla sodales diam non nisi tempus, non porta sapien fermentum. Nulla facilisi. Vestibulum semper molestie fringilla. Etiam sed augue vitae sapien auctor viverra. Aliquam sapien magna, ornare a consectetur in, maximus ac ante. Nunc nulla nulla, rhoncus ut consequat ut, pellentesque quis libero. Phasellus hendrerit ipsum ac sollicitudin aliquam. Morbi sed nibh nec nisi ultricies faucibus non vel diam. Suspendisse sollicitudin blandit diam, eget ultrices nisl egestas eget. Curabitur pellentesque vulputate vehicula.

Aenean id augue erat. Aenean non mauris dolor. Nunc pretium lacus eget nisi faucibus, eget aliquam mauris scelerisque. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Mauris eleifend lacinia massa, vitae mattis velit ultricies in. Nulla sed erat ac ante maximus eleifend et id turpis. Nam aliquam sollicitudin urna ut volutpat. Quisque placerat accumsan libero, at elementum lacus consectetur ut.

In ex nibh, mattis in ex in, sodales efficitur massa. Mauris risus nisl, molestie vel scelerisque vitae, tempus ut felis. Integer a malesuada dui, non semper leo. Nulla placerat purus et pharetra consectetur. Nulla vel efficitur lorem. Vivamus nec magna eu purus bibendum efficitur. Quisque euismod risus tellus. Donec elementum eros vitae venenatis venenatis. Vestibulum ullamcorper, odio at hendrerit vestibulum, metus libero ornare eros, non facilisis tortor mauris sed purus. Proin ut massa facilisis, dignissim odio sit amet, vestibulum lectus.

Nulla pulvinar pharetra porta. Cras fringilla libero in lectus porttitor vehicula. Proin faucibus posuere est. Vivamus lacinia consectetur lacus, ut dignissim nisl vehicula eu. Mauris sagittis quam interdum orci efficitur, eget finibus risus sodales. Nam laoreet nulla at consequat dapibus. Aenean non nunc orci. Praesent ornare dapibus odio, eu pellentesque orci dignissim nec. Donec euismod massa turpis, at porta lorem pharetra at. Proin orci arcu, tristique vitae sollicitudin eget, congue at purus. Phasellus ut mi nulla. Donec eu maximus velit. Cras quis diam lobortis, tempus erat et, tincidunt nisl.



```{r, fig.width=30, fig.height=15, fig.fullwidth=TRUE}
library(ggplot2)
ggplot(diamonds) + geom_point(aes(carat, price, color=color))  + facet_grid(cut ~ clarity)+ theme_update(text = element_text(size = 80))
```



Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam mollis erat nec augue dignissim, at fringilla risus dictum. Aliquam venenatis semper ligula nec posuere. Pellentesque dictum quam nec neque varius consequat. Cras consequat est non faucibus convallis. Ut faucibus tempus augue et sagittis. Maecenas nibh lacus, lacinia ac pulvinar aliquet, suscipit in nulla. Aenean nec sapien nec nulla ultrices egestas sit amet nec erat. In finibus turpis velit, eu gravida risus porta nec. In congue, purus quis congue varius, tellus ipsum tempor est, in cursus tortor mauris sit amet odio. Pellentesque id tellus lacinia, molestie magna id, tincidunt libero. Etiam aliquam lorem in ultricies scelerisque. Vestibulum nulla lectus, tempus eu gravida at, vehicula eget eros.

Proin tempor pulvinar fringilla. Morbi elementum sagittis enim sit amet ullamcorper. Nulla sodales diam non nisi tempus, non porta sapien fermentum. Nulla facilisi. Vestibulum semper molestie fringilla. Etiam sed augue vitae sapien auctor viverra. Aliquam sapien magna, ornare a consectetur in, maximus ac ante. Nunc nulla nulla, rhoncus ut consequat ut, pellentesque quis libero. Phasellus hendrerit ipsum ac sollicitudin aliquam. Morbi sed nibh nec nisi ultricies faucibus non vel diam. Suspendisse sollicitudin blandit diam, eget ultrices nisl egestas eget. Curabitur pellentesque vulputate vehicula.

Aenean id augue erat. Aenean non mauris dolor. Nunc pretium lacus eget nisi faucibus, eget aliquam mauris scelerisque. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Mauris eleifend lacinia massa, vitae mattis velit ultricies in. Nulla sed erat ac ante maximus eleifend et id turpis. Nam aliquam sollicitudin urna ut volutpat. Quisque placerat accumsan libero, at elementum lacus consectetur ut.

In ex nibh, mattis in ex in, sodales efficitur massa. Mauris risus nisl, molestie vel scelerisque vitae, tempus ut felis. Integer a malesuada dui, non semper leo. Nulla placerat purus et pharetra consectetur. Nulla vel efficitur lorem. Vivamus nec magna eu purus bibendum efficitur. Quisque euismod risus tellus. Donec elementum eros vitae venenatis venenatis. Vestibulum ullamcorper, odio at hendrerit vestibulum, metus libero ornare eros, non facilisis tortor mauris sed purus. Proin ut massa facilisis, dignissim odio sit amet, vestibulum lectus.

Nulla pulvinar pharetra porta. Cras fringilla libero in lectus porttitor vehicula. Proin faucibus posuere est. Vivamus lacinia consectetur lacus, ut dignissim nisl vehicula eu. Mauris sagittis quam interdum orci efficitur, eget finibus risus sodales. Nam laoreet nulla at consequat dapibus. Aenean non nunc orci. Praesent ornare dapibus odio, eu pellentesque orci dignissim nec. Donec euismod massa turpis, at porta lorem pharetra at. Proin orci arcu, tristique vitae sollicitudin eget, congue at purus. Phasellus ut mi nulla. Donec eu maximus velit. Cras quis diam lobortis, tempus erat et, tincidunt nisl.
@cderv
Copy link
Collaborator

cderv commented Mar 22, 2021

Please for next time, open the issue in the right place. You are here talking about a tufte feature and it should be in tufte. I'll move this issue accordingly.

tufte package aims at following tufte style with main text + margin. Fullwidth figure are a way to benefit from margin for an image in the main body.

Are you specifically needing tufte style ? or are you using it for this full width figure ?

I asked because distill is designed for scientific document, and it offers a very flexible figure layout. See https://rstudio.github.io/distill/figures.html where you'll find way to spread a figure on the page width or even screen width.

This type of layout are pretty specific and so for now they are implemented in some output format only.

Would distill::distill_article() be suitable format for you ?

@cderv cderv transferred this issue from rstudio/bookdown Mar 22, 2021
@jtrakk
Copy link
Author

jtrakk commented Mar 22, 2021

I asked because distill is designed for scientific document, and it offers a very flexible figure layout. See https://rstudio.github.io/distill/figures.html where you'll find way to spread a figure on the page width or even screen width.

That is helpful, thanks. I can use Distill for my document since Distill has the full-width feature. Though ideally I'd be able to make fullscreen width in PDF too, which doesn't seem possible in Distill, and I like the Tufte style which doesn't seem supported either.

Regarding the other questions:

To be honest, I'm not clear on the relationship between R Markdown, Bookdown, Tufte, Distill, etc -- or even if they're in the same category. My best guess is

  1. R Markdown is the input format and its parser package rmarkdown
  2. Tufte, and Distill are "styles"
  3. Latex PDF and HTML are "output formats"
  4. I don't really know how Bookdown relates to the rest of these: is it a "style" like (2)?

I thought I was asking for the fullscreen-width feature for all Rmarkdown styles and output formats, but maybe that's unrealistic?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants