Question: Change linetype (or other plot properties) in ggplot made by some R package
0
gravatar for paul.e.gradie
3.2 years ago by
paul.e.gradie100
Australia/Melbourne/University of Melbourne
paul.e.gradie100 wrote:

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

graphing ggplot plot R • 1.1k views
ADD COMMENTlink written 3.2 years ago by paul.e.gradie100
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1740 users visited in the last hour