Category "ggplot2"

getting this error Error: Must request at least one colour from a hue palette

enter image description hereIm trying to stack the above given formula to use on my code, but i keep getting this error Error: Must request at least one colour

How do I plot multiple caterpillar plots in one graph in ggplot?

So I have successfully plotted these graphs individually, now I want to create a plot that has all three categories in one graph with same scales but different

How can I draw a similar graph with ggplot2 to find the difference between two works?

I am reading the book Text Mining with R: A Tidy Approach by Julia Silge & David Robinson to try to find the difference between two works, and not the three

Add additional labels from a DataFrame to a facet_grid with existing label

I have a set data that I need to add to levels of labels. One on a single chart within the facet grid, and one from a small dataframe with entries for for each

why ggplot and geom_tile create lines on the map?

Data: https://github.com/yuliaUU/data/blob/main/test.csv griddf <- read_csv("test.csv") create a map: world <- rnaturalearth::ne_countries(scale = "medi

how to add density line over real count value (maybe with 2 y-axis)

I would like to plot a density plot over counts histogram using following sample data: However my density line was not readable in my plot. if I use ..ncount..,

Trying to represent hashtags in a bar chart

I have downloaded tweets and I am trying to represent the different hashtags and how often they are tweeted. Some data screen_name location text

How to generate a map for property cluster

Could you help me make a graph in R similar to the one I inserted in the image below, which shows the properties on a map, differentiating by cluster. See in my

(CLOSED) Generating faceted pie charts to indicate weightages

I am looking to build a visual with multiple pie charts to showcase different sleeping conditions and their weightage across a week. Here's my dataset: structur

Increase space between two discrete values in a ggplot2 plot in R

I am trying to figure out how to add space in a plot between two discrete values on the x-axis. For example, in the plot below, I'd like to keep the same spacin

How to fill area below geom_line plot in ggplot with geom_rect?

This is my plot: library(ggplot2) economics <- economics %>% mutate(year = year(economics$date)) ggplot(economics,aes(year, unemploy))+ geom_line() +

Question when drawing a graph in r(dodge or geom_line)

I want to express the frequency of each column (a,b,c,d,e) in a graph of (t) for each group. I don't know what to do. As shown in the figure, the data was selec

How to draw rectangle around map area in R?

I have a map of the Northern Hemisphere centered around North America. I would like to draw a red rectangle around the USA (this is part of an inset map) howeve

R: ggplot with 6 different groups: Have 5 solid lines and for one group a dashed line

I have the following data: structure(list(Date = c("01.08.2018", "02.08.2018", "03.08.2018", "04.08.2018", "01.09.2018", "02.09.2018", "03.09.2018", "04.09.201

How to make alpha (transparency) appear as continuous gradient in the ggplot legend?

Is it possible to make the transparency (alpha) appear as a continuous gradient in the ggplot legend? Currently, the plot looks like this: Here, the different

Color coding in ggplot using geome_point, while maintaining size of point

I am plotting a dataset in R using three different variables (x=PassingFilerReads, y=meanCoverage, and size distribution of alignPercentageR1 over those two thi

Automatically find the best figure dimensions in r?

I am producing many different plots in rmakrdown using ggplot2 and don't want to manually edit their fig.width() ; fig.height() or fig.asp() one by one. Some pl

R data visualization: Is there a way to plot based on emmeans using ggplot?

I am trying to visualize my data separately as a bar graph and as a dot plot connected by a line. The experimental design includes 2 treatments, 3 levels for ea

How can I make one plot from multiple variables in ggplot?

I'm trying to make a pre-post change plot for three groups. In my data frame, pre data and post data are stored as two different variables like this. pre_treat

Tried scale_linetype_manual to add legend but not successful

Following the thread from Tried p + scale_fill_discrete(name = "New Legend Title") but legend title still not changing, I now only want to generate line plot wi