Book Image

Mastering Julia

Book Image

Mastering Julia

Overview of this book

Table of Contents (17 chapters)
Mastering Julia
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Basic graphics in Julia


We have already encountered some graphics in the previous chapters of this book, both text plots and two-dimensional graphics using modules such as ASCIIPlots and Winston. In this section, we are going to look a little further into these and similar packages.

Text plotting

In Chapter 1, The Julia Environment, we had seen some simple graphics using the ASCII plots package.

This has largely been replaced with a second package, the TextPlots package. While it does not provide sophisticated visualization, it is worth a look as it is very lightweight and loads quickly, being independent of any graphic libraries or drivers.

The basic call uses a function of a single variable together with an optional range of values for that variable.

The range can be specified in the x0:x1 form or as separate arguments (,,,.x0,x1). If no range is provided, then a default of -10:10 is used.

It is possible to define more than one function, but the display can be confusing.

Consider the following...