heatmap

heatmap.2 specify row order OR prevent reorder?

限于喜欢 提交于 2019-12-07 06:58:05
问题 I'm trying to generate some plots of log-transformed fold-change data using heatmap.2 (code below). I'd like to order the rows in the heatmap by the values in the last column (largest to smallest). The rows are being ordered automatically (I'm unsure the precise calculation used 'under the hood') and as shown in the image, there is some clustering being performed. sample_data gid 2hrs 4hrs 6hrs 8hrs 1234 0.5 0.75 0.9 2 2234 0 0 1.5 2 3234 -0.5 0.1 1 3 4234 -0.2 -0.2 0.4 2 5234 -0.5 1.2 1 -0.5

Single row (or column) heat map in python

拈花ヽ惹草 提交于 2019-12-07 04:59:23
I can create and n by n heatmap using the following code, for example let n be 10: random_matrix = np.random.rand(10,10) number = 10 incrmnt = 1.0 x = list(range(1,number +1)) plt.pcolormesh(x, x, random_matrix) plt.colorbar() plt.xlim(1, number) plt.xlabel('Number 1') plt.ylim(1, number) plt.ylabel('Number 2') plt.tick_params( axis = 'both', which = 'both', bottom = 'off', top = 'off', labelbottom = 'off', right = 'off', left = 'off', labelleft = 'off') I would like to add a 2 row heatmap one near each of the x and y axis, from say row1 = np.random.rand(1,10) and col1 = np.random.rand(1,10) .

Bokeh heatmap usage

試著忘記壹切 提交于 2019-12-07 03:04:06
问题 I have an array of certain events with time stamp and want to create a heatmap: x axis should represent the date, f.e. '2016-02-03', y axis should represent the hour of occurrence, f.e. 13 (if 13:32), the color should depend on the count of occurred event. My data (as pandas dataframe z.head() ): date hour i 0 2016-01-15 13 1 1 2016-01-15 13 1 2 2016-01-15 12 1 3 2016-01-15 10 1 4 2016-01-15 10 1 My failed attempt: from bokeh._legacy_charts import HeatMap, output_file, show hm = HeatMap(z

Make colorbar legend in Matplotlib/Cartopy

好久不见. 提交于 2019-12-07 02:48:52
问题 I've made a geographical heatmap using cartopy and matplotlib, of the number of users of my app, but am having trouble adding a colorbar legend: import cartopy.crs as ccrs import cartopy.io.shapereader as shpreader import matplotlib.pyplot as plt import matplotlib as mpl import numpy as np cmap = mpl.cm.Blues # Countries is a dictionary of {"country_name": number of users}, for example countries = {"United States": 100, "Canada": 50, "China": 10} max_users = float(max(countries.values()))

Heatmap with matplotlib

懵懂的女人 提交于 2019-12-06 15:36:06
I have a set of 3-tuples, each 3-tuple consists of (var1, var2, result). Example of a list of 9 3-tuples: <type 'list'>: [(4, 0.7, 0.8530612244898, 0.016579670213527985), (4, 0.6, 0.8730158730157779, 0.011562402525241757), (6, 0.8, 0.8378684807257778, 0.018175985875060037), (4, 0.8, 0.8605442176870833, 0.015586992159716321), (2, 0.8, 0.8537414965986667, 0.0034013605443334316), (2, 0.7, 0.843537414966, 0.006802721088333352), (6, 0.6, 0.8480725623582223, 0.01696896774039503), (2, 0.6, 0.84693877551025, 0.010204081632749995), (6, 0.7, 0.8577097505669444, 0.019873637350220318)] Now I'd like to

heatmap with values and some additional features in R [duplicate]

假装没事ソ 提交于 2019-12-06 15:35:30
问题 This question already exists : Heatmaps with values in R [duplicate] Closed last year . I am trying to make a heatmap in R, that along with the fill should also show the values and along with filling, should also include a row and column without applying fill on them. My data looks like this Year Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec Sum 1999 116 127 202 229 253 271 271 245 212 174 133 115 2348 2000 114 154 193 214 263 271 254 248 210 167 120 102 2310 2001 124 134 194 202 256 270

Coloring the axis tick text by multiple colors

你说的曾经没有我的故事 提交于 2019-12-06 14:54:26
I'm trying to plot a heatmap using R 's plotly package, where I'd like to have specific colors to specific labels of the y-axis tick text. Here's an example dataset: set.seed(1) df <- reshape2::melt(matrix(rnorm(100),10,10,dimnames = list(paste0("G",1:10),paste0("S",1:10)))) And here's what I'm trying: library(plotly) library(dplyr) plot_ly(z=c(df$value),x=df$Var2,y=df$Var1,colors=grDevices::colorRamp(c("darkblue","gray","darkred")),type="heatmap",colorbar=list(title="Scaled Value",len=0.4)) %>% layout(yaxis=list(title=list(color=c(rep("darkred",5),rep("darkblue",5))))) It's not working since

how do i generate a heat map of a detected object based on its position using opencv python

旧城冷巷雨未停 提交于 2019-12-06 13:40:05
I need to generate the heat map of a object based on its position example: the detected green ball in a video frame . If it stays in a position for a long duration then that place should be red and the positions in the frame where the ball has passes for a short duration must be in blue in that way i need to generate a heat map . Thanks in advance Well what you can do here is 1) First define a heatmap as the size of the image heatmap = np.zeros_like(img[:,:,0]).astype(np.float) 2) Since you already have the detected object and its position, in the heatmap, add 1 to all pixels in the bounding

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

北城以北 提交于 2019-12-06 13:32:28
问题 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

Pheatmap Color for Specific Value

雨燕双飞 提交于 2019-12-06 13:18:48
I am very new to R and recently I have been playing around with the pheatmap library to generate, well, heatmaps. My problem is that I want to color my heatmap in a specific way. I'll describe below: Values < 1 should be a color ramp (e.g. dark blue to light blue) A value exactly equal to 1 should be dark grey Values > 1 should be a color ramp (e.g. dark red to light red) I have played around with the breaks parameter and the color parameter with various palettes but I can't seem to nail a good solution. the closest I've come is something like this: pheatmap(mtx, color = c('#4444FF','#F4FF4F',