Relative Content

Tag Archive for rggplot2

Geom_line not connecting all paired points

I am interested in plotting paired samples from my dataset. Here, I have 4 samples taken from blood and 4 samples taken from SF (which are paired). I am interested in plotting the variable “freqcd8bytissue” for this paired analysis using geom_line and geom_point in ggplot2, with each sample being plotted as a separate point. This is then facetted by a variable “clusters_names”.

Pyramid plot text alignemnt

I created the plot below, but I’m not sure how to adjust the figures to ensure they are positioned inside the plot area. Additionally, I would like to display the percentage savings, calculated as the difference between the “azul” (2024) and “red” (2023) values, prominently in the middle with larger font sizes. Can someone help me with these adjustments?

Text adjustment stacked barplots

I created the below plot but I would like the month name to be near the figure. For example “January:13.31”. Is there a way to do this

How to unify the legend with points only?

I am trying to plot the loess fit curves in each of sub-figures. There are three models and each model will have a color to represent. The code to generate the plot is as follows,

Is there an R-function to interpolate contours which fits a shapefile?

I am plotting contour maps using R. The program is able to plot the contours but it is not able to interpolate the plot to fit and fill the provided shapefile. Is there a specific function in R which can help to generate a proper contour map? The program is below. The image I obtained is also attached.

R: prevent break in line showing time series data using ggplot geom_line

Using ggplot2 I want to draw a line that changes colour after a certain date. I expected this to be be simple, but I get a break in the line at the point the colour changes. Initially I thought this was a problem with group (as per this question; this other question also looked relevant but wasn’t quite what I needed). Having messed around with the group aesthetic for 30 minutes I can’t fix it so if anybody can point out the obvious mistake…