Skip to content

added geom_text #1435

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

Merged
merged 3 commits into from
Aug 15, 2019
Merged

added geom_text #1435

merged 3 commits into from
Aug 15, 2019

Conversation

kojisposts
Copy link
Contributor

No description provided.

Copy link
Contributor

@michaelbabyn michaelbabyn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The content here looks good to me but there's a formatting issue with underscores in the markdown that should be fixed. It would also be nice to assign the data in each example so they can each be run independently.

```

### Customed Colour and Size Scale
Let's use the LaCroixColoR package to spruce up the colour scheme. In addition, by using scale_size_continuous, we can make sure that none of the text is too small.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The underscores in scale_size_continuous are causing some formatting issues instead of being rendered:

Screenshot from 2019-08-12 16-00-34

I think that putting it inside backticks should fix it: scale_size_continuous

```

### Adding a regression
Adding a regression line as well as a label. geom_smooth does not allow for adjusting the transparency of the line (using alpha), which is why stat_smooth is used here. annotate is used to include a single text label (geom_text would create one label for every data point, all overlapped with each other).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we put all function names inside backticks? (stat_smooth, geom_text, annotate ...)

Screenshot from 2019-08-12 16-05-58


```{r, results='hide'}
library(plotly)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add dataframe assignment here so that the example runs without having run the first example first.

recent_turnout <- read.csv("https://raw.githubusercontent.com/plotly/datasets/master/european_turnout.csv",stringsAsFactors = FALSE)
recent_turnout$region <- factor(recent_turnout$region, levels=c("British","Northern","Western","Mediterranean","Central/Eastern"))

Copy link
Contributor

@michaelbabyn michaelbabyn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! 💃

@kojisposts kojisposts merged commit ce22ee9 into source-design-merge Aug 15, 2019
@kojisposts kojisposts deleted the geom_text branch August 15, 2019 19:51
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

Successfully merging this pull request may close these issues.

2 participants