Documentation

This is machine translation

Translated by Microsoft
Mouse over text to see original. Click the button below to return to the English verison of the page.

라이선스가 부여된 사용자만 번역 문서를 볼 수 있습니다. 번역 문서를 보려면 로그인하십시오.

semilogx

Semilogarithmic plot

Syntax

semilogx(Y)
semilogx(X1,Y1,...)
semilogx(X1,Y1,LineSpec,...)
semilogx(...,'PropertyName',PropertyValue,...)
semilogx(ax,...)
h = semilogx(...)

Description

semilogx plot data as logarithmic scales for the x-axis.

semilogx(Y) creates a plot using a base 10 logarithmic scale for the x-axis and a linear scale for the y-axis. It plots the columns of Y versus their index. The values in Y can be numeric or datetime or duration values. If Y contains complex values, then semilogx(Y) is equivalent to semilogx(real(Y),imag(Y)). The semilogx function ignores the imaginary component in all other uses of this function.

semilogx(X1,Y1,...) plots all Yn versus Xn pairs. If only one of Xn or Yn is a matrix, semilogx plots the vector argument versus the rows or columns of the matrix, along the dimension of the matrix whose length matches the length of the vector. If the matrix is square, its columns plot against the vector if their lengths match. The values in Yn can be numeric or datetime or duration values. The values in Xn must be numeric.

semilogx(X1,Y1,LineSpec,...) plots all lines defined by the Xn,Yn,LineSpec triples. LineSpec determines line style, marker symbol, and color of the plotted lines.

semilogx(...,'PropertyName',PropertyValue,...) sets property values for all charting lines created by semilogx. For a list of properties, see Chart Line Properties.

semilogx(ax,...) creates the line in the axes specified by ax instead of in the current axes (gca). The option ax can precede any of the input argument combinations in the previous syntaxes.

h = semilogx(...) return a vector of chart line objects.

Examples

collapse all

Create a plot with a logarithmic scale for the x-axis and a linear scale for the y-axis.

x = 0:1000;
y = log(x);

figure
semilogx(x,y)

More About

collapse all

Tips

If you do not specify a color when plotting more than one line, semilogx automatically cycle through the colors and line styles in the order specified by the current axes ColorOrder and LineStyleOrder properties.

You can mix Xn,Yn pairs with Xn,Yn,LineSpec triples; for example,

semilogx(X1,Y1,X2,Y2,LineSpec,X3,Y3)

If you attempt to add a loglog, semilogx, or semilogy plot to a linear axis mode graph with hold on, the axis mode remains as it is and the new data plots as linear.

See Also

Functions

Properties

Introduced before R2006a

Was this topic helpful?