This is machine translation

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

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.


Semilogarithmic plot


h = semilogy(...)


semilogy plots data with logarithmic scale for the y-axis.

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

semilogy(X1,Y1,...) plots all Yn versus Xn pairs. If only one of Xn or Yn is a matrix, semilogy 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 Xn can be numeric, datetime, duration, or categorical values. The values in Yn must be numeric.

semilogy(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.

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

semilogy(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 = semilogy(...) returns a vector of chart line objects.


collapse all

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

x = 0:0.1:10;
y = exp(x);



If you do not specify a color when plotting more than one line, 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,


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.

Introduced before R2006a

Was this topic helpful?