如何在R中更改绘图的轴值

时间:2019-06-06 21:36:52

标签: r plot

我有这个情节:

function detectIntersections () {

var detectDirection = new THREE.Vector3();
detectDirection.x = objects[i].position.x;
detectDirection.y = objects[i].position.y;
detectDirection.z = objects[i].position.z;

var detectOrigin = new THREE.Vector3(camera.position.x,camera.position.y,camera.position.z);

var raycaster = new THREE.Raycaster();
raycaster.set(detectOrigin, detectDirection);

var intersects = raycaster.intersectObjects( scene.children, true )};

在我的坐标轴图中,我有一些静态值,但我希望它仅显示在B中包含它们的值。 我已经检查了plotci的论据,但找不到适合其个性化的东西。 有办法吗?

1 个答案:

答案 0 :(得分:2)

您可以将与绘图相关的参数添加到plotCI中。看看吗?{par 在这里,我将yaxt设置为'n'以禁用在y轴上打印刻度线和值。我已使用ylim更改了y轴限制。

函数Axis指定刻度线和值应位于何处。 Side = 2指定y轴。

library(gplots)  
y <- c(2009, 2010, 2011, 2012, 2013, 2014, 2015)
B <- c(249.3543, 249.5647, 392.4330, 383.8343 ,289.9862, 541.6652 ,415.5451)
StdB <- c(64.61869, 59.60757, 46.54578 ,55.59268 ,51.16547 ,59.10967 ,58.53109)
plotCI(y, B,  StdB, StdB,
       sfrac = 0.01, gap=0.2, type="p",lwd=2.5,xlab='Years',ylab ='Values', yaxt = 'n', ylim = c(0, 600))
Axis(at = c(50, 500), side = 2 )