Skip to content

Commit 8bd3c16

Browse files
scatter plot 2 done
1 parent 4dc03c0 commit 8bd3c16

File tree

1 file changed

+5
-4
lines changed
  • 3-Data-Visualization/R/12-visualization-relationships

1 file changed

+5
-4
lines changed

3-Data-Visualization/R/12-visualization-relationships/README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,13 @@ ggplot(honey, aes(x = priceperlb, y = state)) +
4545
```
4646
![scatterplot 1](images/scatter1.png)
4747

48-
Now, show the same data with a honey color scheme to show how the price evolves over the years. You can do this by adding a 'hue' parameter to show the change, year over year:
48+
Now, show the same data with a honey color scheme to show how the price evolves over the years. You can do this by adding a 'scale_color_gradientn' parameter to show the change, year over year:
4949

50-
> ✅ Learn more about the [color palettes you can use in Seaborn](https://seaborn.pydata.org/tutorial/color_palettes.html) - try a beautiful rainbow color scheme!
50+
> ✅ Learn more about the [scale_color_gradientn](https://www.rdocumentation.org/packages/ggplot2/versions/0.9.1/topics/scale_colour_gradientn) - try a beautiful rainbow color scheme!
5151
52-
```python
53-
sns.relplot(x="priceperlb", y="state", hue="year", palette="YlOrBr", data=honey, height=15, aspect=.5);
52+
```r
53+
ggplot(honey, aes(x = priceperlb, y = state, color=year)) +
54+
geom_point()+scale_color_gradientn(colours = colorspace::heat_hcl(7))
5455
```
5556
![scatterplot 2](images/scatter2.png)
5657

0 commit comments

Comments
 (0)