Questions tagged [geom]

(aka Geometric objects in r ) A geom is the geometrical object that a plot uses to represent data in r. A ggplot2 geom tells the plot how you want to display your data in R. A geom defines the layout of a ggplot2 layer. People often describe plots by the type of geom that the plot uses. For example, bar charts use bar geoms, line charts use line geoms, boxplots use boxplot geoms, and so on.

224 questions
0
votes
2 answers

ggplot using facet_wrap in R?

I want to use the face_wrap functionality of ggplot to draw the following example data. The plot doesn't seem right. The line should have smooth connection with no extra space in both facets (ie Facet A has empty space from 10-15 while Facet B has…
Hydro
  • 1,057
  • 12
  • 25
0
votes
1 answer

Is there a way to condense the spacing between points on a bubble plot?

Hopefully this is a quick answer. I just created a bubble plot in ggplot2 to showcase abundances of taxa in certain environments, snapshot shown below: Is there a way I may "condense" all this white space? Thanks in advance, J
Geomicro
  • 303
  • 3
  • 13
0
votes
1 answer

Add labels to scatter plot

I cannot seem to add labels to my scatter plot. I want to label the scatter with the variable states. It is currently not working either due to conflict with annotate or some other geom function. Here is my data: datatrials <- structure(list(states…
SamV
  • 118
  • 1
  • 7
0
votes
1 answer

I am drawing a plot in ggplot in R and all I am getting as the result is a line with points in vertical direction with no x-labels or markings

ggplot(data=df, aes(x='Matcing_Probability', y=Locus_Name, group=1)) + + geom_line(color="#aa0022", size=1.75) + + geom_point(color="#aa0022", size=3.5) This is the graph I am getting from the code.
0
votes
1 answer

GGplot geom_map gets distorted when plotting interactively with ggplotly

I am trying to create an interactive map of Germany with plotly and ggplot. At last, I'd like to overlay geom_points with tooltips, but so far I am struggeling with the aspect ratio. I create the plot like…
kato-m
  • 113
  • 1
  • 1
  • 5
0
votes
1 answer

Scatter plot with lat long points with respect to a given point at the center of the plot

I am trying to plot lat long points on a plot using ggplot2 in R. The axes are lats on y and longs on x. I want a given location point to be the center of my plot and rest of the points on the scatter plot with respect to how far they are from this…
bee5911
  • 516
  • 4
  • 9
0
votes
0 answers

Obtain exact bounding box coordinates for ggplot2 texts

I want to know the coordinates for the bounding box (top left, top right, bottom left, and bottom right coordinates) for the text "ABC" as shown in the screenshot: My code is: d <- data.frame(x = 0, y = 0, text =…
zhanxw
  • 3,159
  • 3
  • 34
  • 32
-1
votes
1 answer

How to use geom+line and categorical data from 6 different lists(csvs)

I am starting with 6 different lists/csvs that each contain one charater column. This column shows the Home Owner Loan Corporation (HOLC) neighborhood grades of census block groups. So the columns look something like shown below. I am new to using R…
Kimberly
  • 5
  • 2
-1
votes
1 answer

Manually defined colors for map

I am trying to color coded my map with hex colors. Vietnam, Philippines, Indonesia: Hex - #404E57 Mongolia, Pakistan, Bangladesh, Myanmar, Sri Lanka: Hex - #A0A7AB. I want other countries to be grey and only the listed countries are color coded…
warmsoda
  • 57
  • 1
  • 9
-1
votes
2 answers

How can I make multiple plots in one ggplot?

So I have a dataframe that I want to plot using gglot2 in R. To make you understand what I want Example = I have a table that has 5 columns A, B, C, D, E. I want to plot the graph of A vs B, A vs C, A vs D, A vs E. Finally I want to merge all these…
-2
votes
1 answer

geom_bar, how to only make the x highest frequency appear?

I'm working with a dataframe on state-sponsored cyberattacks (my main three variable are thus Date, Sponsor and Victim). I want to create a geom_bar where for each year, the top five victims of cyber attacks will appear. I'm not sure how I could…
Nea
  • 11
  • 3
-2
votes
1 answer

Creating a multiple sided shape using GeneralPath and lang.Math(GUI) in Java

I want to create a shape with mulitple sides using Lang.Math and GeneralPath in Java GUI. I was able to transfer the value of ne(the number of sides) from Fenster to my class but the code isnt working. ik the code for the shape is right because it…
Giga
  • 1
  • 1
-2
votes
1 answer

How do I add the names of the graphs inside the plot in R?

I built the graph but I try to add the names of the graphs and it does not work. It should look like in the picture, I only have the graphs without the names I would happy if anyone knows which function should be used
-2
votes
2 answers

Python Error - 'str' object has no attribute '_geom'

I am using shapely to convert longitudes and latitudes contained in a CSV to WKB format. For context, the CSV is parsed using a python AWS Lambda code. The format of the file being parsed is as…
1 2 3
14
15