I am using ggplot2 to generate errorbar plots. My code gives a warning message: "position_dodge requires non-overlapping x intervals" and error bars are scattered on the plot.
Here is the data frame that I am using for the plot.
true_fracs <- c(0.01, 0.05, 0.10, 0.20, 0.30, 0.40)
df <- data.frame(
truefracs = c(true_fracs, true_fracs, true_fracs),
mean_est_fracs = c(mean_vec_pl, mean_vec_dp, mean_vec_cl),
)
p<- ggplot(df, aes(x=truefracs, y=mean_est_fracs, fill=Algorithms))
In the ggplot, I am using "truefracs" as x-axis values and "mean_est_fracs" as y-axis values. The length of each of the mean_vec is 6. So, there is nothing wrong with the dataframe. How can I fix it?