Computers

Octave 2D Pie Chart

Octave 2D Pie Chart

Let’s learn about the Octave 2D pie chart command. To plot a 2-D pie chart we can use the pie command.

Syntax

>> pie(x)

>> pie(x,[options])

Script

In this example, we will generate a sample 2D pie chart for monthly rainfall data.

% Octave pie Chart Demo
% Octave Tutorials – www.TestingDocs.com

clear all;
clf;

% Generate pie chart
pie ([2, 23, 5]);
% Add Title
title(‘2D Pie Demo Chart – www.TestingDocs.com’);
% Add legend
legend(‘Cloudy’,’Sunny’,’Rainfall’);

Octave 2D pie chart

2D pie chart

2D pie chart Output

—

Octave Tutorials

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