I am trying to have two data series plotted in one graph as boxes in gnuplot. The script looks like this currently:
set terminal postscript eps enhanced color
set title "Distribution of the extrepreneur PnL. Loan $6."
set output 'pnl_loan6.eps'
#set xrange [0:]
set xlabel "Discounted profit"
set style fill solid 0.8 border -1
plot 'pnl_loan6.txt' using 1:2 title 'PnL high risk (xi=1)' with boxes,\
'pnl_loan6.txt' using 1:3 title 'PnL high risk (xi=1.5)' with boxes
however the two series overlap. Instead of the overlap I would like to have one series draw its box in the left half of the existing box, and the other one in the right half, so that they effectively alternate. How can I do it?
EDIT:
Data:
-10.000000 20251.000000 31825.000000
-4.892638 26743.000000 21310.000000
0.214725 20362.000000 14590.000000
5.322087 13023.000000 9645.000000
10.429449 7730.000000 6347.000000
15.536812 4636.000000 4331.000000
20.644174 2714.000000 2964.000000
25.751536 1647.000000 2121.000000
30.858899 1044.000000 1586.000000
35.966261 648.000000 1106.000000
41.073624 396.000000 873.000000
46.180986 257.000000 685.000000
51.288348 166.000000 471.000000
56.395711 101.000000 369.000000
61.503073 83.000000 321.000000
66.610435 52.000000 260.000000
71.717798 40.000000 184.000000
76.825160 30.000000 172.000000
81.932522 21.000000 143.000000
87.039885 11.000000 116.000000
I am not really sure what you are after but maybe this little hackerish approach will do the trick:
set style fill solid 0.8 border -1
set boxwidth 0.5 relative
plot 'pnl_loan6.txt' using ($1+1.27684075):2 title 'PnL high risk (xi=1)' with boxes,\
'pnl_loan6.txt' using ($1-1.27684075):3 title 'PnL high risk (xi=1.5)' with boxes
The difference to your script is
Anyhow this is the resulting plot:
PS:
You might want to think about a logarithmic scaling on the y-axis with set logscale y
which would result in this plot:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With