All Questions
4,776
questions
0
votes
1
answer
45
views
ggplot2 change graph attributes like certain linewidth or graph size? [closed]
A function from an R package returns a ggplot2 plot object. How do I change the attributes in it, like in Python matplotlib, I can access the fig.axes[0].set_... functions?
There are a lot of ...
0
votes
1
answer
56
views
Why doesn't the function curves in R plot correctly when they exceed a functions boundry?
Let's say I have probability distribution function from some sort of function within a given boundry. Its total area is of course 1 within this boundry. It's defined as zero outside this boundry.
f &...
0
votes
1
answer
34
views
Manually specifying x-axis limits with gglikert()
I am using the gglikert() function from the ggstats package to create horizontal stacked bar charts centered on the neutral response. I would like to know how to manually set the x-axis limits to 100% ...
0
votes
0
answers
38
views
how to export same font for both base and ggplot2 plots, in R?
I am trying to understand how to make sure the font i am exporting from both base and ggplot2 plots is the same. The best would be to be able to have all plots from ggplot2 but for some reason, one ...
1
vote
1
answer
56
views
How to set non-uniform y-axis ticks in R ggplot2?
I am creating some plots using R ggplot2 and I have run into a challenge. I want to set non-uniform ticks on the y-axis, but I am not sure how to go about it.
eg:
df <- data.frame(x = c(1, 2, 3, 4, ...
0
votes
0
answers
36
views
Plotting the count of several binary variables in R with ggplot [duplicate]
I have a dataset of a person-specific id variable and five binary variables, namely the results of tests on several sexually transmittable infections (STI). So every line is a person and every column ...
0
votes
2
answers
35
views
how can I get a double y-axis (twiny) on a facet-wrap in ggplot boxplots?
I have a ggplot figure with a couple of boxplots and I want the last boxplot in each group (in my example all boxplots c) to be shown on a different y-axis on the right hand side (and preferably mark ...
0
votes
2
answers
32
views
How to get GGPLOT to not error when doing selective labelling?
I was trying to do a scatter plot of a table, while only labeling 2 specific points. The table looks something like this
"Country","Continent","GDP","HCI"
...
1
vote
1
answer
51
views
why is my geom_smooth not flat as it should be?
I added a geom_smooth on my plot, but sometimes it should be flat (all the points are on the same line) an it does a peak at the beginning.
I don't want to increase the span because the curve suits me ...
0
votes
1
answer
34
views
Adding a second axis to a plot using ggplot2?
I have a graph here with Wavenumber as the primary x-axis. I have another column in my data table called Wavelength, that is a direct conversion from every data point in the Wavenumber column. Is ...
0
votes
1
answer
26
views
gridArrange doesn't horizontally align anymore [duplicate]
Back in 2021 using gridArrange I was able to arrange two plots vertically so the values of the x-axis align perfectly. Here is the plot I produced then:
Notice how the x-axis values align in the top ...
0
votes
0
answers
42
views
Using a for loop to plot each column of a data frame? [duplicate]
I have a data frame that consists of a Wavenumber column and 48 other columns for Intensity. Is there a way to use a for loop to plot each Intensity column with the Wavelength column, so I'd end up ...
0
votes
1
answer
32
views
Values not appearing in ggplot plot
When I made a plot using geom_point() and geom_line(), a few values in the middle didn't appear and I can't figure out why.
I have a dataframe with 3 columns (K_value, CV_error, and Run), where ...
0
votes
1
answer
43
views
Edit legend title in ggplot2 (3.5.1) [duplicate]
I have successfully edited the x and y axis titles, but I'm stuck on the legend title and labels.
Here is the code I have run so far:
m.emo.plot <- interact_plot(model = m.emo, pred = cemodiff, ...
0
votes
1
answer
45
views
My plot don't keep my tibble's order in R
I'm a novice in R. Here's my issue: I try to display a plot of rugby's game sequence. Thus, in my tibble I've specific orders of the actions that are not respected in the visualization. Here's a ...