Error in xy.coords(x, y, xlabel, ylabel, log) :  'x' and 'y' lengths differ

目录

Error in xy.coords(x, y, xlabel, ylabel, log) :  'x' and 'y' lengths differ

问题:

解决:

完整问题:


问题:

#两个向量长度不同

#define x and y variables
x <- c(2, 5, 5, 8)
y <- c(22, 28, 32, 35, 40, 41)#attempt to create scatterplot of x vs. y
plot(x, y)

解决:

#数据长度对等,以x为基础

#define x and y variables
x <- c(2, 5, 5, 8)
y <- c(22, 28, 32, 35, 40, 41)#create scatterplot of first 4 pairwise values of x vs. y
plot(x, y[1:length(x)])

#把x序列补齐;

#define x and y variables to have same length
x <- c(2, 5, 5, 8, 9, 12)
y <- c(22, 28, 32, 35, 40, 41)#confirm that x and y are the same length
length(x) == length(y)[1] TRUEcreate scatterplot of x vs. y
plot(x, y)

完整问题:

> #define x and y variables
> x <- c(2, 5, 5, 8)
> y <- c(22, 28, 32, 35, 40, 41)

> #attempt to create scatterplot of x vs. y
> plot(x, y)
Error in xy.coords(x, y, xlabel, ylabel, log) : 
  'x' and 'y' lengths differ

Error in xy.coords(x, y, xlabel, ylabel, log) : ‘x‘ and ‘y‘ lengths differ相关推荐

  1. python设置坐标轴刻度值字体大小_python 设置xlabel,ylabel 坐标轴字体大小,字体类型...

    本文介绍了python 设置xlabel,ylabel 坐标轴字体大小,字体类型,分享给大家,具体如下: #--coding:utf-8-- import matplotlib.pyplot as p ...

  2. matlab中xlabel中写 it,matlab中的xlabel, ylabel, zlabel

    标注x,y和z轴 语法 xlabel('string') xlabel(fname) xlabel(...,'PropertyName',PropertyValue,...) xlabel(axes_ ...

  3. python字体类型_python 设置xlabel,ylabel 坐标轴字体大小,字体类型

    本文介绍了python 设置xlabel,ylabel 坐标轴字体大小,字体类型,分享给大家,具体如下: #--coding:utf-8-- import matplotlib.pyplot as p ...

  4. matlab中的xlabel, ylabel, zlabel

    随时随地技术实战干货,获取项目源码.学习资料,请关注源代码社区公众号(ydmsq666) 标注x,y和z轴 语法 xlabel('string') xlabel(fname) xlabel(...,' ...

  5. matlab中plot和xlabel,matlab tips--plot之xlabel/ylabel

    y=x.*exp(-x) plot(x,y),xlabel('x'),ylabel('y'),title('y=x*exp(-x)') 然后我在command窗口中依次输入: >> x=0 ...

  6. python plot label_python - matplotlib子图的通用xlabel / ylabel

    python - matplotlib子图的通用xlabel / ylabel 我有以下情节: fig,ax = plt.subplots(5,2,sharex=True,sharey=True,fi ...

  7. python字体大小_python 设置xlabel,ylabel 坐标轴字体大小,字体类型

    本文介绍了python 设置xlabel,ylabel 坐标轴字体大小,字体类型,分享给大家,具体如下: #--coding:utf-8-- import matplotlib.pyplot as p ...

  8. MATLAB title,xlabel,ylabel中引入变量

    1个变量: title ( ['运行时间: ',num2str(toc) ] ); ---------------------------------------------------------- ...

  9. python xy不在第一维度_ValueError:x和y必须具有相同的第一个维度ipython 3.5

    我是ipython的新手 . 我在ipython中有这段代码 def derivative(x): return 3*(x^2) derivative_estimate = lambda x: dif ...

最新文章

  1. Unix / 类 Unix shell 中有哪些很酷很冷门很少用很有用的命令?(转)
  2. Kong APIGW — 基本操作
  3. Linux操作系统下利用SSH进行远程控制
  4. 【算法】快速排序与归并排序对比
  5. ARM1176JZF-S/S3C6410 内存地址转换
  6. matlab循环数组里的数据库,用于在matlab的python中循环数组
  7. boost::geometry::model::multi_linestring用法的测试程序
  8. linux下搭建cacti监控
  9. Elasticsearch 索引容量管理实践
  10. 在中国,真正达到月收入1万以上的有多少
  11. structured Streaming
  12. Java知多少(84)图形界面之布局设计
  13. Android数据加载和Json解析——蓝本
  14. 六石管理学:行政人员也要学会使用SVN保存文档
  15. Fragstats景观多样性
  16. win764位安装vs2010sp1补丁卡在kb983509解决办法低于40分钟
  17. ExpandableListView说明及其用法
  18. 高端玩家的运营与维护
  19. 更换固态硬盘并使用微pe安装windows7系统及万能网卡
  20. 铸造工艺问题6——砂型涂料多厚,刷几次?芯头斜度?新旧砂的作用树脂、固化剂的作用

热门文章

  1. 负载均衡算法-最少连接数均衡
  2. 网页(Webpage)粒度分析算法
  3. Linux常用命令及技巧3
  4. Python的控制语句4
  5. android调用h5预加载图片,使用HTML5的页面资源预加载(Link prefetch)功能加速你的页面加载速度...
  6. git使用的详细过程
  7. STL中的双向队列deque
  8. 计算机内存不足 ssd,电脑提示内存不足怎么办 虚拟内存设置方法【详解】
  9. python表白源代码加音乐_python炫酷烟花表白源代码
  10. 谈一谈UNet图像分割