plotpoint.m

来自「MATLAB Functions for Multiple View Geome」· M 代码 · 共 46 行

M
46
字号
% PLOTPOINT - Plots point with specified mark and optional text label.%% Function to plot 2D points with an optionally specified% marker and optional text label.%% Usage:%          plotPoint(p)             where p is a 2D point%          plotPoint(p, 'mark')     where mark is say 'r+' or 'g*' etc%          plotPoint(p, 'mark', 'text') %%  Peter Kovesi%  School of Computer Science & Software Engineering%  The University of Western Australia%  pk @ csse uwa edu au%  http://www.csse.uwa.edu.au/~pk%%  April    2000%  November 2006  Typo in setting 'mk' fixed, text offset relative to point improved.function plotPoint(p, mark, txt)hold onmk = 'r+';     % Default mark is a red +if nargin >= 2  mk = mark;endplot(p(1), p(2), mk);if nargin == 3    % Print text next to point - calculate an appropriate amount to offset    % the text from the point.    xlim = get(gca,'Xlim');    ylim = get(gca,'Ylim');        offset = min((xlim(2)-xlim(1)),(ylim(2)-ylim(1)))/50;        text(p(1)+offset,p(2)-offset,txt,'Color',mk(1)); end

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?