4:1 ?÷vely to the interval length. % % It looks like this: % % |---| |-----| % | | | | % | | | | % | | | | % (X)------(X)-----------(X) % % where (X) denotes the x-axis offsets of input coordinates. % % In more detail, if (x_i,y_i) and (x_{i+1},y_{i+1}) denote successive % input coordinates, the bar will be placed above the % interval [x_i,x_{i+1}], centered at % % x_i + \pgfkeysvalueof{/pgf/bar interval shift} * (x_{i+1} - x_i) % % with width % % \pgfkeysvalueof{/pgf/bar interval width} * (x_{i+1} - x_i). % % If you have N+1 input points, you will get N bars (one for each % interval). The y_i value of the last bar will be ignored. % % Example: % % \pgfplothandlerybarinterval % \pgfplotxyfile{mytable} \def\pgfplothandlerybarinterval{% \def\pgf@plotstreamstart{% \global\let\pgf@plotstreampoint=\pgf@plot@ybarinterval@handler@first% \global\let\pgf@plotstreamspecial=\pgfutil@gobble% \global\let\pgf@plotstreamend=\pgfplotyzerolevelstreamend% \pgfmathparse{\pgfkeysvalueof{/pgf/bar interval width}}% \xdef\pgfplotbarintervalwidth@{\pgfmathresult}% \pgfmathparse{\pgfkeysvalueof{/pgf/bar interval shift}}% \xdef\pgfplotbarintervalshift@{\pgfmathresult}% \pgfplotyzerolevelstreamstart }% } \def\pgf@plot@ybarinterval@handler@first#1{% \pgf@process{#1}% \xdef\pgf@plot@barinterval@intervalstart{\the\pgf@x}% \xdef\pgf@plot@barinterval@bar{\the\pgf@y}% \global\let\pgf@plotstreampoint=\pgf@plot@ybarinterval@handler% } \def\pgf@plot@ybarinterval@handler#1{% \pgfkeysvalueof{/pgf/at begin bar}% \pgf@process{#1}% \pgf@ya=\pgf@plot@barinterval@bar \xdef\pgf@plot@barinterval@bar{\the\pgf@y}% \pgf@xc=\pgf@plot@barinterval@intervalstart\relax \xdef\pgf@plot@barinterval@intervalstart{\the\pgf@x}% \pgf@xb=\pgf@x \advance\pgf@xb by-\pgf@xc \advance\pgf@xc by\pgfplotbarintervalshift@\pgf@xb \pgf@xb=\pgfplotbarintervalwidth@\pgf@xb \advance\pgf@xc by-.5\pgf@xb% center \begingroup \pgfplotyzerolevelstreamnext \endgroup \pgf@yb=\pgf@x \advance\pgf@ya by-\pgf@yb \pgfpathrectangle {\pgfqpoint{\pgf@xc}{\pgf@yb}}% {\pgfqpoint{\pgf@xb}{\pgf@ya}}% \pgfkeysvalueof{/pgf/at end bar}% } % Like \pgfplothandlerybarinterval but for xbar. \def\pgfplothandlerxbarinterval{% \def\pgf@plotstreamstart{% \global\let\pgf@plotstreampoint=\pgf@plot@xbarinterval@handler@first% \global\let\pgf@plotstreamspecial=\pgfutil@gobble% \global\let\pgf@plotstreamend=\pgfplotxzerolevelstreamend% \pgfmathparse{\pgfkeysvalueof{/pgf/bar interval width}}% \xdef\pgfplotbarintervalwidth@{\pgfmathresult}% \pgfmathparse{\pgfkeysvalueof{/pgf/bar interval shift}}% \xdef\pgfplotbarintervalshift@{\pgfmathresult}% \pgfplotxzerolevelstreamstart }% } \def\pgf@plot@xbarinterval@handler@first#1{% \pgf@process{#1}% \xdef\pgf@plot@barinterval@intervalstart{\the\pgf@y}% \xdef\pgf@plot@barinterval@bar{\the\pgf@x}% \global\let\pgf@plotstreampoint=\pgf@plot@xbarinterval@handler% } \def\pgf@plot@xbarinterval@handler#1{% \pgfkeysvalueof{/pgf/at begin bar}% \pgf@process{#1}% \pgf@ya=\pgf@plot@barinterval@bar \xdef\pgf@plot@barinterval@bar{\the\pgf@x}% \pgf@xc=\pgf@plot@barinterval@intervalstart\relax \xdef\pgf@plot@barinterval@intervalstart{\the\pgf@y}% \pgf@xb=\pgf@y \advance\pgf@xb by-\pgf@xc \advance\pgf@xc by\pgfplotbarintervalshift@\pgf@xb \pgf@xb=\pgfplotbarintervalwidth@\pgf@xb \advance\pgf@xc by-.5\pgf@xb% center \begingroup \pgfplotxzerolevelstreamnext \endgroup \pgf@yb=\pgf@x \advance\pgf@ya by-\pgf@yb \pgfpathrectangle {\pgfqpoint{\pgf@yb}{\pgf@xc}}% {\pgfqpoint{\pgf@ya}{\pgf@xb}}% \pgfkeysvalueof{/pgf/at end bar}% } % This handler is very similar to \pgfplothandlerlineto, but it % produces CONSTANT connected pieces of the form % % x % | % x--- | % | x---- % x-| % % Example: % % \pgfplothandlerconstantlineto % \pgfplotxyfile{mytable} \def\pgfplothandlerconstantlineto{% \def\pgf@plotstreamstart{% \global\let\pgf@plotstreampoint=\pgf@plot@const@line@handler%