Closed iblislin closed 4 years ago
I am not sure we should provide Julia equivalents to LaTeX commands which are
not specific to PGFPlots,
very simple to generate as text.
I need it in TikzPicture
in order to manipulate legends later.
e.g.
TikzPicture(
Axis(
{...},
PlotInc(
{...},
Table(...)
),
Label("line 1"),
),
)
Here is part of my code, I use this to create double y-axes:
struct LegendImage2
s::String
end
function PGFPlotsX.print_tex(io::IO, l::LegendImage2)
print(io, "\\addlegendimage{", l.s, "}")
end
TikzPicture(
Axis(
{...},
PlotInc(
{...},
Table(...)
),
Label("line1"),
),
Axis(
{...},
LegendImage2("/pgfplots/refstyle=line1"),
LegendEntry("line1"),
)
)
output:
I may be missing something, but I think you can still just emit this as LaTeX code.
Or define your own types and print_tex
for them (like LegendImage2
above), this is a fine approach.
Yeah, defining them is quite easy.
Oh, since it's too easy to generate via raw
str, we don't want it in PGFPlotsX, right?
Yes, I don't think LaTeX commands like \label
should be handled with a wrapper. Where would we stop?
:ok_hand:
Codecov Report
90.47% <ø> (ø)
92.73% <0%> (-0.53%)
Continue to review full report at Codecov.