[Solved] How do I achieve a bubbleplot? [closed]

[ad_1] To achieve this you could use ggplot. Here an example: require(ggplot2) df <- data.frame(x = c(-2, -1.5, 1, 2, 3), y = c(-1, 0.8, 1, 1, 2), country = c(“SWI”, “FRA”, “US”, “UK”, “NL”), size = c(15,12,20,4,7)) ggplot(df, aes(x = x, y = y)) + geom_point(aes(size = size), pch=1) +geom_text(aes(label=country),hjust=-0.5, vjust=0) + xlim(c(-3,4)) + … Read more

[Solved] Plot a three variables function over the specified domain in MATLAB [closed]

[ad_1] its still a little unclear as to what you’re trying to accomplish. Is this what you’re trying to do?: x1=0.5:.01:1.6; x2=280:0.453:330; x3=-2.06:.0373:2.06; V = x1.^2+x2.^2+x3.^2+3.*x1.*x3-x2.*x3-4.*x2.*x1; subplot(3,1,1) plot(V,x1) subplot(3,1,2) plot(V,x2) subplot(3,1,3) plot(V,x3) 3 [ad_2] solved Plot a three variables function over the specified domain in MATLAB [closed]

[Solved] R-project Graphic plot [closed]

[ad_1] I think the two outputs below are ~pub-ready. The first uses base R and jitter, used to add some noise to data so that points with the very same coordinates appear on different positions. That’s a nice approach in such case (providing you mention the jittering as data are slightly modified). If you have … Read more

[Solved] plot multiple lines in ggplot

[ad_1] I’ll make some fake data (I won’t try to transcribe yours) first: set.seed(2) x <- data.frame( Date = rep(Sys.Date() + 0:1, each = 24), # Year, Month, Day … are not used here Hour = rep(0:23, times = 2), Value = sample(1e2, size = 48, replace = TRUE) ) This is a straight-forward ggplot2 … Read more

[Solved] how to color points in 17 colors based on principal component? [closed]

[ad_1] It’s hard to say without knowing exactly what your data look like, but perhaps something like this would work: cols <- rainbow(17)[as.factor(gtex_pm$tissue)] plot(pc_gtex$x[,1], pc_gtex$x[,2], col=cols, main = “PCA”, xlab = “PC1”, ylab = “PC2”) 4 [ad_2] solved how to color points in 17 colors based on principal component? [closed]

[Solved] R script : add a padding to the ymax of the plot with ggplot2

[ad_1] No code to generate your sample data was provided, so I used the code @akrun had used previously: y3 <- matrix(rnorm(5000), ncol = 5) library(tidyverse) as.data.frame(y3) %>% mutate(row = row_number()) %>% # add row to simplify next step pivot_longer(-row) %>% # reshape long ggplot(aes(value, color = name)) + # map x to value, color … Read more

[Solved] Bubble plot of mine quakes [closed]

[ad_1] Edit: Updated to use more meaningful data. The original response is at the bottom. This map… … can be produced with the following code: library(ggplot2) library(maptools) # grab earthquake data [source: USGS Earthquake Hazards Program] url <- “http://comcat.cr.usgs.gov/fdsnws/event/1/query” querystring <- “starttime=2012-01-01T00:00:00Z” querystring <- paste(querystring,”minmagnitude=6″, sep=”&”) # magnitude >= 6 querystring <- paste(querystring,”mindepth=0″, sep=”&”) querystring … Read more