semilogx, semilogy - Semilogarithmic plots

GUI Alternatives

To graph selected variables, use the Plot Selector in the Workspace Browser, or use the Figure Palette Plot Catalog. Manipulate graphs in plot edit mode with the Property Editor. For details, see Plotting Tools — Interactive Plotting in the MATLAB Graphics documentation and Creating Graphics from the Workspace Browser in the MATLAB Desktop Tools documentation.

Syntax

semilogx(Y)
semilogy(...)
semilogx(X1,Y1,...)
semilogx(X1,Y1,LineSpec,...)
semilogx(...,'PropertyName',PropertyValue,...)
h = semilogx(...)
h = semilogy(...)
hlines = semilogx('v6',...)

Description

semilogx and semilogy plot data as logarithmic scales for the x- and y-axis, respectively.

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 if Y contains real numbers. semilogx(Y) is equivalent to semilogx(real(Y), imag(Y)) if Y contains complex numbers. semilogx ignores the imaginary component in all other uses of this function.

semilogy(...) creates a plot using a base 10 logarithmic scale for the y-axis and a linear scale for the x-axis.

semilogx(X1,Y1,...) plots all Xn versus Yn pairs. If only Xn or Yn is a matrix, semilogx plots the vector argument versus the rows or columns of the matrix, depending on whether the vector's row or column dimension matches the matrix.

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 lineseries graphics objects created by semilogx.

h = semilogx(...) and h = semilogy(...) return a vector of handles to lineseries graphics objects, one handle per line.

Backward-Compatible Version

hlines = semilogx('v6',...) and hlines = semilogy('v6',...) return the handles to line objects instead of lineseries objects.

See Plot Objects and Backward Compatibility for more information.

Remarks

If you do not specify a color when plotting more than one line, semilogx and semilogy 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 will remain as it is and the new data will plot as linear.

Examples

Create a simple semilogy plot.

x = 0:.1:10;
semilogy(x,10.^x)

See Also

line, LineSpec, loglog, plot

Basic Plots and Graphs for related functions

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS