Вопрос по r, python – Тепловая карта двоичных данных с использованием R или Python

1

Error: User Rate Limit Exceeded

Error: User Rate Limit Exceeded

events    germany    Italy 
Rain      0          1
hail      1          0
sunny     0          0

Error: User Rate Limit Exceeded

What have you tried? mac
Error: User Rate Limit Exceeded Etienne Low-Décarie
Error: User Rate Limit Exceeded Angelo
Error: User Rate Limit Exceeded Paul Hiemstra
Error: User Rate Limit ExceededpythonError: User Rate Limit ExceededRError: User Rate Limit Exceeded Hooked

Ваш Ответ

5   ответов
0

rownames(dat) = dat$weather
heatmap(as.matrix(dat[,2:3]), scale='none')

dat

2

library(bipartite)
mat<-matrix(c(0,1,1,0,1,1),byrow=TRUE,nrow=3)
rownames(mat)<-c("Rain","hail","sunny")
colnames(mat)<-c,("Germany","Italy")
visweb(mat,type="None")

visweb(mat,type="None",labsize=2,square="b",box.col="red") 
Error: User Rate Limit Exceededplotsize=12Error: User Rate Limit Exceeded
Error: User Rate Limit Exceeded Angelo
labsize=2Error: User Rate Limit Exceededvisweb(mat,type="None",labsize=2)
2

library(reshape)
library(ggplot2)

dat <- data.frame(weather=c("Rain","Hail","Sunny"), Germany = c(0,1,0), Italy = c(1,0,0))

melt.data<-melt(dat, id.vars="weather", variable_name="country")

qplot(data=melt.data,
      x=country,
      y=weather,
      fill=factor(value),
      geom="tile")+scale_fill_manual(values=c("0"="white", "1"="red"))

enter image description here

Error: User Rate Limit Exceeded Angelo
Error: User Rate Limit Exceeded Angelo
Error: User Rate Limit Exceeded
5

EditError: User Rate Limit Exceeded

Hail  0 1 0 0 0 0 0 1 0 0
Sunny 1 1 1 0 1 0 1 0 1 1

Error: User Rate Limit Exceeded

from numpy import loadtxt
import pylab as plt

labels = loadtxt("data.txt", usecols=[0,],dtype=str)
A      = loadtxt("data.txt", usecols=range(1,10))

plt.imshow(A, interpolation='nearest', cmap=plt.cm.Reds)
plt.yticks(range(A.shape[0]), labels)

plt.show()
import pylab as plt

enter image description here

Error: User Rate Limit Exceeded Angelo
Error: User Rate Limit Exceeded
Error: User Rate Limit Exceeded Angelo
Error: User Rate Limit Exceeded Angelo
Error: User Rate Limit ExceededexactlyError: User Rate Limit ExceededA isError: User Rate Limit Exceeded
4

?image

dat <- data.matrix(data.frame(Germany = c(0,1,0), Italy = c(1,0,0)))
rownames(dat) <- c("Rain","Hail","Sunny")

image(z = dat, col = c("white","red"))

op <- par(mar = c(5,5,4,2) + 0.1)
image(z = dat, col = c("white","red"), axes = FALSE)
axis(side = 1, labels = rownames(dat), 
     at = seq(0, by = 0.5, length.out = nrow(dat)))
axis(side = 2, labels = colnames(dat), at = c(0,1), las = 1)
box()
par(op)

binary heatmap

dat (image(z = t(dat), ....)axis()side21las = 1

op <- par(mar = c(5,5,4,2) + 0.1)
image(z = t(dat2), col = c("white","red"), axes = FALSE)
axis(side = 2, labels = rownames(dat2), 
     at = seq(0, by = 0.5, length.out = nrow(dat2)), las = 1)
axis(side = 1, labels = colnames(dat2), at = c(0,1))
box()
par(op)
Error: User Rate Limit Exceeded Angelo

Похожие вопросы