GithubHelp home page GithubHelp logo

Comments (1)

ibecav avatar ibecav commented on August 16, 2024

Hi,

Glad you find it useful. No magic bullet for this. Don't know if you've looked at the relevant vignette where I write this:

Finally, let me take a moment about crowding and labeling. I’ve made every effort to try and deconflict the labels on the left and right axis (in this example the Country) and that should work automatically as you resize your plot dimensions. ** pro tip - if you use RStudio you can press the zoom icon and then use the rescaling of the window to see best choices **.

But the numbers (GDP) are a different matter and there’s no easy way to ensure separation in a case like this data. There’s a decent total spread from 57.4 to 20.7 and some really close measurements like France, Belgium, and Germany on the right side. My suggestion is in a case like this one you create a new column in your dataframe with two significant places. So specifically it would be newgdp$rGDP <- signif(newgdp$GDP, 2). In my testing, at least, I’ve found this helps without creating inaccuracy and not causing you to try and “stretch” vertically to disambiguate the numbers. This time I’ll also use LineColor to highlight how Canada, Finland and Belgium fare from 1970 to 1979.

So after a quick look at the pdf file you enclosed. You could:

  1. Change the overall dimensions of the plot to make it taller and less wide (that's what've done in rmd file for the vignette.
  2. You can try my rounding trick as described in the vignette
  3. Go to the top 10 or 15 themes or make it two pages (the bottom ones will spread out as you remove the top.
  4. I recently added a new Data.label | an optional column inside the dataframe that will be used as the label for the data points plotted. Can be complex strings and have NAvalues but must be of classchr. By default Measurementis converted tochr and used. so for example for all those items under 4.0% you could create a custom label that was "<4%"

Some easy examples of how to use it

newcancer$datalabel <- paste0(newcancer$Survival, "%")
newggslopegraph(newcancer, Year, Survival, Type, Data.label = datalabel)

newcancer <-
   newcancer %>%
   mutate(datalabel = case_when(Survival <= 4 ~ "< 4.0%",
                                TRUE ~ paste0(Survival, "%")))
newggslopegraph(newcancer, Year, Survival, Type, Data.label = datalabel)

from cgpfunctions.

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.