<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>xticlabel &#8211; Gnuplotting</title>
	<atom:link href="./index.html?simply_static_page=2112" rel="self" type="application/rss+xml" />
	<link>./../../../index.html</link>
	<description>Create scientific plots using gnuplot</description>
	<lastBuildDate>Mon, 04 Jun 2012 13:07:14 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.1.1</generator>
	<item>
		<title>Plotting simple statistical data</title>
		<link>./../../../plotting-simple-statistical-data/index.html</link>
					<comments>./../../../plotting-simple-statistical-data/index.html#respond</comments>
		
		<dc:creator><![CDATA[hagen]]></dc:creator>
		<pubDate>Thu, 09 Sep 2010 15:03:56 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[ANOVA]]></category>
		<category><![CDATA[border]]></category>
		<category><![CDATA[boxes]]></category>
		<category><![CDATA[data]]></category>
		<category><![CDATA[errorbars]]></category>
		<category><![CDATA[xticlabel]]></category>
		<guid isPermaLink="false">./../../../index.html?p=444</guid>

					<description><![CDATA[If we have done a experiment in order to apply a significance test like a ANOVA to our measured data, we are interested in presenting our statistical data in a familiar way. Let us assume we have the following mean and standard deviation data for five different conditions: "A" 0.66257 0.41854 "B" 0.70842 0.38418 "C" [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>If we have done a experiment in order to apply a significance test like a ANOVA to our measured data, we are interested in presenting our statistical data in a familiar way.<br />
Let us assume we have the following mean and standard deviation data for five different conditions:</p>
<pre>
"A"     0.66257     0.41854
"B"     0.70842     0.38418
"C"     0.66733     0.44059
"D"     0.45375     0.52384
"E"     0.43900     0.53116
</pre>
<p>The results for the last two conditions are significant different from the first ones. Using this data we want to create a plot that looks like the one in Fig. 1.</p>
<div class="figure">
    <object data="./../../../figs/simple_statistics.svg" type="image/svg+xml"><img decoding="async" src="./../../../figs/simple_statistics.png" alt="mean and variance" width="350"/></object></p>
<p class="caption">
        <strong>Fig. 1 </strong>Plot the mean and variance of the given <a href="./../../../data/simple_statistics.dat">data</a> (<a href="./../../../code/simple_statistics.gnu" type="text/plain">code to produce this figure</a>)
    </p>
</div>
<p>To achieve the plot in Fig. 1 we have to define two different color styles for the color of the errorbars and the color of the boxes. Also, we need the fill style (<code>solid</code>) for the boxes and the gray line around the boxes which is given by the <code>border rgb 'grey30'</code> option to the <code>set style fill</code> command. For the line color we choose the same color as for the errorbars:</p>
<pre class="prettyprint">
<span class="k">set</span> style line <span class="n">1</span> lc rgb <span class="s">'grey30'</span> ps <span class="n">0</span> lt <span class="n">1</span> lw <span class="n">2</span>
<span class="k">set</span> style line <span class="n">2</span> lc rgb <span class="s">'grey70'</span> lt <span class="n">1</span> lw <span class="n">2</span>
<span class="k">set</span> style fill solid <span class="n">1.0</span> border rgb <span class="s">'grey30'</span>
</pre>
<p>For the first line style which is used to plot the errorbars also a point size of <code>0</code> is specified in order to plot only the errorbars and no points on top of the boxes.</p>
<p>The <code>*</code>-dots above the two last conditions to indicate their significant difference are just added as labels. The border of the graph on the top and right side is removed by <code>set border 3</code> (<a href="http://www.gnuplot.info/docs_4.4/gnuplot.html#x1-18400075.7">see here for an explanation of the number codes</a>) and by using the <code>nomirror</code> option for the tics. The xtics are not visible, because we set them to <code>scale 0</code>.</p>
<pre class="prettyprint">
<span class="k">set</span> label <span class="s">'*'</span> at <span class="n">3</span>,<span class="n">0.8</span> center
<span class="k">set</span> label <span class="s">'*'</span> at <span class="n">4</span>,<span class="n">0.8</span> center
<span class="k">set</span> border <span class="n">3</span>
<span class="k">set</span> xtics nomirror scale <span class="n">0</span>
<span class="k">set</span> ytics nomirror out scale <span class="n">0.75</span> <span class="n">0.5</span>
</pre>
<p>Then we plot first the errorbars in order to overlay the boxes on it, so only the top half of the errorbars will be visible. Note that we have standard deviation data in the data file, therefore we have to use their squares in order to get the variance. As xtic labels we use the first row in the data file by appending <code>xtic(1)</code>:</p>
<pre class="prettyprint">
<span class="k">plot</span> <span class="s">'simple_statistics.dat'</span> u <span class="n">0</span>:<span class="n">2</span>:(<span class="v">$3</span><span class="o">**</span><span class="n">2</span>) w yerrorbars ls <span class="n">1</span>, \
     <span class="s">''</span>                      u <span class="n">0</span>:<span class="n">2</span>:(<span class="n">0.7</span>):xtic(<span class="n">1</span>) w boxes ls <span class="n">2</span>
</pre>
]]></content:encoded>
					
					<wfw:commentRss>./../../../plotting-simple-statistical-data/feed/index.html</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
