Skip to content

Commit

Permalink
Fix doctests (silently) broken by #67. (#71)
Browse files Browse the repository at this point in the history
Introduced a mixture of incremental and non-incremental forms, to demo both.
  • Loading branch information
tpapp authored and KristofferC committed Feb 23, 2018
1 parent 621ca5e commit c4c7145
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
9 changes: 5 additions & 4 deletions docs/src/man/options.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ This works well when the options are few and there is only one level of options
```jldoctest p1
julia> c = Coordinates([1, 2, 3], [2, 4, 8]);
julia> p = Plot(c, "very thick", "mark" => "halfcircle");
julia> p = @pgf PlotInc({ "very thick", "mark" => "halfcircle" }, c);
julia> print_tex(p); # print_tex can be used to preview the generated .tex
\addplot+[very thick, mark={halfcircle}]
Expand Down Expand Up @@ -59,7 +59,7 @@ julia> @pgf Plot(
A more complicated example is:

```jldoctest p1
julia> @pgf a = Axis(Plot(c),
julia> @pgf a = Axis(
{
"axis background/.style" =
{
Expand All @@ -68,7 +68,8 @@ julia> @pgf a = Axis(Plot(c),
bottom_color = "white",
},
ymode = "log"
}
},
PlotInc(c)
);
```

Expand Down Expand Up @@ -109,7 +110,7 @@ It is sometimes convenient to set and get options after an object has been creat
```jldoctest
julia> c = Coordinates([1, 2, 3], [2, 4, 8]);
julia> p = Plot(c);
julia> p = PlotInc(c);
julia> p["fill"] = "blue";
Expand Down
17 changes: 9 additions & 8 deletions docs/src/man/structs.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,10 @@ Example:
```jldoctest
julia> x, y, z = [1, 2, 3], [2, 4, 8], [3, 9, 27];
julia> p = @pgf Plot3(Coordinates(x, y, z), { very_thick });
julia> p = @pgf Plot3({ very_thick }, Coordinates(x, y, z));
julia> print_tex(p)
\addplot3+[very thick]
\addplot3[very thick]
coordinates {
(1, 2, 3)
(2, 4, 9)
Expand All @@ -181,11 +181,12 @@ julia> print_tex(p)
Examples:

```jldoctest
julia> @pgf a = Axis( Plot( Expression("x^2")), {
julia> @pgf a = Axis({
xlabel = "x"
ylabel = "y"
title = "Figure"
});
},
PlotInc( Expression("x^2")));
julia> print_tex(a)
\begin{axis}[xlabel={x}, ylabel={y}, title={Figure}]
Expand All @@ -194,7 +195,7 @@ julia> print_tex(a)
;
\end{axis}
julia> push!(a, Plot(Coordinates([1,2], [3,4])));
julia> push!(a, PlotInc(Coordinates([1, 2], [3, 4])));
julia> print_tex(a)
Expand Down Expand Up @@ -281,7 +282,7 @@ A `PolarAxis` plot data on a polar grid.
Example:

```jldoctest
julia> p = PolarAxis( Plot( Coordinates([0, 90, 180, 270], [1, 1, 1, 1])));
julia> p = PolarAxis( PlotInc( Coordinates([0, 90, 180, 270], [1, 1, 1, 1])));
julia> print_tex(p)
\begin{polaraxis}[]
Expand Down Expand Up @@ -314,12 +315,12 @@ A `TikzPicture` can contain multiple `Axis`'s or `GroupPlot`'s.
Example:

```jldoctest
julia> tp = TikzPicture(Axis(Plot(Coordinates([1, 2], [2, 4]))), "scale" => 1.5);
julia> tp = @pgf TikzPicture({ "scale" => 1.5 }, Axis(Plot(Coordinates([1, 2], [2, 4]))));
julia> print_tex(tp)
\begin{tikzpicture}[scale={1.5}]
\begin{axis}[]
\addplot+[]
\addplot[]
coordinates {
(1, 2)
(2, 4)
Expand Down

0 comments on commit c4c7145

Please sign in to comment.