Skip to main content

All Questions

Tagged with
0 votes
0 answers
29 views

How to plot the legend with combined_plot (ggplot2)

I created this script to display some environmental impacts for my research. `legend_plot <- ggplot(data_longGW, aes(x = Crop_cycleGW, y = kg_CO2_eq, fill = Category)) + geom_bar(stat = "...
Guido Evangelista's user avatar
1 vote
0 answers
30 views

Why is the coding for legend on my barplot not working after update?

I updated Rstudio and suddenly none of my legends are working on my barplots. It's my first time asking for help on here, so hopefully I am providing the info needed to get answers? Coding is below. ...
Rebecca Connor's user avatar
0 votes
1 answer
40 views

How to reverse legend order without affecting bar order in Plotly R? [duplicate]

I am creating a stacked bar chart using Plotly in R, and the order of the items in the legend is the reverse of the order that I want. library(dplyr) library(plotly) library(forcats) set.seed(1) df &...
Ernest Au's user avatar
1 vote
2 answers
42 views

Separate Legend Entries for Individual Outlined Overlapping Bars

I am creating a ggplot with multiple overlapping bar plots. The first underlying bar is filled with color and then I overlay one more set of bars with just an outline to show sub-components. I would ...
fowlermw's user avatar
0 votes
1 answer
78 views

How to show values next to bars in tornado chart using ggplot in R [closed]

I have this table (T_Tornado_Total_EM_HM_sort): And these are the lines that I used to make the tornado chart: ggplot(T_Tornado_Total_EM_HM_sort, aes(Tipovi_troškova, RSD, fill=Populacija)) + ...
newtoR's user avatar
  • 35
0 votes
1 answer
34 views

Legend of the library Fantaxtic

I am running the library fantaxtic in R studio. I want to make a bar chart or something like that. However, in the legend I don't want any title in the legend and the category Other is located at the ...
user1892205's user avatar
1 vote
1 answer
31 views

Order ggplot legend differently than elements in plot

Is there a way to order a legend in ggplot differently than the elements on the plot. for example I want the legend to be ordered Calanoida, Cladocera, Rotifera, and Cyclopoida but I want the ggplot ...
confusedindividual's user avatar
0 votes
0 answers
34 views

Same scale in legend for circular bar plot

Building on this post and code (with reproducible example) Different fill color for negative values in circular barplot, I want to plot two of these figures together as a comparison, like this: But ...
MoonS's user avatar
  • 175
3 votes
1 answer
71 views

Sharing multiple ggplot legend symbols with one label

I am trying to create a stacked barplot for one response over time (Year) across 3 different sites that I've separated into different facets (facet_wrap). I would like different colours per facet, and ...
James White's user avatar
0 votes
1 answer
72 views

How to create a bar graph to visually represent two variables, while keeping the same color for the x-axis variable?

For example, here is a data. Genotype=c("A","A","B","B","C","C","A","A","B","B","C","...
Jin.w.Kim's user avatar
  • 884
1 vote
1 answer
31 views

How do I get column names under a barplot from aggregated data using multiple variables?

I have a data file with tree data called ufc.csv, and after reading it in with a read.csv() function, I used an aggregate function to get the means of tree diameter (Dbh) and tree height (Height) ...
robotnoises's user avatar
1 vote
1 answer
56 views

Creating Separate Legend for Specific Line in ggplot2

I'm working on a data visualization project in R using the ggplot2 package. I have a bar plot with two bars per year and a trend line that applies to one of the bars. I'm trying to create a clear ...
estrix's user avatar
  • 15
1 vote
1 answer
250 views

How to make the legend appear in a stacked bar chart with `plotly` in R

I want to make a stacked bar chart with a slider in plotly. I took inspiration from the plotly website. I can't manage to insert the legend, maybe because I didn't use the legendgroup argument ...
Julien's user avatar
  • 1,664
0 votes
1 answer
59 views

ggplot2: Legend with barplot and line

I am trying to produce a graph that shows averages by decile of two variables (as they have very different values, I added a second y-axis). On variable is represented with bars, the other one with a ...
Antoine D's user avatar
0 votes
1 answer
432 views

Why does my legend not match the colour of my bars in ggplot2?

I converted the bars of my graph from gray with a coloured outline to a solid fill which resulted in half of my error bars not being visible due to being the same colour. I therefore changed the ...
e_putyora's user avatar

15 30 50 per page
1
2 3 4 5