SachaEpskamp / qgraph

Developmental version of qgraph
GNU General Public License v2.0
68 stars 21 forks source link

Plotting subsetting results - no values on the y axis #11

Closed lindasdoyle closed 6 years ago

lindasdoyle commented 6 years ago

When I am plotting the subsetting results, the plot does not show any values on the y axis.

subplot1 <- plot(sub1, labels = FALSE, order="sample")
subplot1 + ggtitle("Correlation Network") + 
  theme(plot.title = element_text(size = 10, face = "bold", hjust = 0.5))

When I try to add a y axis with ggplot2, as follows:

subplot1 <- plot(sub1, labels = FALSE, order="sample")
subplot1 + ggtitle("Correlation Network") + 
  theme(plot.title = element_text(size = 10, face = "bold", hjust = 0.5)) +
  scale_y_continuous(limits=c(1,-1))

It messes up the whole plot and I get the following error:

Scale for 'y' is already present. Adding another scale for 'y', which will replace the
existing scale.
Warning messages:
1: Removed 30 rows containing missing values (geom_point). 
2: Removed 1 rows containing missing values (geom_hline).

And although I can find subsetting plots online that have y axis values, I cannot find the relevant code. `` Any suggestions?