I’m plotting some data curves with gnuplot, and they look like this:

However, the line samples in the legend are too thin. When you have more curves, it becomes hard to distinguish the colors. You can increase the thickness of the curves using “linewidth”, e.g., by adding “lw 3” to the plot command, and you’d get this:

However, this increases the thickness everywhere. Is it possible to make the lines thick in the legend only? I know it can be done “the other way”, by postprocessing on the output .png file. But is there a direct approach, using some gnuplot setting/wizardry?
Unfortunately, I don’t know a way to control the thickness of the lines in the key, since they correspond to the lines being drawn. You can see what you can change by typing
help set keyin gnuplot.Using multiplot, you can draw the plot lines first without the key, then draw the key again for ‘ghost lines’. Here is a code sample which would do that:
In the second plot command, the function 2 (a constant) is being plotted with a y range of 0 to 1, so it doesn’t show up.