Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 206503

Why does R plot_ly heatmap extend x limits of my data?

$
0
0

I wanted to render the following content in a heatmap rather than a countour plot:

enter image description here

When I render the same content via:

p2 <- plot_ly(x=xplot,y=yplot,z=zplot,type="heatmap",zsmooth="best")

I get

enter image description here

I've verified that the limits of xplot are 100 and 200.

Why does plot_ly show the x-axis ranging from 50 to 250? I thought maybe it had to do with the way data gets "z-smoothed", but the y-axis seems to be untouched.


The dataset I am trying to plot has 2,500 points, but I believe you should be able to see the same behavior with the following data:

xplot = c(100, 100, 200, 200, 200, 200, 200)
yplot = c(98, 100, 184, 188, 192, 196, 200)
zplot = c(557740.27, 562123.04,  23871.66,  24987.45,  25735.05,  26106.02,  26095.27)

Viewing all articles
Browse latest Browse all 206503

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>