Hatchfill

バージョン 1.11.0.0 (55.1 KB) 作成者: Neil Tandon
Fills an area with hatching or speckling.
ダウンロード: 16.1K
更新 2012/12/19

ライセンスの表示

編集メモ: This file was selected as MATLAB Central Pick of the Week

In MATLAB, there are many functions that create regions filled with solid colors (e.g. contourf, area, bar). To do this, a function creates "patch objects" and assigns a single color to each one. Instead of a solid fill, one often wants to fill a patch with a hatch or speckle pattern instead. MATLAB has no built-in way to do this.

The hatchfill function fills patch objects with hatching or speckling. In most cases, adding hatching to a 2D plot requires only three lines of code. For example:

[c,h] = contourf(x,y,z,[0 0]);
hp = findobj(h,'type','patch');
hatchfill(hp);

This fills the zero contour with hatching. Hatchfill takes additional parameters if custom patterns are desired. This package incorporates code from Rich Pawlowicz, Iram Weinstein, and Kirill Pankratov.

引用

Neil Tandon (2024). Hatchfill (https://www.mathworks.com/matlabcentral/fileexchange/30733-hatchfill), MATLAB Central File Exchange. 取得済み .

MATLAB リリースの互換性
作成: R2010b
すべてのリリースと互換性あり
プラットフォームの互換性
Windows macOS Linux
カテゴリ
Help Center および MATLAB AnswersSurfaces, Volumes, and Polygons についてさらに検索
謝辞

ヒントを得たファイル: hatch.m

ヒントを与えたファイル: kristinbranson/JAABA, stipple, Hatchfill2

Community Treasure Hunt

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

Start Hunting!
バージョン 公開済み リリース ノート
1.11.0.0

Added additional check for axes that are only one level up. (Suggested by Dan K.)

1.10.0.0

Consolidated code into single file.

1.9.0.0

Simplified code.

1.7.0.0

Updated description.

1.6.0.0

Fixed bug reported by Dmytro Lituiev.

1.5.0.0

Updated description

1.4.0.0

Minor bug fix.

1.3.0.0

Now is compatible with logarithmic axes.

1.2.0.0

Polished the examples/documentation a little.

1.1.0.0

A little housecleaning...

1.0.0.0