楼主: zhangyimedical
1842 1

[程序分享] 求助:R语言绘图图片坐标轴刻度显示TRUE [推广有奖]

  • 0关注
  • 0粉丝

初中生

4%

还不是VIP/贵宾

-

威望
0
论坛币
13 个
通用积分
0
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
65 点
帖子
6
精华
0
在线时间
16 小时
注册时间
2011-4-17
最后登录
2022-3-29

楼主
zhangyimedical 发表于 2020-5-7 17:23:00 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
求助:R语言循环绘图,部分数据刻度显示正常,其他一部分刻度显示不正常,左侧纵坐标显示为TRUE,并且图片的轴标签显示不全。求高人指点代码如下:
a<- subset(constituent)[,11:42]
b=names(a)
c<-subset(constituent,select=location)
d<-unique(c)


for (i in 1:nrow(d)){
  constituent_group=subset(constituent,location==d$location)
  pdf(d[i,],width=20,height=22)
  layout(matrix(c(1,2,3,4),ncol=1,byrow=T))
  par(mar=c(8,10,8,10),mgp=c(3,1,0),las=1)
  showtext_begin()
  for (j in 1:ncol(a)){
    constituent_group1=subset(constituent_group,select=c(location,date,j+10,PM2.5))
    validl<-!is.na(constituent_group1[,3])
    validr<-!is.na(constituent_group1$PM2.5)
    if (sum(validl)<=0 )
      next
    twoord.plot(lx = constituent_group1$date[validl],
                ly = as.numeric(constituent_group1[,3][validl]),
                rx = constituent_group1$date,
                ry = constituent_group1$PM2.5,
                main = constituent_group1$location[1],
                xlab = "Time",
                ylab = names(constituent_group1)[3],
                rylab = "PM2.5",
                type = c("point","line"),
                lytickpos= max(as.numeric(constituent_group1[,3])),
                lcol= "steelblue", rcol = "red",lpch=20)
  }
  showtext_end()
  dev.off()
}

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

关键词:Rue 坐标轴 TRU R语言 求高人指点

沙发
zhangyimedical 发表于 2020-5-7 17:32:21
这是显示不正常的图

微信截图_20200507171827.png (102.81 KB)

微信截图_20200507171827.png

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2025-12-21 11:23