« Return to Thread: Conditional plotting

Re: Conditional plotting

by Thomas Sefzick :: Rate this Message:

Reply to Author | View in Thread

please post a few lines of your data file.


Thomas Sefzick wrote:
please provide some more information:
 - what do you mean by 'isn't working'?
plot "$1ind" using 1:2:3:4:5 notitle with candlesticks lt 7, \  - plots candlesticks as expected
"$1ind" using 1:($23<0?$53:1/0) notitle with line lt 3, \ - plots nothing at all
"$1ind" using 1:($23>0?$54:1/0) notitle with line lt 1 - plots a continuous line with a zero value

 - how does the data file look like (post some lines as example)?
column 1 consists of dates in the format 29/5/2009
column 23 consists of numbers ranging between -10 and 10
columns 53 and 54 consist of values that are the same as the highs(53) and lows(54) of the candlestick plot
 
- do you expect the plotted lines to have a gaps where the data
   are undefined (that's what gnuplot does) or do you want data
   points to be connected over undefined regions?
I expect/would like to plot data in column 53 when the data in column 23 is less than zero    
I expect/would like to plot data in column 54 when the data in column 23 is greater than zero
and when these conditions are not true the data in columns 53 and 54 should not be plotted i.e. there
should be gaps in the plots.

Essentially what I am trying to do is plot a stock chart with lines plotted at the highs and lows of the stock price over certain defined periods only.

 « Return to Thread: Conditional plotting