heatmap

Gnuplot pm3d: 'NaN value' removes all surrounding rectangles

本秂侑毒 提交于 2021-01-29 21:33:15
问题 I would like to plot a pm3d map, where data points are not equidistant on the axis. Since the spacings for the x and y axis are identical, it is symmetrical, though. The problem is whenever a value is "NaN", all of the four surrounding rectangles are not plotted. In the data file below, this happens, for example, at (x,y)=(0.14,0.33) . If the value is not 'NaN', then the four rectangles reappear. I discovered this problem, when I tried to plot only the values >0 or <0, where the same happens.

adding hatches to seaborn heatmap plot

心不动则不痛 提交于 2021-01-29 08:21:22
问题 Is there a way to hatch particular 'cells' in a seaborn heatmap, which e.g. fullfill a condition? I already tried it with masked arrays and matplotlib pcolor, but it turned out that it hatched the wrong cells. import numpy as np import seaborn as sns import matplotlib.pyplot as plt flights = sns.load_dataset("flights") flights = flights.pivot("month", "year", "passengers") zm = np.ma.masked_less(flights.values, 200) x= np.arange(0,12) y= np.arange(0,12) sns.heatmap(flights,linewidth=.1) plt

How to plot a heat map by chromosome in R

岁酱吖の 提交于 2021-01-29 06:00:34
问题 I have a data table in the following format: set.seed(1) dt <- data.table( chromosome = c(rep(1, 100), rep(2, 100), rep(3, 80)), mb_from = c(seq(1, 1000, by=10), seq(1, 1000, by=10), seq(1, 800, by=10)), mb_to = c(seq(10, 1000, by=10), seq(10, 1000, by=10), seq(10, 800, by=10)), score = c(sample(1:10, 100, replace = T), sample(1:10, 100, replace = T), sample(1:10, 80, replace = T)) ) And I am trying to plot a figure similar (but not identical) to this: I have tried using ggplot and geom_rect(

R: Adjust Color Gradient for 3DBarplot using latticeExtra cloud in R

久未见 提交于 2021-01-29 05:33:40
问题 I am trying to change the colors of the 3d bar plot so that the colors go from green, to yellow, to orange, to light red, to red, to dark red. However, whenever I plot it, it looks like the colors start repeating after green. Is there something, I can do to fix this? The output that I get is: The output that I want is this: enter image description here This is the code, I am using. It gives me the first picture. That is not what want. I want the colors to look the way they look in the second

How to properly handle datetime and categorical axes in bokeh/holoviews heatmap plot?

☆樱花仙子☆ 提交于 2021-01-29 04:48:59
问题 I'm trying to plot a simple heatmap using bokeh/holoviews. My data (pandas dataframe) has categoricals (on y) and datetime (on x). The problem is that the number of categorical elements is >3000 and the resulting plot appears with messed overlapped tickers on the y axis that makes it totally useless. Currently, is there a reliable way in bokeh to select only a subset of the tickers based on the zoom level? I've already tried plotly and the result looks perfect but however I need to use bokeh

leaflet heatmap.js legend and tooltip

时光总嘲笑我的痴心妄想 提交于 2021-01-29 04:44:29
问题 I'm trying to use leaflet, OSM and heatmap.js to create a heatmap showing for instance sales. I have no problem creating the heatmap using simple javascript and heatmap.js, leaflet-heatmap.js, "leaflet heatmap overlay.js", but I'm now trying to add a legend and tooltips as per the example code at https://www.patrick-wied.at/static/heatmapjs/example-legend-tooltip.html I do not know how to combine the simple L. controls with the DOM / canvas that the example uses. And ideally after that, I

How to delete/add rows in Bokeh heatmap and maintain row height?

冷暖自知 提交于 2021-01-28 22:52:37
问题 I've made a Bokeh heatmap linked to a CheckBoxGroup, so that the active items in the CheckBoxGroup correspond to the rows displayed in the heatmap. i.e. checking/unchecking boxes in the CheckBoxGroup adds or deletes rows in the heatmap. It all works fine except that I would like the rows of the heatmap to stay the same height regardless of how many rows are in the heatmap. What actually happens is the original height of the heatmap is retained and the rows resize to fit the original height. I

How to delete/add rows in Bokeh heatmap and maintain row height?

谁说我不能喝 提交于 2021-01-28 22:29:09
问题 I've made a Bokeh heatmap linked to a CheckBoxGroup, so that the active items in the CheckBoxGroup correspond to the rows displayed in the heatmap. i.e. checking/unchecking boxes in the CheckBoxGroup adds or deletes rows in the heatmap. It all works fine except that I would like the rows of the heatmap to stay the same height regardless of how many rows are in the heatmap. What actually happens is the original height of the heatmap is retained and the rows resize to fit the original height. I

Assign specific color to seaborn heatmap

爷,独闯天下 提交于 2021-01-28 04:40:39
问题 I'm trying to make heatmap using seaborn, but got stuck to change color on specific values. Suppose, the value 0 should be white, and value 1 should be grey, then over that uses the palette as provided by cmap. Was trying to use mask, but got confused. import matplotlib.pyplot as plt import numpy as np import seaborn as sns import pandas as pd df = pd.read_csv('/home/test.csv', index_col=0) fig, ax = plt.subplots() sns.heatmap(df, cmap="Reds", vmin=0, vmax=15) plt.show() this for the sample

R ggplot heatmap with multiple rows having separate legends on the same graph

跟風遠走 提交于 2021-01-27 20:07:00
问题 I'm trying to make one heatmap using ggplot2 that contains 3 types of variables where each need their own independent legend/scale. I am able to plot them all in one heatmap (pictured below), but I am having trouble separating them to have their own legend. My three categories are the row "Score", "samp1" and the rest of the data. I would like each of these to have their own independent legends with their respective ranges. My only addition would be to have the row score have a green,yellow