I have recently upgraded to gnuplot 5 and have been unable to produce dashed lines using the TikZ terminal. Running these commands:
set term tikz
set output "test.tex"
test
produce dashed line types in gnuplot 4.6 (first image), but only solid ones in gnuplot 5 (second image). Is there a way to fix this without downgrading?
I have tried setting different values for the dashlength
terminal option, but that didn't help.
PGF/TikZ provides a convenient mechanism for plotting functions using GNUPLOT . To run this example for the first time you have to do the following: GNUPLOT must be installed on your system. Try typing gnuplot on the command line to see if it's installed.
Try typing gnuplot on the command line to see if it's installed. Windows users may have to rename wgnuplot to gnuplot. You must allow TeX to run external programs. The command line option to enable this is usually --shell-escape or --enable-write18 PGF will call GNUPLOT for you and store the data in a file.
@rommel The problem is that set terminal table is deprecated in recent versions of GNUPLOT (from 2005 and newer). You either have to use an old version of GNUPLOT, or install a recent development build of TikZ. On a Mac you have to use fink to install gnuplot.
You could try the GNUPLOT TikZ terminal. You should also check out pgfplots. The development version may have support for 3D-plots. The GNUPLOT TikZ terminal works fantastic!
With 5.0 gnuplot has changed its way to deal with dashed lines. All line types are solid by default, this is what the test
command shows you.
To enable dashed lines, use the new dashtype
keyword, e.g
plot for [i=1:4] i*x dashtype i
That works for all terminals which support dashed lines.
Note, that with dashtype
you can also specify your own dash patterns.
Example script:
set terminal lua tikz linewidth 3 standalone
set output 'dash.tex'
unset key
set linetype 1 dashtype 2
set linetype 2 dashtype '..-'
set linetype 3 dashtype (2,2,4,4,6,6)
plot for [i=1:3] i*x
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With