616 questions
3
votes
2
answers
155
views
Struggling to make histogram density curve [duplicate]
I am very new to coding and R but I am trying to make a series of superimposed histograms with density curves in ggplot2. I have trawled through the forum for similar threads but because I am so new, ...
0
votes
2
answers
81
views
How to combine ggplot2 and density plots using patchwork with aligned axes and proportional sizing?
I'm visualizing ecological niche shifts by combining a scatter plot (scaled environmental values) with marginal density plots of the respective variables β similar to a marginal histogram layout. I am ...
1
vote
1
answer
56
views
How to add density plots for x and z axes in a tensor smooth plot?
I created this plot using tensor smooths..
I would like to add a visualization of the data density along the x-axis and z-axis. Ideally, this could be done with either:
A rug plot on the respective ...
0
votes
2
answers
143
views
How can I make a density plot with log-scaled axes in matplotlib?
I want to plot a scalar density as a function of two variables x and y, which can potentially be scaled logarithmically. I essentially run simulations for each pair of x and y and want to report the ...
0
votes
1
answer
78
views
Geopandas density raster creation
I have a geopandas dataframe that contains points at arbitrary lat/lon points. I would like to create a raster dataset so that each point in the regular grid contains the number of elements of the ...
0
votes
0
answers
63
views
ggplot2 density2d vs seaborn kde / Or shorter range in density2d
2D density plot seems to exclude some areas, I assume, because of too small number of points comparing to the 'main cloud'. Interestingly, it seems to work better in seaborn kde plot.
Below you can ...
0
votes
1
answer
400
views
Why can't I get counts on my y-axis on geom_density?
I am trying to do 4 different plots with geom_density and put the count on my y-axis, then put them together with ggarrange. I am following this to be able to put count on my y-axis: Density plots ...
0
votes
1
answer
23
views
Limits in ggplot2 trans_new function for facets
I am trying to create faceted density plots with one (or more) of the variables transformed by my own function log10p_trans:
library(ggplot2)
library(tidyr)
library(reshape)
library(forcats)
library(...
0
votes
1
answer
123
views
Changing the Legend Title in a `ggpointdensity` Density Scatterplot [duplicate]
I have the following data and the following graph.
df <- data.frame(col1 = rnorm(1000, 0, 0.05), col2 = rnorm(1000, 0, 0.05))
ggplot(data = df, mapping = aes(x = col1, y = col2)) +
...
2
votes
1
answer
182
views
How can I place marginal distribution on the left side with ggMarginal?
I am learning to plot margial distribution with ggEtra. From the linked website, I can plot it on the right as below:
# library
library(ggplot2)
library(ggExtra)
# The mtcars dataset is proposed in ...
0
votes
1
answer
97
views
How to use python imshow, for example, with the irregular data points?
Suppose I have a list of data points of the form (xi, yi, zi) and I want to plot a 2D density plot with it. In mathematica, you just call the function ListDensityPlot function. In python, it seems ...
2
votes
1
answer
296
views
Density plot to predict object count
I'm trying to count the number of objects (larvae in this case), from a video.
This being the overall goal, I first tried density map on all the frames from the video.
On looking at density plots more ...
1
vote
1
answer
230
views
2d scatter plot - mcolors.Normalize vs mcolors.LogNorm
I have a scatter plot that I'm making but when I switch between mcolors.Normalize and mcolors.LogNorm the color bar is not consistent between the two figures - I would think that the normalized color ...
1
vote
1
answer
147
views
Why does my plot utilizing geom_density not reach the x-axis?
I'm trying to plot the probability density of research regarding agreements of representative pairs in Congress. Think: how does the distribution of agreement on roll call votes within same-party ...
0
votes
1
answer
91
views
How to facet-wrap comparative density plots in R with ggplot
I have a dataset of different conditions with values of length.
I can make histograms/density plots out of it and can facet wrap it for comparison to the control condition.
I can also make individual ...