|
From: somesh <som...@gm...> - 2013-01-25 00:00:35
|
Leo Butler wrote > How about > > f(x) = (x >= 0 ? x : 1/abs(x)); > > plot file using 1:(f($2)) .... > > > Leo BBands wrote > That sort of approach is often useful in plotting certain types of > technical analysis indicators. One way I have seen that done is to > pick a pair arbitrary cutoff points near zero. You could try Googling > for John McGinley. He wrote on the subject back in the 1980s. His > solution was to plot a small slice of the chart just above and below > zero with a linear scale. I add a hatch to the region to make the > discontinuity clear. I haven't tried this in gnuplot, but Ethan > Merritt demoed some tricks using the ternary operator that should make > it doable. > > John Bollinger Thanks Leo and John for the ideas! I could do something similar to what I wanted by this: f(x) = (x >= 0 ? log10(x) : log10(1/abs(x))); then combine the following two plots (in linear scale) using multiplot ... set yrange [0:4] plot file using 1:(f($2)) set yrange [-4:0] plot file using 1:(f($2)) The use of multiplot is to place two plots above and below the zero line. Positioning is tricky but doable! Thanks, Somesh -- View this message in context: http://gnuplot.10905.n7.nabble.com/Both-positive-and-negative-log-y-axis-in-same-plot-tp17082p17085.html Sent from the Gnuplot - User mailing list archive at Nabble.com. |