data-visualization

How to Bound the Outer Area of Voronoi Polygons and Intersect with Map Data

。_饼干妹妹 提交于 2019-12-05 12:16:08
问题 Background I'm trying to visualize the results of a kmeans clustering procedure on the following data using voronoi polygons on a US map. Here is the code I've been running so far: input <- read.csv("LatLong.csv", header = T, sep = ",") # K Means Clustering set.seed(123) km <- kmeans(input, 17) cent <- data.frame(km$centers) # Visualization states <- map_data("state") StateMap <- ggplot() + geom_polygon(data = states, aes(x = long, y = lat, group = group), col = "white") # Voronoi V <- deldir

3D Plotting from X, Y, Z Data, Excel or other Tools

可紊 提交于 2019-12-05 11:31:59
问题 I have data that looks like this: 1000 13 75.2 1000 21 79.21 1000 29 80.02 5000 29 87.9 5000 37 88.54 5000 45 88.56 10000 29 90.11 10000 37 90.79 10000 45 90.87 I want to use the first column as x axis labels, the second column as y axis labels and the third column as the z values. I want to display a surface in that manner. What is the best way to do this? I tried Excel but didn't really get anywhere. Does anyone have any suggestions for a tool to do this? Does anyone know how to do this in

Data visualization in R

夙愿已清 提交于 2019-12-05 08:00:57
问题 The data to be visualized is from an experiment (T1-T8 represents different sections of the brain) and is as follows: [[Block1]] sum [T1,] 6 [T2,] 6 [T3,] 4 [T4,] 5 [T5,] 8 [T6,] 9 [T7,] 8 [T8,] 6 [[Block2]] sum [T1,] 3 [T2,] 3 [T3,] 4 [T4,] 5 [T5,] 4 [T6,] 2 [T7,] 1 [T8,] 5 [[Block3]] sum [T1,] 3 [T2,] 3 [T3,] 4 [T4,] 2 [T5,] 4 [T6,] 8 [T7,] 3 [T8,] 1 [[Block4]] sum [T1,] 6 [T2,] 5 [T3,] 4 [T4,] 3 [T5,] 9 [T6,] 8 [T7,] 2 [T8,] 6 [[Block5]] sum [T1,] 8 [T2,] 3 [T3,] 4 [T4,] 5 [T5,] 7 [T6,] 6

Google chart timeline horizontal scroll

老子叫甜甜 提交于 2019-12-05 07:24:56
I have a timeline chart, very similar to the very first example at this page ( https://developers.google.com/chart/interactive/docs/gallery/timeline ). I have activities on the Y axis (making lunch, eating, ecc) and on the X axis i have the time. I want to enable horizontal scroll and chart zoom in/out (As mentioned in this topic Google chart horizontal scrollbar ). But i can't seem to get it working. is there some way to enable horizontal scrolling on the timeline chart? Many thanks. Alessandro there are no standard configuration options on the Timeline chart for scroll nor zoom. but you

How can box plot be overlaid on top of swarm plot in Seaborn?

一曲冷凌霜 提交于 2019-12-05 06:08:30
I am trying to plot swarm plots and box plots together using matplotlib and Seaborn. I found how to plot them together but the box plot appears underneath the swarm plot. The problem with this is that the swarm plot points drown out the box plot and the box plot is lost. I thought that by switching the order of the functions called, to have the box plot called first rather than second as in the link below, would overlay the box plot on top but it does not. Is it possible to overlay the box plot on top of the swarm plot points? If not, is it possible to create lines indicating where the

Can I use shingles from lattice in ggplot2 in R

穿精又带淫゛_ 提交于 2019-12-05 02:12:29
It is possible to use the shingles to define specific ranges in ggplot2 . As far as i understand shingles are a way to generate groups. Can we create such shingle s and use them in ggplot2 facet_grid to obtain graphs? Following up from the comments, ggplot can't draw shingles (in the way lattice draws shingles with special indicators in the strip) and by default doesn't have a means of producing the overlapping groups. However, I cam across this excellent PDF document which aims to produce a gpplot2 version of every figure in Depayan's excellent Lattice book ( Lattice: Multivariate Data

Scatter plot with variable marker size (seaborn)

橙三吉。 提交于 2019-12-05 01:34:21
问题 I am using a seaborn pairplot to plot a scatter plot of different dimensions of my datapoints. However, I want the markers of the datapoints to have a size that corresponds to one of the dimensions of the datapoints. I have the following code: markersize = 1000* my_dataframe['dim_size'] / sum(my_dataframe['dim_size']) sns.set_context("notebook", font_scale=1.5, rc={'figure.figsize': [11, 8]}) sns.set_style("darkgrid", {"axes.facecolor": ".9"}) kws = dict(s=markersize, linewidth=.5, edgecolor=

AttributeError: Unknown property axisbg

Deadly 提交于 2019-12-05 00:29:50
Here is a code am trying to run: ax = plt.axes(axisbg='#E6E6E6') ax.set_axisbelow(True) plt.grid(color='w',linestyle='solid') for spine in ax.spines.values(): spine.set_visible(False) ax.xaxis.tick_bottom() ax.yaxis.tick_left() ax.tick_params(colors='gray',direction='out') for tick in ax.get_xticklabels(): tick.set_color('gray') for tick in ax.get_yaxislabels(): tick.set_color('gray') ax.hist(x,edgecolor='E6E6E6',color='E6E6E6'); And the Error is: AttributeError: Unknown property axisbg Please help me identify the error. Replace the below line of code ax = plt.axes(axisbg='#E6E6E6') with ax =

Time series visualization for start, end, duration in R

有些话、适合烂在心里 提交于 2019-12-04 21:13:20
I have the following data: > Data Date Start End 1 2011-11-15 12:01:27 12:30:15 2 2011-11-16 12:01:25 12:32:15 3 2011-11-17 12:01:02 12:39:12 4 2011-11-19 12:01:12 12:30:18 to which I've also appended a Duration column Data[,4] <- as.numeric(difftime(Data$End,Data$Start)) names(Data)[4] <- "Duration" I have in my head a visualization for Start,End that looks kind of like a stock candlestick or OHLC chart, where the x value is the Date, and y is End - Start. End is at the top with a rectangle descending down to Start---the height of the rectangle changes over time with the Duration. That is,

Creating asymmetric layouts involving rows and column in Shiny

只愿长相守 提交于 2019-12-04 21:12:46
问题 I have created multiple rows in a shiny ui as such: shinyUI(fluidPage( fluidRow( column(6, textOutput("text_col1_row_1")), column(6 textOutput("text_col2_row_1"))), fluidRow( column(6, textOutput("text_col1_row_2")), column(6, textOutput("text_col2_row_2"))), )) which creates a nice 4 X 4 grid. It seems Shiny is geared towards allowing users to organize objects into columns. I would like to see if I can organize my display into something that has two columns, yet within a column, it has two