matlab - Label the actual data points in y-axis [MATLAB]
问题描述
I have a plot with two plotting by using yyaxis
. The grid on the right yyaxis
is currently aligned with the left yyaxis
according to this. Now I want to also label the actual data points on the right yyaxis
. How can I achieve this as illustrated in the following image?
解决方案
You can use the axes YTick
and YTickLabel
properties. You would just need to be sure that the active side is the right one.
In your example, adding these lines would do the trick:
yyaxis('right');
set(gca,'YTick',[0, 2, 2.8, 5.6, 7, 8.4, 11, 11.2, 14]);
推荐阅读
- r - 使用 MLR 的基准实验:LASSO 没有相关系数(但对于 SVR 和随机森林)
- r - 在列表的列中查找特定值
- scala - Spark:如何并行化每个数据帧分区上的后续特定工作
- c# - SQLite 给出自动索引警告,即使键是显式索引中的第一个键
- oracle11g - Oracle WITH 子句创建表耗时过长
- powershell - 将用户添加到多个主机上的远程管理组
- ssis - 如何记录使用 SSIS 中的排序功能删除的重复行?
- sql-server - 按不同列(包括时差)分组的查询
- arrays - x位置中n个字符的置换算法
- c++ - Cuda:访问冲突写入位置0x0000000000000000