Re: mixing histogram with lines?
- From: Michael Kopp <michael.kopp@xxxxxx>
- Date: Wed, 03 Dec 2008 16:27:38 +0100
Hello,
I managed to use histogram with gnuplot, and now I came across a
plotting problem that I almost gave in.
Here's a data set like
"method A" "method B" "method C"
Total 6.641302e-002 8.061306e-002 2.705582e-001
Iteration 2.172000e+002 1.850000e+002 1.690000e+002
and I'd like to use histogram to show 'Total' and lines to show
'Iteration'. So, the plot I'd like to draw is gonna be a mix of
histogram and lines. I've searched to find out some similar examples to
get some idea of how to draw it and tried a couple of things, but
nothing worked out well. Now I'm a bit skeptical the plot I wanted
might not be possible with gnuplot. :(
I'd like to get any advice from gnuplot users to address my problem.
I'd appreiciate it if someone would help me for this plotting problem.
Thank you in adv.
I am not sure I understood exactly what you want, but I'll give it a try. The basic way to plot different datasets in a single graph is to just enumerate the plot commands:
plot data1 with boxes, data2 with lines, data3 with points ...
(This is just to illustrate the principle. For the example to work, data1-3 are need to be defined as variables containing the names of input files.)
To plot your data, I would do something like this:
------------------------------------------------------
reset
unset multiplot
set xtics ("Method A" 0, "Method B" 1, "Method C" 2)
set xtics out nomirror
set ytics out nomirror
set y2tics out nomirror
set xrange [-1:3]
set yrange [0:0.4]
set y2range [100:250]
set ylabel "Total"
set y2label "Iteration"
plot '-' w boxes title "Total", '-' w lines axes x1y2 title "Iteration"
6.641302e-002
8.061306e-002
2.705582e-001
e
2.172000e+002
1.850000e+002
1.690000e+002
e
------------------------------------------------------
Here, the '-' indicates that inline data are to be used, which are given at the end of the plot command. Note that I used the y2 axis for the Iteration data set, because the numbers there are much larger than for Total.
HTH,
Michael.
.
- Follow-Ups:
- Re: mixing histogram with lines?
- From: K. Lee
- Re: mixing histogram with lines?
- References:
- mixing histogram with lines?
- From: Kyunghoon Lee
- mixing histogram with lines?
- Prev by Date: Re: offset bug?
- Next by Date: Re: Problems with fillcurves to x and y axes
- Previous by thread: mixing histogram with lines?
- Next by thread: Re: mixing histogram with lines?
- Index(es):
Relevant Pages
|
Loading