data-visualization

How can I produce visualizations combining network graphs and imaginary maps?

随声附和 提交于 2019-12-04 20:10:06
Basically, I'm looking for something like this awesome research project: Gmap , which was referenced in this related SO question . It's a rather novel data visualization that combines a network graph with an imaginary set of regions that looks like a map. Basically, the map-ification helps humans comprehend the enormous data set better. Cool, huh? GMap doesn't appear to be open source, though I plan to contact the authors. I already know how to create a network graph with a force-directed layout (currently using Prefuse/Flare), so an answer could be a way to layer a mapping algorithm on top of

Multiple boxplots for multiple conditions in R

别等时光非礼了梦想. 提交于 2019-12-04 19:46:06
I understood how I have to plot multiple boxplots in one graph from the several others posts. But I have this situation where am unable to plot multiple conditions together. I applied the same idea as my former post ( Multiple boxplots in R ) but does not work for this case. I have this dataset Control Treatment L1 L2 L3 L4 L5 S1 S2 S3 S4 S5 g1 10.5 12 10 11 12 13 14 10 11 12 g2 11 13 10 10 11 10.5 12 8 9 10 g3 10 9 9 8 9 11 10 11 9 11 g4 9 8 8 9 8 6 5 5 7 6 g5 16 4 6.5 6.8 5 4 6 6 8 9 g6 11 12 7.8 7.5 6 5 4 9 10 11 g7 10 6 8.9 6.4 7.2 13 12 12 12 10 g8 5 4 9.0 5.6 7.8 12 12 9 8 7 g9 11 12 11

How to make a heatmap of 3 discrete values using ggplot2?

痴心易碎 提交于 2019-12-04 19:29:24
I have a problem with the aes parameters; not sure what it's trying to tell me to fix. My data frame is like so: > qualityScores Test1 Test2 Test3 Test4 Test5 Sample1 1 2 2 3 1 Sample2 1 2 2 3 2 Sample3 1 2 1 1 3 Sample4 1 1 3 1 1 Sample5 1 3 1 1 2 Where 1 stands for PASS, 2 for WARN, and 3 for FAIL. Here's the dput of my data: structure(list(Test1 = c(1L, 1L, 1L, 1L, 1L), Test2 = c(2L, 2L, 2L, 1L, 3L), Test3 = c(2L, 2L, 1L, 3L, 1L), Test4 = c(3L, 3L, 1L, 1L, 1L), Test5 = c(1L, 2L, 3L, 1L, 2L)), .Names = c("Test1", "Test2", "Test3", "Test4", "Test5"), class = "data.frame", row.names = c(

Setting x.domain with setInterval

老子叫甜甜 提交于 2019-12-04 18:53:45
modify this question again, because the solution does not work in the new version of the library d3 (3.0.3), so I come to ask for some help again would be very grateful. Here is the new code with the library d3 (3.0.3): https://gist.github.com/4495104 http://bl.ocks.org/4495104/e7a7589098140dff36df7ab2a824d71072bc3be4 According to what I've worked, the error should be in the line "491". // Reset the domain relative to the current zoom offsets. x.domain(x0.range().map(function(x) { return (x - translate[0]) / scale; }).map(x0.invert)); We are changing the x.domain every second with setInterval

Visualization of Groups of Poisson random samples using ggridges

可紊 提交于 2019-12-04 17:43:17
I have two sets of data, all in one data frame. The first set is related to data collected in Location 1 and the second set is collected in Location 2. Each location has different count data (column value ) for 5 months. # DataSet ----------------- rp_data <- structure(list(Month = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 3L, 3L, 3L, 3L, 3L, 3L,

Add legend to geom_line() graph in r

試著忘記壹切 提交于 2019-12-04 16:01:31
问题 I've been trying to add legend to my ggplot, but failed miserably. I tried the function scale_colour_manual() , but the legend doesn't show up. ggplot()+ geom_line(data=Summary,aes(y=Y1,x= X),colour="darkblue",size=1 )+ geom_line(data=Summary,aes(y=Y2,x= X),colour="red",size=1 ) My dataframe 'Summary' is as follows: X Y1 Y2 139 1.465477e+16 7.173075e+15 277 1.044803e+16 9.275002e+15 415 1.059258e+16 8.562518e+15 553 1.033283e+16 8.268984e+15 691 9.548019e+15 1.022248e+16 830 1.008212e+16 8

Illustrate mean and standard deviation in ggplot2 density plot

纵然是瞬间 提交于 2019-12-04 15:45:24
I'm trying to construct a plot where I plot normally distributed variables showing their mean on the x-axis and the standard deviation (SD) on the y-axis. Kinda like a density plot, but instead of having the density on the y-axis I want to have the SD (value). I'm working with the data below, set.seed(1) mu1 <- rnorm(10^5, mean = 1, sd = 1) mu3 <- rnorm(10^5, mean = 3, sd = 2) two normally distributed variables. Here their mean and sd, # install.packages("tidyverse", dependencies = TRUE) require(tidyverse) tibble(mu1, mu3) %>% summarise_all(funs(mean, sd)) #> # A tibble: 1 x 4 #> mu1_mean mu3

ggplot2 : How to reduce the width AND the space between bars with geom_bar

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-04 15:39:19
I understand that one can change the width of a bar in geom_bar using the width argument. That does work, but then it creates a larger gap between the bars. Is there a way to manually push the bars closer to together? Should I be manipulating the axis somehow instead? Here is an example, changing width to 0.3 on the right to get the desired bar width. library(tidyverse) library(gridExtra) p1 <- ggplot(iris, aes(Species, Petal.Length)) + geom_bar(stat="summary") p2 <- ggplot(iris, aes(Species, Petal.Length)) + geom_bar(stat="summary", width=0.3) grid.arrange(p1,p2,nrow=1) Note: I know this

Is it possible to put the `plt.yticks` between the horizontal bars?

≡放荡痞女 提交于 2019-12-04 15:38:05
I'm trying to put the value in the plt.yticks between the bars. Unfortunately, I have no idea how to do it. Is it possible?, if it is can anyone give some tips? import pandas as pd import numpy as np import matplotlib.pyplot as plt age = np.array( ["0 - 4", "5 - 9", "10 - 14", "15 - 19", "20 - 24", "25 - 29", "30 - 34", "35 - 39", "40 - 44", "45 - 49", "50 - 54", "55 - 59", "60 - 64", "65 - 69", "70 - 74", "75 - 79", "80 - 84", "85 - 89", "90 - 94", "95 - 99", "> 100"]) m = np.array( [1915887, 2100931, 2494484, 2464805, 2361297, 2529633, 2669927, 2754129, 2753282, 2552531, 2211649, 1697221,

Partial shade of distribution plot using Seaborn

与世无争的帅哥 提交于 2019-12-04 15:35:22
Following simple code: import numpy as np import seaborn as sns dist = np.random.normal(loc=0, scale=1, size=1000) ax = sns.kdeplot(dist, shade=True); Yields the following image: I would like to only shade everything right (or left to some x value). What is the simplest way? I am ready to use something other than Seaborn. After calling ax = sns.kdeplot(dist, shade=True) , the last line in ax.get_lines() corresponds to the kde density curve: ax = sns.kdeplot(dist, shade=True) line = ax.get_lines()[-1] You can extract the data corresponding to that curve using line.get_data : x, y = line.get