フィルターのクリア

how can i plot axis with origin at a random point other than (0,0) as origin

2 ビュー (過去 30 日間)
Tasneem Tabassum
Tasneem Tabassum 2017 年 3 月 15 日
コメント済み: Tasneem Tabassum 2017 年 3 月 18 日
hi, i wanted to draw axis at a point in my plot say (98, 107) as origin. how can i do it in matlab i use matlab 2013a.
  2 件のコメント
Image Analyst
Image Analyst 2017 年 3 月 15 日
I'm not sure what that means. The origin is always at (0,0). Do you want the axes to be at some particular location, like in the middle of plot instead of outside at the lower left?
Tasneem Tabassum
Tasneem Tabassum 2017 年 3 月 17 日
i want the axes to be at point other than bottom , left or top right or at origin. i want to plot the axes at say xaxis=107 nad yaxis=98 so the axes centre or intersection points will be at (98,107)

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

回答 (2 件)

Honglei Chen
Honglei Chen 2017 年 3 月 15 日
Here is an example
plot(0:9,0:9);
set(gca,'XTickLabel',get(gca,'XTick')+98);
set(gca,'YTickLabel',get(gca,'YTick')+107);
HTH

Image Analyst
Image Analyst 2017 年 3 月 17 日
Maybe you want something like this:
% Setup - generate some random sample data.
numPoints = 50;
x = linspace(95, 105, numPoints);
y = 107 + 8 * rand(1, numPoints);
% Plot the data.
plot(x, y, 'b-');
grid on;
% Add axes going through (98,108)
xl = xlim;
yl = ylim;
hold on;
line([98, 98], yl, 'Color', 'k', 'LineWidth', 3);
line(xl, [108, 108], 'Color', 'k', 'LineWidth', 3);
If not, then upload a picture of what you want.

カテゴリ

Help Center および File ExchangeLine Plots についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by