Dealing with negative values in log scale
<p>I'm plotting a line graph in MatLab with standard deviation using log scale:</p>

<pre><code>fig = figure;
errorbar(mean(samples),sqrt(var(samples)));
ax = get(fig,'CurrentAxes');
set(ax,'YScale','log');
</code></pre>

<p>However, in some samples, the lower error bar is below 0. For example, given samples <code>s=[11.0147 80.2365 11.6116 11.1837 9.9091]</code>, then <code>mean=24.7911</code> and <code>std=31.0013</code>, which makes the lower error bar be at <code>-6.2101</code>. Since log scale ignores negative values, the error bars look really weird.</p>

<p>How do I calculate asymmetric error bars? I though of maybe calculating <code>std</code> for all values <code>&gt;=mean</code> and for all values <code>&lt;=mean</code>, so that I have different upper and lower error bars. Is this a valid approach?</p>