Skip to main content

All Questions

Tagged with
0 votes
0 answers
18 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
31 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
41 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
77 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
31 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
30 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
69 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
1 vote
0 answers
126 views

How to add space between Legend text and chart in ChartJs v4

I'm using Chart.js version 4.4.1, and I want to increase the space between the legend and the chart. I need a solution for barchart. I'm sharing the code for the bar chart. I've checked several posts, ...
Aishwarya's user avatar
0 votes
1 answer
70 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
2 votes
2 answers
70 views

How to consolidate labels in legend

So, the script below requests data from postgres database and draws a diagram. The requested data is a table with 4 columns (ID, Object, Percentage, Color). The data: result = [ (1, 'Apple', 10, '...
muted_buddy's user avatar
1 vote
1 answer
239 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,654

15 30 50 per page
1
2 3 4 5
8