Gnuplot: how to fill a panel with both a color background and a pattern

I want to fill the panel with both colors and a pattern. Is this possible in Gnuplot?

I am using Gnuplot 4.6.5

The code I have is:

# set terminal pngcairo  transparent enhanced font "arial,10" fontscale 1.0 size 500, 350 
# set output 'histograms.2.png'
set boxwidth 0.9 absolute
set style fill   solid 1.00 border lt -1
set key inside right top vertical Right noreverse noenhanced autotitles nobox
set style histogram clustered gap 1 title  offset character 0, 0, 0
set datafile missing '-'
set style data histograms
set xtics border in scale 0,0 nomirror rotate by -45  offset character 0, 0, 0 autojustify
set xtics  norangelimit font ",8"
set xtics   ()
set title "US immigration from Northern Europe\nPlot selected data columns as histogram of clustered boxes" 
i = 22
set yrange [0:2000]
set style line 1 lc rgb 'orange';
set style line 2 lc rgb 'pink';
plot for [i=2:7] 'data.dat' using i:xtic(1) ti col ls i%2+1;

Data file:

Region  Denmark France Demark-Women France-women Demark-man France-men
1891-1900   1000 1100   500 600 500 500
1901-1910   1500 1600   1000 600 500 1000

Here are the links to download the script: https://dl.dropboxusercontent.com/u/45318932/histograms2.plt and the data file: https://dl.dropboxusercontent.com/u/45318932/data.dat

The script gives me:

enter image description here

I want to:

enter image description here

It would be very appreciated if someone could help me improve the code for creating the second shape. Thank.

+4
source share
1 answer

, . , .

, , lua tikz. , . , newhistogram, , , .

, sed. , :

set terminal lua tikz standalone size 5in, 3in color
set output '| sed ''s/\\gpfill{color=gpbgfillcolor}//g'' > histograms.tex'
set boxwidth 0.9 absolute
set style fill   solid 1.00 border lt -1
set key inside right top vertical Right noreverse noenhanced autotitles nobox
set style histogram clustered gap 1 title  offset character 0, 0, 0
set datafile missing '-'
set style data histograms
set xtics border in scale 0,0 nomirror rotate by -45  offset character 0, 0, 0 autojustify
set xtics  norangelimit font ",8"
set xtics   ()
set title "US immigration from Northern Europe\nPlot selected data columns as histogram of clustered boxes" 
i = 22
set yrange [0:2000]
set xrange [-1:2]
set style line 1 lc rgb 'orange';
set style line 2 lc rgb 'pink';
plot for [i=2:7] 'data.dat' using i:xtic(1) ti columnhead(i > 3 ? 10 : i) ls i%2+1 fillstyle solid noborder,\
     newhistogram at -1, \
     '' using 2 ti 'total' lt -1 fillstyle empty,\
     '' using 3 notitle lt -1 fillstyle empty,\
     '' using 4 title 'women' lt -1 fillstyle pattern 5,\
     '' using 5 notitle lt -1 fillstyle pattern 5,\
     '' using 6 title 'men' lt -1 fillstyle pattern 6,\
     '' using 7 notitle lt -1 fillstyle pattern 6

set output
system('pdflatex histograms.tex')

4.6.5:

enter image description here

, , ,

... fillstyle pattern 6 transparent

, , gnuplot:

plot x with filledcurves x1 fillstyle solid fc rgb '#990000',\
     x with filledcurves x1 fillstyle pattern 4 transparent lc rgb 'white'

( svg- 4.6.5):

enter image description here

+9
source

All Articles