Code Monkey home page Code Monkey logo

Comments (4)

Bcohn avatar Bcohn commented on May 22, 2024

I'd be happy to take a stab at implementing this, what sort of option would you like to see, specifically? Would it maybe just be better to manually specify the breaks to be at even numbers using the breaks parameter?

from ggthemes.

arnabarnabarnab avatar arnabarnabarnab commented on May 22, 2024

The problem with setting the breaks to even numbers is it gets rid of the specific minimum/maximum of the Tufte Breaks.

I’ve been having a bit of a play, but am not really a proficient enough programmer to be able to implement this. I think that two things would be useful:

  1. Setting the number of significant figures for the tick labels - essentially just applying signif(,digits=x) to the output
  2. Having the option to apply prettyNum() to the output to get rid of the (ugly) trailing zeroes.

A.

On 13 Aug 2015, at 16:06, Brent Cohn [email protected] wrote:

I'd be happy to take a stab at implementing this, what sort of option would you like to see, specifically? Would it maybe just be better to manually specify the breaks to be at even numbers using the breaks parameter?


Reply to this email directly or view it on GitHub #42 (comment).

from ggthemes.

jrnold avatar jrnold commented on May 22, 2024

You can get smarter by passing the function smart_digits_format to labels for the tufte scale (or any scale). It's in the package but I forgot to include any examples.

If you have this, the formatting of the labels is poor.

p <- ggplot(mtcars, aes(wt, mpg)) +
   geom_point()  +
   geom_rangeframe()  +
   theme_tufte() 

p + scale_x_tufte() + scale_y_tufte()

stupidplot

But, adding the option labels = smart_digits_format() and it rounds the min/max labels to reasonable values.

p + scale_x_tufte(labels = smart_digits_format()) +
   scale_y_tufte(labels = smart_digits_format())

smartplot

from ggthemes.

jrnold avatar jrnold commented on May 22, 2024

I'm leaving this open to remind myself to

  • Add smart_digits_format example
  • Make smart_digits_format the default for the Tufte scales.

from ggthemes.

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.