Display a shifted grid

9 ビュー (過去 30 日間)
MaHa
MaHa 2020 年 9 月 7 日
コメント済み: Star Strider 2020 年 9 月 8 日
Hello, I would like to show the grid at a specific position using and imagesc plot.
The
grid on
is associated with thick ticks positions. I would like it to be shown at a specific position, for exeample thick tick places + offset. Rather than 1 2 3 .. it would be 1.5, 2.5 3.5 etc for example. I do not want to change the xtick axis as it is shown in the help here.
I tried the gridxy function, which has the option of the position, but it doesn't show the grid where it is not empty (I see it where I have empty data only).
Any idea ? I am using R2019a.
Cheers

採用された回答

Star Strider
Star Strider 2020 年 9 月 7 日
I am not certain what you want.
Try this:
x = 1:0.1:10; % Create Data
y = rand(size(x)); % Create Data
figure
imagesc(x, y, y)
grid
Ax = gca; % Axis Handle
xt = Ax.XTick; % Get Current ‘XTick’ vector
Ax.XTick = xt + 0.5; % Create New ‘XTick’ Vector
.
  6 件のコメント
MaHa
MaHa 2020 年 9 月 8 日
Thanks
Star Strider
Star Strider 2020 年 9 月 8 日
As always, my pleasure!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGraphics Performance についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by