Skip to content

Commit

Permalink
Wrap legend entries to allow for commas (#156)
Browse files Browse the repository at this point in the history
  • Loading branch information
mossr committed Sep 28, 2020
1 parent 08d87b1 commit 8271ffd
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/PGFPlots.jl
Expand Up @@ -703,8 +703,7 @@ function plotHelper(o::IO, axis::Axis)
legendentries = vcat(legendentries...) # flatten
# avoid adding \legend altogether if all entries are `nothing`
if !all(legendentries .=== nothing)
legendentries = replace(legendentries, nothing=>"") # for correct printing
legendcontent = join(legendentries, ',')
legendcontent = join(map(x->x === nothing ? "" : "{}{$x}", legendentries), ", ")
println(o, "\\legend{$legendcontent}") # add legend
end
end
Expand Down

0 comments on commit 8271ffd

Please sign in to comment.