Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to draw (semi-)logarithmic 3d plots? (Matlab)

I know semilogx and semilogy for 2D plots. There is any equivalent for SURF and MESH?

like image 429
Jader Dias Avatar asked Jan 11 '09 18:01

Jader Dias


People also ask

How do you plot a 3 D graph in Matlab?

plot3( X , Y , Z ) plots coordinates in 3-D space. To plot a set of coordinates connected by line segments, specify X , Y , and Z as vectors of the same length. To plot multiple sets of coordinates on the same set of axes, specify at least one of X , Y , or Z as a matrix and the others as vectors.

What is semi log in Matlab?

semilogx( X , Y ) plots x- and y-coordinates using a base-10 logarithmic scale on the x-axis and a linear scale on the y-axis. To plot a set of coordinates connected by line segments, specify X and Y as vectors of the same length.

How do you plot a semi log graph?

If you want to plot something in semi-log graph, first of all, you need to convert the decimal numbers into log scale. Suppose you are plotting frequency from 100 Hz to 10,000 Hz. Now you need to convert these frequency into log scale like this. Now instead of plotting 100 Hz to 10,000 Hz, plot simply log scale.

How logarithmic plots can be plotted in Matlab explain?

Create a vector of x-coordinates and two vectors of y-coordinates. Plot two lines by passing comma-separated x-y pairs to loglog . Alternatively, you can create the same plot with one x-y pair by specifying y as a matrix: loglog(x,[y1;y2]) .


2 Answers

As stated in the mentioned link, to set all three axes to logarithmic scaling, use

set(gca, 'XScale', 'log', 'YScale', 'log', 'ZScale', 'log')
like image 112
Doubt Avatar answered Sep 18 '22 13:09

Doubt


Have you looked at the XScale, YScale and Zscale axis properties. You can set them to either linear or log. However, to set these properties to log the data needs to be positive. See http://www.mathworks.com/matlabcentral/newsreader/view_thread/239232 for more details.

like image 36
Azim J Avatar answered Sep 20 '22 13:09

Azim J