gridcolor

버전 1.3.0.0 (31.9 KB) 작성자: Sebastian Hölz
Change color of grid lines without changing color of axis labels or box
다운로드 수: 5.2K
업데이트 날짜: 2009/6/10

라이선스 보기

Use this function to change the color of gridlines to a color different to the label and box color, which is currently not implemented in Matlab.
-> http://www.mathworks.com/support/solutions/data/1-1PAYMC.html?solution=1-1PAYMC)

The general syntax for a call is:

gridcolor([ax1, ax2, ...], c_x, c_y, c_z)

Here ax1, ... are handles to existing axes (optional argument) and c_xyz are color specifications (e.g. 'r' or [1 0 0], also optional). If no axis handle is supplied, the call goes to the current axis (gca), if no color is supplied a standard color, which is defined in the first executable line of the file, is used.
The function should be called after the plot has been created and the grid has been turned on.

Example:
plot(1,1)
grid on
gridcolor([1 0 0], 'b')

This function is no longer tested for Matlab 6.5 or lower and will most likely not work for these versions. It should run on Matlab 7.0 or higher.

For further examples please refer to the examples in the header of the file.

Cheers
Sebi

PS.: I have included some lines from Yair Altmans "PropListener" example

인용 양식

Sebastian Hölz (2025). gridcolor (https://kr.mathworks.com/matlabcentral/fileexchange/9815-gridcolor), MATLAB Central File Exchange. 검색 날짜: .

MATLAB 릴리스 호환 정보
개발 환경: R14SP2
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Grid Lines, Tick Values, and Labels에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!
버전 게시됨 릴리스 정보
1.3.0.0

Version 0.99
- No support for Matlab 6.5 or lower anymore
- Should now work as general purpose functions without restrictions
- Removed some bugs

1.1.0.0

09.01.2009 Fixed bug found by Christian S. Hansen. This prevented the axis and labels to be displayed correctly.

1.0.0.0

Found another small bug ...