Coder Social home page Coder Social logo

Size as aestetic about ggfittext HOT 2 CLOSED

wilkox avatar wilkox commented on May 29, 2024
Size as aestetic

from ggfittext.

Comments (2)

BradyAJohnston avatar BradyAJohnston commented on May 29, 2024

Hi @rasmusagren I don't know if you've had success with this, but in poking around trying to get some other stuff working I found that you can do that without a problem. You can pass size as one of the ... arguments in geom_fit_text(size = 8).

The font should only increase in size if you specify grow = TRUE.

Normal

ggplot(animals, aes(x = type, y = flies, label = animal)) +
  geom_tile(fill = "white", colour = "black") +
  geom_fit_text()

image

Specific size

ggplot(animals, aes(x = type, y = flies, label = animal)) +
  geom_tile(fill = "white", colour = "black") +
  geom_fit_text(size = 10)

image

Growing Smaller Text

ggplot(animals, aes(x = type, y = flies, label = animal)) +
  geom_tile(fill = "white", colour = "black") +
  geom_fit_text(grow = TRUE)

image

from ggfittext.

wilkox avatar wilkox commented on May 29, 2024

Thanks Brady for your response, and sorry Rasmus it's taken me so long to get to this issue! Brady's answer is correct – the default situation is for the text to have a fixed size (12 by default, but can be changed with the size argument) and only shrink if the box is too small. You should only get the 'huge' labels if grow = TRUE, or if size 12 is already very large compared to the size of your boxes. In the latter case you should probably set a smaller size.

If it's still not looking the way you want please post a reprex and I can try and tweak it for you.

from ggfittext.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.