2

I am new to gnuplot. Any help is appreciated :)

I want to use a fill pattern of horizontal lines to shade in a polygon, but this fill pattern does not exist in epslatex terminal. Is there some way I can achieve this (preferably without switching terminals)?

Here's a simple example:

set terminal epslatex size 3.5,2.62  color color text
set output 'fillTest.tex'
set style fill pattern 4
plot 'fillTest.txt' with filledcurves ls 1

where the data is a polygon, for example:

0   0
1   1
1   2
2   2
3   1
2   0

Any ideas of a way to fill with horizontal lines in epslatex? Thanks!

penrose
  • 21
  • 3
  • If changing to `tikz` is an option, have a look at http://stackoverflow.com/a/23034300/2604213 – Christoph Aug 03 '15 at 20:25
  • That's definitely a possiblity. I will look into it, but it may take me some time to figure out. Thanks for your response! – penrose Aug 05 '15 at 07:26
  • Alternative you must adapt gnuplot's `prologue.ps` file, and e.g. the definition of `/Pat7` – Christoph Aug 05 '15 at 10:26
  • That seems like a good idea! I am looking in the prologue.ps file. Do you know which part of file I can change to set angle of lines? – penrose Aug 06 '15 at 12:43
  • I would still like to change the prologue.ps file if anyone knows how to do this!!! – penrose Sep 21 '15 at 14:27
  • @penrose just in case, there is a rather complicated way creating custom hatch lines. Requires gnuplot>=5.2.0, see https://stackoverflow.com/a/63471784/7295599 – theozh May 24 '22 at 08:55

0 Answers0