Skip to content

Commit 89b9a3d

Browse files
committed
fix names and labels in scalarplot
1 parent 37a8dee commit 89b9a3d

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

ext/GridVisualizeUnicodePlotsExt.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -346,10 +346,11 @@ function scalarplot!(
346346
func = funcs[ifunc]
347347
grid = grids[ifunc]
348348
coord = grid[Coordinates] * ctx[:gridscale]
349+
name = name = isnothing(ctx[:label]) ? "" : ctx[:label]
349350
if isnothing(plt)
350-
plt = UnicodePlots.lineplot(coord[1, :], func; ylim, xlabel = "x", name = ctx[:label], height = resolution[2], width = resolution[1])
351+
plt = UnicodePlots.lineplot(coord[1, :], func; ylim, xlabel = String(ctx[:xlabel]), name, height = resolution[2], width = resolution[1], title = ctx[:title])
351352
else
352-
UnicodePlots.lineplot!(plt, coord[1, :], func; name = ctx[:label])
353+
UnicodePlots.lineplot!(plt, coord[1, :], func; name)
353354
end
354355
end
355356
ctx[:figure] = plt

0 commit comments

Comments
 (0)