All Questions
2,484
questions
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 &...
0
votes
0
answers
13
views
Visnetwork not displaying visLegend properly
I am using the package VisNetwork and one of the attributes of the nodes contains 9 different possibilities, as follows. This is just a minimal example. In my real dataset, the column "family&...
1
vote
1
answer
143
views
Order of ggplot ignoring order of legends
With the following data, I am trying to create a plot as shown, but the order of legends as: mgCST Group, CST Group, Treatment Status. However, ggplot is ignoring all attempts to order the legends
...
-1
votes
1
answer
40
views
Add horizontal lines with according color and legend to ggplot using R
I want to add horizontal lines so that the lines have y-intercept of period and colors according to their obj_name, ie the same colors as the line plot for each object. I succeeded in putting in these ...
0
votes
1
answer
45
views
how to have a legend for size of geom_points() and also set the size of the dots themselves?
I am trying to plot a sort of bubble plot but i am unable to set the size of the dots and have a legend explaining how the sizing works.
These are two examples which combined give me the expected ...
0
votes
1
answer
19
views
ggplot manually adjusting attributes
I am trying to change the legend on this plot in ggplot. I want it to have both the appropriate linetype and color in the one legend. However, I would be satisfied if I could just fix the linetype ...
1
vote
1
answer
116
views
how to change size of symbol in ggplot2 when size, shape, and color are set through geom_point?
The problem i am having is surely trivial, and yet i am unable to solve it. What i need is to have my own shape, colour, and size for the geom_point(). However, if i set it, the size of the symbols in ...
2
votes
0
answers
47
views
Add p-value breaks to a gene oncology dot plot [closed]
I am so close to finishing up a gene oncology-gene ratio figure for a lab assignment, but I am struggling with adjusting my p-value breaks. I'd like to have control to having p-value range from 0.001 ...
0
votes
0
answers
41
views
R's plotly ggplotly removing legend from a geom_point
I'm generating a simple geom_point plot with R ggplot2:
library(dplyr)
library(ggplot2)
set.seed(1)
df <- matrix(runif(16, 0, 10), nrow = 4, ncol = 4, dimnames = list(paste0("R", 1:4), ...
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 ...
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)) +
...
0
votes
0
answers
46
views
Is there a way to move the legend in a trackViewer lollipopPlot and/or change its orientation?
Is there any way to alter the position or orientation of a legend in a trackViewer lollipopPlot (or fudge something that performs the same function), so that it's on the side of the plot and directly ...
0
votes
1
answer
35
views
ggplot2 - how to keep the legend items with the same size, when geom_segment() has different sizes? [duplicate]
I'm plotting several segments as once using ggplot2, with two different sizes.
An example of what I want to do is provided in one of the answers here. Here's the example they provide:
ggplot2::ggplot()...
0
votes
3
answers
63
views
Having different shapes of points for each line and making them shown on the legends
My goal is to make the graph look something like this My Goal. The problem I'm having is that ggplot won't let me use more than 6 kinds of shapes for the points, so my graph looks something like this ...
0
votes
2
answers
37
views
Overlapping legend of a line plot
I want to show each line as having a different color and shape, and that should be reflected on the legend. Basically, it should look something like this My Goal.
I could make the color and point ...