0

could you please help me how I can add yellow hatching to the last type ('Zemní plyn/ Vodík') in the graph?

I am using this code:

diff_decomp %>%
  ggplot(aes(x = scenario)) +
  geom_col(aes(y = diff, fill = type)) +
  labs(
    y = 'GWe',
    x = 'Scénář',
    title = 'Rozdíly nových kapacit ve výrobě elektřiny',
    fill = "Hlavní zdroj energie"
  ) +
  facet_grid(~ending_per) +
  scale_fill_manual(values = c(PaletteCAP_elc[1:11], "blue")) +
  theme_bw() +
  theme(
    axis.text.x = element_text(angle = 90),
    axis.text.y = element_text(size = 12),
    legend.text = element_text(size = 12))

I tried to use ggpatern package, but it did not work. I tried to create a new column to mark the rows I want to hatch, but I don't know how to fit them into the chart

stefan
  • 90,330
  • 6
  • 25
  • 51
  • Welcome to SO! To help us to help you would you mind sharing [a minimal reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) including a snippet of your data or some fake data. To share your data, you could type `dput(NAME_OF_DATASET)` into the console and copy the output into your post. If your dataset has a lot of observations you could do e.g. `dput(head(NAME_OF_DATASET, 10))` for the first ten rows of data. – stefan May 30 '23 at 11:20

0 Answers0