Change linetype (or other plot properties) in ggplot made by some R package
0
0
Entering edit mode
8.2 years ago
paul.e.gradie ▴ 110

Hi all,

I'm working my way through R to become a pro at visualizing data, and I'm stuck on something that I think is probably very simple. I'll describe my current problem, but just so that everyone knows - the answers here should be applicable to many other similar problems.

Apologies in advance if this has already been asked - I've searched and searched, but I'm probably asking the wrong questions.

So I'm working with an R packages called ChIPQC which allows users to plot metrics concerning Chip-Seq data. This package has a function called "plotPeakProfiles" and with it you can make a number of plots showing Chip signal strength. I'd like to take a few of these plots and make some of the lines dashed (so that you can better see other lines on the same plot).

How would one accomplish this? The ggplot object has already been created by the plotPeakProfile function, and when I tried using the ' + scale_linetype_manual(values=c(1,2,3,etc))', nothing happens.

In general, is there a particular way to alter and customize ggplot objects that are made by functions from packages found on bioconductor, etc.?

An example line of code for running this package would be:

plotPeakProfile(GEO_and_FilteredPeaks, facetBy=c("Tissue","Factor")) + scale_color_manual(values=c("Blue", "Orange","Yellow","Blue", "Orange", "Black"))

Using this, I can customize the line colors, but I can't customize the line type (dashed vs dotted vs solid, etc.)

Thanks for the help! Cheers, Paul

R Plot Graphing ggplot • 2.3k views
ADD COMMENT

Login before adding your answer.

Traffic: 2152 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6