Can I plot a normal matrix like plot(cij)?
In the cross-correlation plot, using plot(cij)
can generate the colourful graph. I have another matrix named p_value
, with the same dimension as cij
, but the plot
command can only output a black-white graph:
plot(p_value, col.regions=bwr.colors(200), at=seq(-1,1,by=0.01), contour=FALSE, xlab="Residue Number", ylab="Residue Number", margin.segments=ch)
class(cij)
outputs "dccm" "matrix"
, while class(p_value)
only outputs "matrix"
So I think the additional "dccm"
property of cij
enables plot(cij)
to the nice graph.
I wonder, if I can also provide the p_value
with the "dccm"
property?
Comments (4)
-
-
reporter Thank you very much, it works now!
Can I ask if I can adjust the colour scale so the plot can capture all the values?
plot.dccm(p_value, col.regions=bwr.colors(200), at=seq(-1,1,by=0.01), contour=FALSE, margin.segments=ch)
gives me this plot. Because p_values are within 0 to 1, only white to red are shown. Can I show blue to white to red for 0 to 1 range?plot.dccm(t_value, col.regions=bwr.colors(200), at=seq(-1,1,by=0.01), contour=FALSE, margin.segments=ch)
gives me this. Because t-values are within -20 to 70 but the colour scale is only for -1 to 1, so t-values less than -1 or more than 1 are shown as white. So can I show blue to white to red for -20 to 70 range? -
reporter I have used ggplot2 to do this. Just share my question on stackoverflow in case someone else needs it.
-
- changed status to resolved
- Log in to comment
You can try calling the associated plot function directory namely: