@@ -95,9 +95,10 @@ \subsection{Getting the Data Into \TeX{}}
95
95
|\begin {loglogaxis } ... \end {loglogaxis }| environment for logarithmic
96
96
axes).
97
97
98
- Although \PGFPlots {} runs with default options, it accepts keys. Lots
99
- of keys. Typically, you provide all keys which you `` want to have''
100
- in square brackets `` somewhere'' and ignore all other keys.
98
+ Although \PGFPlots {} runs with default options, it accepts option
99
+ keys. Lots of option keys. Typically, you provide all keys which you
100
+ `` want to have'' in square brackets (|[...]|) `` somewhere'' and ignore
101
+ all other keys.
101
102
102
103
Of course, the main difficulty is to get an overview over the available
103
104
keys and to find out how to use them. This reference manual and
@@ -107,27 +108,39 @@ \subsection{Getting the Data Into \TeX{}}
107
108
hopefully jump to a good match from which you can jump to \emph {the }
108
109
reference section (for example about tick labels, tick positions, plot
109
110
handlers, etc.). It is (and will always be) the most reliable source of
110
- detail information about all keys.
111
+ detailed information about all available option keys.
111
112
112
113
Speaking about the reference manual: note that most PDF viewers also
113
114
have a function to `` jump back to the page before you clicked on a
114
115
hyperlink'' (for Acrobat Reader, open the menu View / Toolbars / More
115
116
Tools and activate the `` Previous View'' and `` Next View'' buttons
116
117
which are under `` Page Navigation Toolbar'' ).
117
118
118
- Note that the code listing contains two sets of keys: the first is
119
- after |\begin {axis }[ ... ]| and the second right after
120
- |\addplot [...]|. Note furthermore that the option list after the axis
121
- has been indented: each option is on a separate line, and each line
122
- has a tab stop as first character. This is a good practice. Another
123
- good practice is to place a comma after the last option (in our case,
124
- after the value for |ylabel|). This allows to add more keys easily --
125
- and you won't forget the comma. It does not hurt at all. The second
126
- `` set'' of keys after |\addplot | shows that indentation and trailing
127
- comma a really just a best practice: we simply said |\addplot [blue]|,
128
- meaning that the plot will be placed in blue color, without any plot
129
- |mark|. Of course, once another option would be added here, it would
130
- be best to switch to indentation and trailing comma:
119
+ Note that the code listing contains two sets of option keys: the first
120
+ is after |\begin {axis }| (the keys |title|, |xlabel|, and |ylabel|) and
121
+ the second right after |\addplot | (the single key |blue|). Note,
122
+ too, that the options list after the axis has been indented: each
123
+ option is on a separate line, and each line has a tab stop as first
124
+ character. Formatting code in this way is considered to be good
125
+ practice when more than one key is specified, as it tends to be more
126
+ readable than combining multiple option keys on the same line. It
127
+ also facilitates commenting-out individual options.
128
+
129
+ Another good practice is placing a comma after the last option (in our
130
+ case, after the value for |ylabel|). The trailing comma is effectively
131
+ ignored -- it is not a syntax error, and it does not alter the
132
+ semantic meaning of the options list. Its presence, however, allows
133
+ more option keys to be appended easily in the future -- you won't
134
+ forget the comma.
135
+
136
+ The lack of a trailing comma in the second `` set'' of keys (after
137
+ |\addplot |) demonstrates that it is not strictly necessary to format
138
+ an options list as recommended above. In fact, when there is only one
139
+ option key, it is common to see it included on one line, as shown. In
140
+ our case, we simply said |\addplot [blue]|, meaning that the plot will
141
+ be placed in blue color, without any plot |mark|. If another option
142
+ were to be added, though, it would be best to switch to indentation
143
+ and trailing comma:
131
144
%
132
145
\begin {codeexample }[code only]
133
146
\addplot [
0 commit comments