O'Reilly logo

MATLAB Graphics and Data Visualization Cookbook by Swapnonil Banerjee, Nivedita Majumdar

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Bringing order to chaos with legends

As graphics increase in complexity, it is common to use additional symbols, line styles, color, and such others to code for different layers of information. Figure legends help sort out this madness. Sometimes there are too many variables to code and the program needs to use clever combinations to code for the additional layers of information. This recipe demonstrates how the legend command from MATLAB helps to build legends of your choice. Furthermore, it shows how to make your own legends to accommodate a special need.

Getting ready

This recipe plots a set of ten normal distributions with different parameters.

load 10NormalDistributions

How to do it...

Perform the following steps:

  1. Plot the data with basic labeling: ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required