TestingDocs.com
Software Testing website
  • Automation
    • Selenium
    • JBehave Framework
  • Tutorials
    • MySQL Tutorials
    • Testlink
    • Maven
    • Git
  • IDEs
    • IntelliJ IDEA
    • Eclipse
  • Flowcharts
    • Flowgorithm
    • Raptor
  • About

Octave

Three-dimensional plots using Octave

Overview

In this tutorial, we will learn how to produce a three-dimensional plot using Octave. Octave has the capability to plot data in both 2D and 3D.

Octave 2D Plots:

https://www.testingdocs.com/two-dimensional-plot-using-octave/

Three-dimensional plot

The 3D plot has three axes i.e x-axis, the y-axis, and the z-axis. The basic 3D plot function in Octave is the plot3 command.

Syntax

plot(x,y,z);

x,y and z are vectors that represent the (x,y,z) coordinates in the three dimensions.

There are several 3D plot functions available in Octave. Some of the functions are as follows:

  • ezplot3
  • bar3
  • pie3
  • surf

plot3 is a three-dimensional line plot. To plot surfaces, we can use the surface plot surf command.

Example

Let’s plot a 3D line plot using the plot3 command.

Octave Script

% plot3 command Demo
% Octave Tutorials – www.TestingDocs.com
clf;
% Generate z, x, y vectors
z = [0:0.05:10];
x = cos (2*pi*z);
y = sin (2*pi*z);
plot3 (x,y,z);
xlabel(‘x-axis’);
ylabel(‘y-axis’);
zlabel(‘z-axis’);
title (“plot3() demo of a Helix – www.TestingDocs.com”);

 

Three-Dimensional Plots Octave

Output

Octave plot3 command

—

Octave Tutorials

Octave Tutorial on this website can be found at:
https://www.testingdocs.com/octave-tutorial/

More information on Octave can be found on the official website:
https://www.gnu.org/software/octave/index

Related Posts

Octave Package List

Octave /

Install Octave Packages on Linux

Octave /

Octave User defined Function Example

octave command line linux

Octave /

Octave Command line on Ubuntu

Hello World in Octave

Octave /

Hello World in Octave

Octave /

Octave plot example of function y=x^2

‹ Octave subplot command› Octave plot3 command

Recent Posts

  • Update draw.io on Windows
  • Install RAPTOR Avalonia on CentOS
  • Download RAPTOR Avalonia Edition on Windows
  • npm doctor command
  • Build & Run CLion Project
  • Create New CLion C Project on Windows
  • Configure CLion Toolchains on Windows
  • Launch CLion IDE on Windows
  • Activate CLion IDE
  • CLion IDE for C/C++ Development

Back to Top

Links

  • Contact
  • Privacy Policy
  • Cookie Policy

www.TestingDocs.com