I want to create a scatterplot in ggplot2 with one or more lines over-layed. Having looked at the documentation for geom_smooth() and geom_line(), it remains unclear to me how I can specify the equations for lines that I want to add to a plot. I understand that this must be very basic, so please feel free simply to point me toward the appropriate documentation that I must have overlooked.
1 Answer 1
geom_abline() is the name of the geom you're looking for, e.g. geom_abline(aes(intercept=a,slope=b)). There are examples in the online documentation.
answered Feb 16, 2013 at 17:52
Ben Bolker
230k2626 gold badges405405 silver badges497497 bronze badges
Sign up to request clarification or add additional context in comments.
Comments
This question is in a collective: a subcommunity defined by tags with relevant content and experts.
- The Overflow Blog
-
-
- Featured on Meta
-
-
-
Related
Hot Network Questions
- What is this G1000 MFD symbol?
- Splitting a sentence into characters (incl. spaces) and displaying each character in a tikz node
- Lead rudely demands fixing alleged error on weekend
- Need help identifying this Biplane
- What is the meaning of this spanish road sign symbols?
- How do I roleplay when given a mechanics prompt?
- Location of node in sp-hybrid orbital
- Redefine quotation environment to remove initial indent
- Theology aside, what is the best english rendering of *παρα σεαυτου* in John 17:5
- How to execute machine code in QuickBasic under DosBox?
- Cut-Off Frequency vs. Resonant Frequency in LC Circuits — What’s the Real Difference?
- Is user enumeration a problem for a passwordless app?
- How to use gdalwarp to cut, reproject and resample SWEREF99-using rasters so that the result cannot be easily demonstrated to be wrong in QGIS?
- Toilet bowl filling up with water
- Would keeping all coils on be a good way to surpass the coilgun timing problem?
- Who or what are these creatures in Destromundo, Lady Hellbender's spaceship in Marvel Cosmic Invasion?
- Is non-gavage fois gras available in France?
- Is there a talmudic source for reciting part of Hallel on the last six days of Pesach?
- Divisibility relations among degrees of irreducible factors of a binomial
- Can a number have the same digit sum and digit product?
- What should I do if my foreshadowing was too obvious and readers picked up on it immediately?
- Bash Backup script for password DB
- How do I generate +4.5 V and -4.5 V from a 9 V battery using an opamp?
- Without AC can there be a function with linearly ordered fibers from the powerset of an infinite set to the set?
lang-r
geom_abline(), e.g.geom_abline(aes(intercept=a,slope=b))... see?geom_abline