Вот точное воспроизведение:
df <- data.frame( Ticker = c('FB','AAPL','GOOG'),
Name = c('Facebook','Apple','Google'),
Purchase = c(16,5,21),
Current = c(45,2,32),
Target = c(42,22,42),
Action = c('Sell','Buy','Hold') )
df$Ticker <- factor(df$Ticker, levels = as.character(df$Ticker))
df$Action <- factor(df$Action, levels = as.character(df$Action))
ggplot(df, aes(Ticker, Current)) +
geom_boxplot(aes(ymin = Purchase, middle = Purchase, lower = Purchase,
upper = Target, ymax = Target, fill = Action),
stat = "identity", size = 0) +
scale_fill_manual(values = c("#EE8800", "#6688FF", "#EEDD00"), guide = FALSE) +
scale_y_continuous(labels = function(x) paste0("$", x)) +
geom_point(size = 10) +
geom_point(size = 9, colour = "forestgreen") +
scale_x_discrete() +
theme_bw() +
theme(panel.grid = element_blank(),
panel.border = element_rect(size=2),
axis.title = element_blank(),
text = element_text(size = 16),
plot.margin = margin(50, 20, 20, 20)) +
coord_cartesian(clip = "off", ylim = c(0, 45)) +
geom_text(aes(y = 50, label = Action), size = 5)