Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
GNU Octave Beginner's Guide

You're reading from  GNU Octave Beginner's Guide

Product type Book
Published in Jun 2011
Publisher Packt
ISBN-13 9781849513326
Pages 280 pages
Edition 1st Edition
Languages
Author (1):
Jesper Schmidt Hansen Jesper Schmidt Hansen
Profile icon Jesper Schmidt Hansen

Table of Contents (15) Chapters

GNU Octave
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Introducing GNU Octave Interacting with Octave: Variables and Operators Working with Octave: Functions and Plotting Rationalizing: Octave Scripts Extensions: Write Your Own Octave Functions Making Your Own Package: A Poisson Equation Solver More Examples: Data Analysis Need for Speed: Optimization and Dynamically Linked Functions Pop quiz - Answers

Time for action - changing the figure properties


  1. 1. Let us try to change the plot of the graph above. First:

octave:61> plot(x, f, "linewidth", 5);
  • This command will create the same plot as above, but here we specify the graph property linewidth to have the value 5 rather than 1.

  1. 2. To set the correct limits on the axis, we use set:

octave:62> set(gca, "xlim", [-5.5 1])
  1. 3. We can also use set to set the line width of the window box and the font size of the numbers on the axes:

octave:63> set(gca, "linewidth", 2)
octave:64> set(gca, "fontsize", 25)
  1. 4. The axes labels are also set by the set function. Here the properties are"xlabel" and"ylabel", and the property value is set using the text function:

octave:65> set(gca, "xlabel", text("string", "x", "fontsize", 25))
octave:66> set(gca, "ylabel", text("string", "f(x)",
"fontsize", 25))
  1. 5. The figure should now look something like the figure below:

Note

Many prefer to use single quotation marks around the property label, for...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}