This patch adds support for custom dash types to the lua tikz terminal. It also introduces a dashlength terminal option and now the dash patterns scale with the current line width.
The old TikZ styles gp lt plot 0 up to gp lt plot 7 and the corresponding ... add style are kept. They don't do anything, but were also used to hook in from LaTeX.
For testing I used:
set terminal lua tikz standalone
set output 'dashlength-1.tex'
plot x dt 2, 2*x dt 2 lw 5, 3*x dt '.-', 4*x dt '.-' lw 5
set output 'dashlength-0_5.tex'
set termoption dashlength 0.5
replot
set output
system('pdflatex dashlength-1 && pdflatex dashlength-0_5')
It doesn't work for me:
By the way, a lua error totally hoses keyboard input to a gnuplot session. Is there any way to avoid that?
Thanks for the feedback.
I fixed the problem you see, but for some reason the code works fine with my test script which I posted, but not with
dashtypes.dem. I'll try to fix that an then update the patch. So there are some different settings involved when plotting a function or drawing arrows.About the lua error, I have no idea. This patch is my first code written with lua :)
I fixed this. With the attached patch, the
dashtypes.demdemo works fine. I usedThe
sedcommand replaces only a single underscore which would give an error when compiling withpdflatex.What seems strange to me is, that the patch works fine if I use
set terminal lua tikz, but doesn't work when usingset terminal tikz. In the latter case all lines are solid. Don't know what the problem is in this case.Applied. Thanks.
The difference between "set term lua tikz" and "set term tikz" arose because there are two separate TERM_TABLE structures. Your patch only added the new entry point to one of them.