4
votes

I'm drawing some bar charts using gnuplot (histogram). I need different and various patterns to fill the bars. Using "fs pattern XX", I can use some patterns, but they are all some lines.

I need the border to be solid line (linetype 1), and the bar be filled by dots. If I change the linetype of pattern, then the border is changed as well. I want to keep the border solid.

Any idea?

1
To see all supported fill patterns use the test command. - Christoph
These patterns are not enough at all. There should be more pattern with a diverse density, linetypes and etc. - Farzad
That comment was to say: no, there aren't more fill patterns than those ;) - Christoph
But I just find a sample in one paper. dropbox.com/s/68st6u9axtyajw7/dot.png - Farzad

1 Answers

1
votes

I found one terminal which supports dotted patterns: the lua tikz terminal:

set terminal lua tikz standalone
set output 'dot-pattern.tex'

set boxwidth 0.8 relative
set samples 10
unset key
set yrange [0:11]

plot '+' using 1:($0+1) with boxes lt -1 lw 2 lc rgb '#990000' fillstyle pattern 8
set output
system('pdflatex dot-pattern.tex')

enter image description here

With this you could also use custom fill patterns by overwriting a predefined pattern:

set terminal lua tikz standalone header '\tikzset{gp pattern 8/.style={pattern=mypatterh}}'

and you must define a custom pattern, like shown in Custom and built in TikZ fill patterns.

Using black borders and colored fill pattern is possible with

plot '+' using 1:($0+1) with boxes lc rgb '#990000' fillstyle pattern 8 noborder,\
     '+' using 1:($0+1) with boxes lt -1 lw 2