heatmap

Show every nth row name in ggplot2

你。 提交于 2019-12-24 03:57:04
问题 I have a dataframe in the following long format: > head(cleanLongPlotData) Structure Method Value Outcome 1 1A00 X1 1 Clustering 2 1A01 X1 1 Clustering 3 1A02 X1 0 No Clustering 4 1A0U X1 1 Clustering 5 1A0Z X1 1 Clustering 6 1A1M X1 0 No Clustering > tail(cleanLongPlotData) Structure Method Value Outcome 12931 4PRN Z 0 No Clustering 12932 4PRP Z 0 No Clustering 12933 4PXZ Z -1 Blank 12934 4PY0 Z -1 Blank 12935 4Q3H Z -1 Blank 12936 6HBW Z 1 Clustering Each method has 2,196 observations. I'm

heat maps in R with heatmap.2

倾然丶 夕夏残阳落幕 提交于 2019-12-24 03:38:13
问题 I am trying to create a heatmap in R. I have tried using the heatmap.2 command. My data consists of x, and y columns and associated relative frequency of a point(frequency divided by the total frequency) with zero frequency in most places and a small relative frequency in others. I have converted my data to a matrix since this seems what the heatmap command wants and attempted to remove the x and y-coordinates. BB <- matrix(as.matrix(surfacerevfreq1[, 3]), ncol = 35, byrow = T) There are two

Generating subplots of heatmaps in Julia-lang

此生再无相见时 提交于 2019-12-24 02:23:54
问题 I am trying to produce a figure/plot with more than a single heatmap (matrix with color shading according to the cell value). At the moment using Plots; pyplot() and heatmap(mat) is enough to produce a heatmap. It is not clear to me how to produce a single figure with more though. After looking at this page example subplots for how to use the layout, and then the example histogram, I cannot seem to produce working examples for the two together. The question is how to produce a figure with two

Group variables by clusters on heatmap in R

為{幸葍}努か 提交于 2019-12-24 01:33:33
问题 I am trying to reproduce the first figure of this paper on graph clustering: Here is a sample of my adjacency matrix: data=cbind(c(48,0,0,0,0,1,3,0,1,0),c(0,75,0,0,3,2,1,0,0,1),c(0,0,34,1,16,0,3,0,1,1),c(0,0,1,58,0,1,3,1,0,0),c(0,3,16,0,181,6,6,0,2,2),c(1,2,0,1,6,56,2,1,0,1),c(3,1,3,3,6,2,129,0,0,1),c(0,0,0,1,0,1,0,13,0,1),c(1,0,1,0,2,0,0,0,70,0),c(0,1,1,0,2,1,1,1,0,85)) colnames(data)=letters[1:nrow(data)] rownames(data)=colnames(data) And with these commands I obtain the following heatmap:

Why is plt.imshow so much quicker than plt.pcolor ?

女生的网名这么多〃 提交于 2019-12-24 00:43:51
问题 I am trying to figure out as much data visualization tools as I can from 2D matrices (bonus points to any other good methods for looking at 2D matrices). I generate a lot of heatmaps, where I've been told pcolor is the way to go (I now use seaborn ). Why is plt.imshow SO much quicker than plt.pcolor when they are doing really similar operations? def image_gradient(m,n): """ Create image arrays """ A_m = np.arange(m)[:, None] A_n = np.arange(n)[None, :] return(A_m.astype(np.float)+A_n.astype

Create heatmap in python matplotlib with x and y labels from dict with {tuple:float} format

江枫思渺然 提交于 2019-12-23 22:00:42
问题 I have a dict that consists of movie-title pairs as keys and a similarity score as values: {('Source Code ', 'Hobo with a Shotgun '): 1.0, ('Adjustment Bureau, The ', 'Just Go with It '): 1.0, ('Limitless ', 'Arthur '): 1.0, ('Adjustment Bureau, The ', 'Kung Fu Panda 2 '): 1.0, ('Rise of the Planet of the Apes ', 'Scream 4 '): 1.0, ('Source Code ', 'Take Me Home Tonight '): 1.0, ('Midnight in Paris ', 'Take Me Home Tonight '): 1.0, ('Harry Potter and the Deathly Hallows: Part 2 ', 'Pina '): 1

Discrete colorbar in R plotly

拥有回忆 提交于 2019-12-23 13:04:04
问题 I am trying to produce a Heatmap with R plotly. This is the reproducible example: test <- structure(list(s1 = c(0L, 0L, 1L, 0L, 1L, 1L), s2 = c(1L, 1L, 0L, 1L, 0L, 0L), s3 = c(0L, 0L, 0L, 0L, 0L, 0L), s4 = c(0L, 0L, 0L, 0L, 0L, 0L), s5 = c(0L, 0L, 0L, 0L, 0L, 0L), s6 = c(0L, 0L, 0L, 0L, 0L, 0L)), .Names = c("s1", "s2", "s3", "s4", "s5", "s6" ), row.names = c("5HT2 type receptor mediated signaling pathway", "5HT3 type receptor mediated signaling pathway", "5-Hydroxytryptamine degredation",

Discrete colorbar in R plotly

淺唱寂寞╮ 提交于 2019-12-23 13:02:32
问题 I am trying to produce a Heatmap with R plotly. This is the reproducible example: test <- structure(list(s1 = c(0L, 0L, 1L, 0L, 1L, 1L), s2 = c(1L, 1L, 0L, 1L, 0L, 0L), s3 = c(0L, 0L, 0L, 0L, 0L, 0L), s4 = c(0L, 0L, 0L, 0L, 0L, 0L), s5 = c(0L, 0L, 0L, 0L, 0L, 0L), s6 = c(0L, 0L, 0L, 0L, 0L, 0L)), .Names = c("s1", "s2", "s3", "s4", "s5", "s6" ), row.names = c("5HT2 type receptor mediated signaling pathway", "5HT3 type receptor mediated signaling pathway", "5-Hydroxytryptamine degredation",

reduce width of columns on a heatmap.2 plot

*爱你&永不变心* 提交于 2019-12-23 06:35:09
问题 I have a 331*9 double matrix (named expr001). It looks like this: row.names Col1 Col2 Col3 Col4 Col5 Col6 Col7 Col8 Col9 17211382 7.397439 7.377975 7.299997 8.192889 8.292300 8.092921 8.178948 8.120986 8.276824 17211752 9.115307 9.116741 9.113366 8.423073 8.458392 8.573309 8.773752 8.614159 8.592105 17212229 5.968911 6.060437 6.059898 5.595364 5.471327 5.538794 5.584753 5.518935 5.498830 17215629 8.641765 8.810358 8.770533 7.482992 7.732727 7.811839 8.582255 8.404402 8.357516 17215820 11

Adding importance of points in matplotlib heat map

孤者浪人 提交于 2019-12-23 05:42:20
问题 I have two questions about matplotlib heat map. 1) Is possible to add importance of X and Y points to matplotlib heat map? 2) Is possible to draw coordinates without data by white color? My Python map generation file looks like this: import sys import os import numpy as np import pandas as pd import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt from scipy import stats csv_filename = 'heatmap_data.csv' df = pd.read_csv(csv_filename) red_df = df[df['type']=='red'] blue_df =