2014-04-12 121 views
3

我使用gnuplot(直方圖)繪製一些條形圖。我需要不同的和各種模式來填補酒吧。使用「fs圖案XX」,我可以使用一些圖案,但它們都是一些線條。在gnuplot中用點或其他圖案填充條紋

我需要邊框爲實線(線型1),並且該條由點填充。如果我更改圖案的線型,那麼邊框也會更改。我想保持邊框牢固。

有什麼想法?

+0

要查看所有支持的填充圖案使用'test'命令。 – Christoph

+1

這些模式根本不夠用。應該有更多的模式,不同的密度,線型等。 – Farzad

+0

該評論是說:不,沒有比那些更多的填充模式;) – Christoph

回答

1

我發現它支持點模式中的一個終端:在lua tikz終端:

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

有了這個,你也可以使用自定義的通過覆蓋預定圖案填充圖案:

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

,您必須定義一個自定義模式,如 Custom and built in TikZ fill patterns中所示。

採用黑色邊框和彩色填充圖案是可能的

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

我正在嘗試安裝lua。有一些問題,我無法安裝它並檢查你的答案。 – Farzad

+0

你運行什麼系統? – Christoph

+0

ubuntu 12.04 LTS gnuplot v 4.6.4 – Farzad