If you try
set term jpeg
set out "1.jpg"
plot sin(x) w l dt 2
unset out
it will plot with solid line, which is not dt 2 but dt 1; However, if you set term win for example, it will correctly plot with dashed lines type 2. I've tried dt3 and others, but it always plots with dt 1
This is due to a missing upstream feature. The libgd graphics support library does not currently support dot/dash patterns. Therefore the gnuplot terminal types that depend on libgd (png jpeg gif sixel) do not currently support dashtype as a line property.
This is documented in the configuration and installation instructions, but yes it should probably be more clearly stated somewhere in the individual terminal "help" sections.
Suggested alternative:
set term pngcairo
I just started looking into this, so I am by no means a libgd expert. Isn't gdImageSetStyle (or possibly gdImageSetBrush) enough to implement dashed lines. From what I have read gdImageSetStyle is the preferred option to draw dashed lines (since gdImageDashedLine was deprecated although it still seems to be working)
That works adequately for purely horizontal or vertical lines, but fails badly for diagonal or curved lines. Don't believe what you read - try it.
I did actually try it but you are absolutely right: My test went as far as diagonal lines (which still works well by the way) but I would not know how to do curved lines without having to fall back to straight line dashes (which for most cases would not look acceptable). Thanks for the quick reply!