剧情出现奇怪缺口的原因 [英] Reason for strange gap in the plot

查看:50
本文介绍了剧情出现奇怪缺口的原因的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这个深度与时间的图:这个情节在五月初有一个奇怪的差距.

I have this plot of Depths vs time: This plot has a strange gap at the start of May.

我检查了数据,但没有 NAs 或 Nans 或没有丢失数据.这是一个15分钟有规律的时间序列

I checked the data but there are no NAs or Nans or no missing data. This is a time series of regular interval of 15 minutes

我无法在此处提供数据集,因为它包含 10,000 行.有人可以提出建议吗?

I cannot give the dataset here since it contains 10,000 rows. Can somebody please give suggestions as what possibly it can be?

我正在使用以下绘图代码:

I am using the following plotting code:

   library(zoo)
   z=read.zoo("data.txt", header=TRUE)
   temp=index(z[,1])
   m=coredata(z[,1])
x=0.001
p=rep.int(x,length(temp))
png(filename=paste(Name[k],"_mean1.png", sep=''), width= 3500, height=1600, units="px")
par(mar=c(13,13,5,3),cex.axis= 2.5, cex.lab=3, cex.main=3.5, cex.sub=5)
plot(temp,m, xlab="Time", ylab="Depth",type='l', main=Name[k])
symbols(temp,m,add=TRUE,circles=p, inches=1/15, ann=F, bg="steelblue2", fg=NULL)
dev.off()

推荐答案

好的,这是您发布的内容的猜测.

Okay, here's a guess from what you have posted.

我猜在 5 月初的某个时期没有数据,在该时期出现了相关的差距".没有 NA,因为根本没有这一时期的任何数据行.这行代码仍然在图中绘制了一条细黑线,它连接了数据中的差距"......

I'm guessing there is no data for a period right at the start of May where the 'gap' in question pops up. There are no NAs because there just aren't any lines of data for this period at all. There is still a thin black line drawn to the plot by this line of code which links the 'gap' in data...

plot(temp,m, xlab="Time", ylab="Depth",type='l', main=Name[k])

...但是没有将蓝色符号(圆圈)绘制得足够靠近以使其看起来像一条连续的蓝线.使用以下代码绘制的蓝色符号位于现有图的顶部:

...but there are no blue symbols (circles) plotted close together enough to make it look like a continuous blue line. The blue symbols being plotted with the below code, over the top of the existing plot:

symbols(temp,m,add=TRUE,circles=p, inches=1/15, ann=F, bg="steelblue2", fg=NULL)

我建议不要绘制一条线,然后在其顶部绘制符号,而是绘制一条粗蓝线开始,例如:

I suggest instead of plotting a line and then plotting symbols over the top of it that you just plot a thick blue line to start with like:

plot(temp,m, xlab="Time", ylab="Depth",type='l', main=Name[k],lwd=5,col="steelblue2")

这篇关于剧情出现奇怪缺口的原因的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆