用点或其他图案填充gnuplot中的条 [英] Fill bars in gnuplot with dots or other patterns
问题描述
我正在使用gnuplot(直方图)绘制一些条形图.我需要各种不同的模式来填补这些障碍.使用"fs pattern XX",我可以使用一些模式,但是它们都是一些行.
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.
我需要边框为实线(线型1),并且条形图由点填充.如果更改图案的线型,则边框也将更改.我想保持边界牢固.
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.
有什么主意吗?
推荐答案
我发现了一个支持虚线模式的终端:lua tikz
终端:
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')
与此同时,您还可以通过覆盖预定义的图案来使用自定义填充图案:
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}}'
,并且您必须定义一个自定义模式,如下所示 自定义和内置的TikZ填充模式.
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
这篇关于用点或其他图案填充gnuplot中的条的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!