heatmap

heatmap.2 specify row order OR prevent reorder?

我与影子孤独终老i 提交于 2019-12-05 09:52:17
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 6234 -0.5 1.3 2 -0.3 7234 1 1.2 0.5 2 8234 -1.3 -0.2 2 1.2 9234 0.2 0.2 0.2 1 0123 0.2 0.2 3 0.5 code

Python Matplotlib point colour

天涯浪子 提交于 2019-12-05 09:49:40
I have been looking at temperature plotting with sensors and wanted to find how I can either construct a contour/heat map or edit the colours of my points based on a cmap? I have the following very basic plot: import matplotlib.pyplot as plt import matplotlib.image as mpimg import numpy as np from pylab import * figure(figsize=(15, 8)) # use ginput to select markers for the sensors matplotlib.pyplot.hot() markers = [(269, 792, 0.65), (1661, 800, 0.5), (1017, 457, 0.8)] x,y,t = zip(*markers) img = mpimg.imread('floor.png') imgplot = plt.imshow(img, cmap=cm.hot) plot(x, y, 'h', c=t, ms=15)

Make colorbar legend in Matplotlib/Cartopy

狂风中的少年 提交于 2019-12-05 08:22:14
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())) shapename = 'admin_0_countries' countries_shp = shpreader.natural_earth(resolution='110m', category=

Bokeh heatmap usage

╄→гoц情女王★ 提交于 2019-12-05 07:58:33
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.head(), x='date', y='hour', values='i', stat='count') And the exception: AttributeError Traceback (most

Python: How to plot a heatmap for coordinates with different color intensity or different radius of circles?

非 Y 不嫁゛ 提交于 2019-12-05 04:22:48
问题 Given some data in three lists, for example: latitudes = [50.877979278564,48.550216674805,47.606079101562,50.772491455078,42.451354980469,43.074657440186,44.044174194336,44.563243865967,52.523406982422,50.772491455078] longitudes = [4.700091838837, 9.038957595825, -122.333000183105, 7.190686225891, -76.476554870605, -89.403335571289, -123.070274353027, -123.281730651855, 13.411399841309, 7.190686225891] counts = [15, 845, 2, 50, 95, 49, 67, 32, 1, 88] which can be interpreted as: The

R iGraph Heatmap in Vertex

做~自己de王妃 提交于 2019-12-05 03:11:05
问题 I'm quite new to R and stuck on a question. Would it be possible to print a heatmap on a vertex in iGraph ? I know I can do a colored square or circle. But would a small heatmap be possible? This is the code that draws my current graph: # create graph graph <- graph.data.frame(network[,1:2]) vertex_names <- get.vertex.attribute(graph,"name") # define node attributes V(graph)$label.font <- 1 V(graph)$label.font[which(element_types[vertex_names,"type"]=="PRIMARIES")] <- 2 V(graph)$label.font

Configuring heatmap overlays using Google Maps API

牧云@^-^@ 提交于 2019-12-05 01:06:49
问题 I'm trying to use the Google Maps API to generate a heatmap of locations. It works, but the result is not very useful, since the parts rendered by the heatmap are small are hard to see: Nothing in the docs suggest a way to expand the heatmap to render in larger blobs. Is there an undocumented way of doing this or is this just a limitation of the API? Do I just need more data points? I've pasted the code I'm using below. <!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device

Set Max value for color bar on seaborn heatmap

旧街凉风 提交于 2019-12-05 00:06:01
I need to set the max value on the seaborn heatmap cbar to 2. I've tried: cbar_kws = { 'ticks' : [0, 2] } sns.heatmap(tiles, robust=True, fmt="f", cmap= 'RdBu_r', cbar_kws = cbar_kws) But this doesn't work and the documentation isn't very clear. How would I do this properly? I think you want to use the vmin and vmax parameters for the heatmap, as described in the docs : vmin, vmax : floats, optional Values to anchor the colormap, otherwise they are inferred from the data and other keyword arguments. sns.heatmap(tiles, robust=True, fmt="f", cmap='RdBu_r', vmin=0, vmax=2) 来源: https:/

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

依然范特西╮ 提交于 2019-12-04 22:48:42
This question is an exact duplicate of: Heatmaps with values in R [duplicate] 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 270 243 212 176 128 108 2317 2002 107 137 199 213 267 269 267 250 211 153 123 109 2304 2003 116 141 192 220 229 265

How to create a 3d Heatmap from a discrete data set in Python?

﹥>﹥吖頭↗ 提交于 2019-12-04 20:05:13
I have a large dataset of the form [(X1, Y1, Z1, VALUE1), (X2, Y2, Z2, VALUE2)...]. The geometry of the points is the surface of a cylinder, while there are many discrete points they come nowhere near being a full mesh. I would like to create a basic plot, where each of the points is given an intensity of a color (like a heatmap) based on how high its value is, and then the colors are smoothed to some degree to create a cohesive surface rather than discrete points I am currently using matplotlib, however, I would also use other libraries if necessary. I have looked into both surface plots and