Skip to content

Commit

Permalink
Clarify the behavior for unknown and incompatible units
Browse files Browse the repository at this point in the history
  • Loading branch information
otronarp committed Aug 10, 2020
1 parent 1b616ec commit dd07ae8
Showing 1 changed file with 25 additions and 23 deletions.
48 changes: 25 additions & 23 deletions chapters/annotations.tex
Expand Up @@ -154,26 +154,6 @@ \subsection{Annotations for Figures}\doublelabel{annotations-for-figures}
form of text markup described in \autoref{text-markup-in-captions} as well as
the variable replacements described in \autoref{variable-replacements}.

\subsubsection{Plot Curves}\doublelabel{plot-curves}
The actual data to plot is specified in the \lstinline!curves! of a \lstinline!Plot!:
\begin{lstlisting}[language=modelica]
record Curve
expression x = time "X coordinate values";
expression y "Y coordinate values";
String legend "Legend";
end Curve;
\end{lstlisting}

The mandatory \lstinline!x! and \lstinline!y! expressions are restricted to be
component references refering to a scalar variable or \lstinline!time!. It
is an error if \lstinline!x! or \lstinline!y! does not designate a scalar variable.

When \lstinline!legend! isn't provided, the tool produces a default based on
\lstinline!x! and/or \lstinline!y!. Providing the empty string as
\lstinline!legend! means that the curve shall be omitted from the plot legend.
Variable replacements, as described in \autoref{variable-replacements}, can be
used in the \lstinline!legend! of \lstinline!Curve!

\subsubsection{Axis Properties}\doublelabel{axis-properties}
Properties may be defined for each \lstinline!Plot! axis:
\begin{lstlisting}[language=modelica]
Expand All @@ -190,15 +170,37 @@ \subsubsection{Axis Properties}\doublelabel{axis-properties}
The Modelica tool is responsible for showing the unit used for values at the
axis tick marks, so the axis \lstinline!label! shall not contain the unit.

If the specified unit is not supported by the tool, or the unit does not
represent a display unit of the plotted variable (for example,
\lstinline!unit="cm"! and variable denotes a mass), the behavior is unspecified.
If a tool does not recognize the \lstinline!unit!, it is recommended to issue a
warning and treat the \lstinline!unit! as if it was not specified.

When an axis label isn't provided, the tool produces a default label. Providing
the empty string as axis label means that no label should be shown. Variable
replacements, as described in \autoref{variable-replacements}, can be used in
the \lstinline!label! of \lstinline!Axis!

\subsubsection{Plot Curves}\doublelabel{plot-curves}
The actual data to plot is specified in the \lstinline!curves! of a \lstinline!Plot!:
\begin{lstlisting}[language=modelica]
record Curve
expression x = time "X coordinate values";
expression y "Y coordinate values";
String legend "Legend";
end Curve;
\end{lstlisting}

The mandatory \lstinline!x! and \lstinline!y! expressions are restricted to be
component references refering to a scalar variable or \lstinline!time!. It
is an error if \lstinline!x! or \lstinline!y! does not designate a scalar variable.
It is an error if the unit of an expression (i.e., a variable's \lstinline!unit!,
or second for \lstinline!time!) is incompatible with the \lstinline!unit! of the
corresponding axis.

When \lstinline!legend! isn't provided, the tool produces a default based on
\lstinline!x! and/or \lstinline!y!. Providing the empty string as
\lstinline!legend! means that the curve shall be omitted from the plot legend.
Variable replacements, as described in \autoref{variable-replacements}, can be
used in the \lstinline!legend! of \lstinline!Curve!

\subsubsection{Variable Replacements}\doublelabel{variable-replacements}
In most places where text for display is defined the final value of a result
variable can be embedded by refering to the variable as
Expand Down

0 comments on commit dd07ae8

Please sign in to comment.