简体   繁体   English

R 3D线图

[英]R 3D line chart

I am trying to create a chart as per image below in R. I have a basic straightforward matrix with locations and values over time, and would like to plot them as per below. 我正在尝试根据下面的图像在R中创建一个图表。我有一个基本的直接矩阵,其中包含随时间变化的位置和值,并希望按照下面的图形绘制它们。 I recognize that one could offset / shift each value manually vertically and horizontally for consecutive rows, but was hoping there is an existing package / graphical option to plot these graphs directly from the matrix. 我认识到,对于连续的行,可以手动垂直和水平地手动偏移/移位每个值,但是希望有一个现有的包/图形选项可以直接从矩阵中绘制这些图。 Help much appreciated, W 非常感谢,W

在此输入图像描述

mat <- sapply(-10:10, function(mean) dnorm(seq(-20,20,len=210), mean))+
        sapply(rep(0,21), function(mean) dnorm(seq(-20,20,len=210), mean))
matplot(seq(-20,20,len=210), mat, type="n", ylim=c(0,1.5))
matlines(seq(-20,20,len=210), mat+rep( seq(0,1, len=21), each=210), lty=1,col=1)

在此输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM