TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

How to make any plot in ggplot2

70 pointsby ohblahitsmeover 9 years ago

3 comments

minimaxirover 9 years ago
This is a pretty effective guide for the custom features that ggplot2 excels at, namely faceting. That being said, optimizing the chart requires a few more steps in each case, especially when working with real world data.<p>For those who want a step-by-step guide on plotting with ggplot2, I wrote a tutorial that has been well-liked with an emphasis on making pretty charts: <a href="http:&#x2F;&#x2F;minimaxir.com&#x2F;2015&#x2F;02&#x2F;ggplot-tutorial&#x2F;" rel="nofollow">http:&#x2F;&#x2F;minimaxir.com&#x2F;2015&#x2F;02&#x2F;ggplot-tutorial&#x2F;</a><p>Yesterday, I also pushed a screencast working explicitly with R and ggplot2, with an emphasis on processing&#x2F;organizing data for charting in ggplot2: <a href="http:&#x2F;&#x2F;minimaxir.com&#x2F;2015&#x2F;12&#x2F;lets-code-1&#x2F;" rel="nofollow">http:&#x2F;&#x2F;minimaxir.com&#x2F;2015&#x2F;12&#x2F;lets-code-1&#x2F;</a><p>TL;DR R&#x2F;ggplot2 can be <i>very</i> fussy, but when it isn&#x27;t, it&#x27;s magical.
评论 #10809541 未加载
misnomeover 9 years ago
It seems, as long as &quot;Any plot&quot; means either a scatter, or bar chart (not even a continuous histogram).<p>Also:<p>&quot;There are 3 ways to change the X and Y axis limits. ....Warning: Items 2 and 3 will delete the datapoints that lie outisde the limit from the data itself. So, if you add any smoothing line line and such, the outcome will be distorted&quot;<p>So, is this a graphics module, or a fitting module, or a data manipulation module? It seems to do all three, depending on which functions you use to &quot;Change the axis limits&quot;.<p>Edit: Probably the best &quot;How to do everything&quot; page I&#x27;ve seen is for python&#x27;s matplotlib&#x27;s gallery page: <a href="http:&#x2F;&#x2F;matplotlib.org&#x2F;gallery.html" rel="nofollow">http:&#x2F;&#x2F;matplotlib.org&#x2F;gallery.html</a> - there is rarely not an example showing exactly what I want to do.
评论 #10810521 未加载
评论 #10809497 未加载
评论 #10809820 未加载
评论 #10809825 未加载
mdlincolnover 9 years ago
It&#x27;s not mentioned in this guide, but Hadley Wickham&#x27;s tidyr is a more streamlined version of the reshape2 package for fitting your data into a &quot;tidy&quot; format necessary for ideal faceting.