<?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>Gnuplotting</title>
	<atom:link href="http://www.gnuplotting.org/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.gnuplotting.org</link>
	<description>Create scientific plots using gnuplot</description>
	<lastBuildDate>Tue, 21 May 2013 13:43:31 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Default color map</title>
		<link>http://www.gnuplotting.org/default-color-map/</link>
		<comments>http://www.gnuplotting.org/default-color-map/#comments</comments>
		<pubDate>Tue, 21 May 2013 13:40:14 +0000</pubDate>
		<dc:creator>hagen</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[colormap]]></category>
		<category><![CDATA[configuration]]></category>
		<category><![CDATA[data]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[load]]></category>
		<category><![CDATA[palette]]></category>

		<guid isPermaLink="false">http://www.gnuplotting.org/?p=1724</guid>
		<description><![CDATA[As you may have noted, gnuplot and Matlab have different default color maps. Designing such a default map is not easy, because they should handle a lot of different things (Moreland, 2009): – The map yields images that are aesthetically pleasing – The map has a maximal perceptual resolution – Interference with the shading of [...]]]></description>
				<content:encoded><![CDATA[<p>As you may have noted, gnuplot and Matlab have different default color maps. Designing such a default map is not easy, because they should handle a lot of different things (<a href="http://www.sandia.gov/~kmorel/documents/ColorMaps/">Moreland, 2009</a>):<br />
– The map yields images that are aesthetically pleasing<br />
– The map has a maximal perceptual resolution<br />
– Interference with the shading of 3D surfaces is minimal<br />
– The map is not sensitive to vision deficiencies<br />
– The order of the colors should be intuitively the same for all people<br />
– The perceptual interpolation matches the underlying scalars of the map</p>
<p>In his paper Moreland developed a new default color map that <a href="http://www.gnuplotting.org/matlab-colorbar-with-gnuplot/comment-page-1/#comment-3334">was mentioned already</a> in a user comment. In Fig. 1 the map is used to replot the photoluminescence yield plotted in an <a href="http://www.gnuplotting.org/matlab-colorbar-with-gnuplot/">earlier entry</a>.</p>
<div class="figure">
    <img src="http://www.gnuplotting.org/figs/default_color_map1.png" alt="Default color map after Moreland, 2009"/>
<p class="caption">
        <strong>Fig. 1 </strong>Photoluminescence yield plotted with the default color map after <a href="http://www.sandia.gov/~kmorel/documents/ColorMaps/">Moreland, 2009</a> (<a href="http://www.gnuplotting.org/code/default_color_map1.gnu" type="text/plain" rel="nofollow">code to produce this figure</a>, <a href="http://www.gnuplotting.org/data/matlab_colormap.txt" rel="nofollow">data</a>)
    </p>
</div>
<p>To use the default color map proposed by Moreland, just download <a href="http://www.gnuplotting.org/code/default.plt">default.plt</a> and store it to a path, that is available to gnuplot. For example store it under <code>/home/username/.gnuplotting/default.plt</code> and add the following line to your <code>.gnuplot</code> file.</p>
<pre class="prettyprint">
set loadpath "/home/username/.gnuplotting"
</pre>
<p>After that you can just load the palette before your plot command via</p>
<pre class="prettyprint">
load 'default.plt'
</pre>
<div class="figure">
    <img src="http://www.gnuplotting.org/figs/default_color_map2.png" alt="Default gnuplot color palette"/>
<p class="caption">
        <strong>Fig. 2 </strong>Photoluminescence yield plotted with gnuplots default color palette (<a href="http://www.gnuplotting.org/code/default_color_map2.gnu" type="text/plain" rel="nofollow">code to produce this figure</a>, <a href="http://www.gnuplotting.org/data/matlab_colormap.txt" rel="nofollow">data</a>)
    </p>
</div>
<p>In Fig. 2 the same plot is shown using the default color map from gnuplot, which is a little bit dark in my opinion.</p>
<div class="figure">
    <img src="http://www.gnuplotting.org/figs/default_color_map3.png" alt="Default Matlab color palette"/>
<p class="caption">
        <strong>Fig. 3 </strong>Photoluminescence yield plotted with Matlabs default color palette (<a href="http://www.gnuplotting.org/code/default_color_map3.gnu" type="text/plain" rel="nofollow">code to produce this figure</a>, <a href="http://www.gnuplotting.org/data/matlab_colormap.txt" rel="nofollow">data</a>)
    </p>
</div>
<p>Figure 3 shows the jet color map from Matlab, which is a classical rainbow map with all its pros and cons.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gnuplotting.org/default-color-map/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mercator projection</title>
		<link>http://www.gnuplotting.org/mercator-projection/</link>
		<comments>http://www.gnuplotting.org/mercator-projection/#comments</comments>
		<pubDate>Wed, 03 Apr 2013 11:51:44 +0000</pubDate>
		<dc:creator>hagen</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[background]]></category>
		<category><![CDATA[data]]></category>
		<category><![CDATA[do]]></category>
		<category><![CDATA[filledcurves]]></category>

		<guid isPermaLink="false">http://www.gnuplotting.org/?p=1707</guid>
		<description><![CDATA[In one of the last posts, we came up with an updated data set representing the world. One way to plot this data set is with a 2D plot, as shown in Fig. 2. But if you compare the output with the one you see for example at Google Maps you will noticed a difference. [...]]]></description>
				<content:encoded><![CDATA[<p>In one of the last posts, we came up with an <a href="http://www.gnuplotting.org/plotting-the-world-revisited/">updated data set representing the world</a>. One way to plot this data set is with a 2D plot, as shown in Fig. 2. But if you compare the output with the one you see for example at Google Maps you will noticed a difference. That is due to the fact that Google uses the <a href="https://en.wikipedia.org/wiki/Mercator_projection">Mercator projection</a> of the data. This projection preserves the angles around any point on the map, what is useful if you have a close look at some streets. The disadvantage of the Mercator projection is the inaccuracy of the sizes of the countries near to the poles. For example the size of Greenland is completely overemphasized as you can see in Fig. 1.</p>
<div class="figure">
        <img src="http://www.gnuplotting.org/figs/mercator_projection.png" alt="Mercator projection" width="350"/>
<p class="caption">
        <strong>Fig. 1 </strong>Mercator projection of the world (<a href="http://www.gnuplotting.org/code/mercator_projection.gnu" type="text/plain">code to produce this figure</a>, <a href="http://www.gnuplotting.org/data/world_110m.txt" type="text/plain">data</a>)
    </p>
</div>
<p>In order to achieve the Mercator projection, we apply the following function.</p>
<pre class="prettyprint">
set angles degrees
mercator(latitude) = log( tan(180/4.0 + latitude/2.0) )
set yrange [-3.1:3.1]
plot 'world_110m.txt' u 1:(mercator($2)) w filledcu ls 2
</pre>
<div class="figure">
        <img src="http://www.gnuplotting.org/figs/equirectangular_projection.png" alt="Equirectangular projection" width="350"/>
<p class="caption">
        <strong>Fig. 2 </strong>Equirectangular projection of the world (<a href="http://www.gnuplotting.org/code/mercator_projection.gnu" type="text/plain">code to produce this figure</a>, <a href="http://www.gnuplotting.org/data/world_110m.txt" type="text/plain">data</a>)
    </p>
</div>
<p>By just plotting the data as we have done for Fig. 2, we have the <a href="http://en.wikipedia.org/wiki/Equirectangular_projection">Equirectangular projection</a> with constant spacing between the latitudes and meridians. The blue background color in the first two figures can be achieved directly with a terminal setting.</p>
<pre class="prettyprint">
set terminal pngcairo size background '#c8ebff'
</pre>
<div class="figure">
        <img src="http://www.gnuplotting.org/figs/mercator_input_output.png" alt="Heat map" width="350"/>
<p class="caption">
        <strong>Fig. 3 </strong>Mapping of the Mercator projection (<a href="http://www.gnuplotting.org/code/mercator_input_output.gnu" type="text/plain">code to produce this figure</a>)
    </p>
</div>
<p>In Fig. 3 the Mercator projection function is shown as an input-output-function of the latitude values. The placing of the latitude values on the y-axis can be easily done with a loop.</p>
<pre class="prettyprint">
set ytics 0
do for [angle=-80:80:20] {
    set ytics add (sprintf('%.0f',angle) mercator(angle))
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.gnuplotting.org/mercator-projection/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Interpolation of heat maps</title>
		<link>http://www.gnuplotting.org/interpolation-of-heat-maps/</link>
		<comments>http://www.gnuplotting.org/interpolation-of-heat-maps/#comments</comments>
		<pubDate>Tue, 12 Mar 2013 20:46:47 +0000</pubDate>
		<dc:creator>hagen</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[colormap]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[interpolate]]></category>
		<category><![CDATA[matrix]]></category>
		<category><![CDATA[pm3d]]></category>
		<category><![CDATA[splot]]></category>

		<guid isPermaLink="false">http://www.gnuplotting.org/?p=1682</guid>
		<description><![CDATA[We discussed already the plotting of heat maps at more than one occasions. Here we will add the possibility to interpolate the data in a heat map figure. Fig. 1 A simple heat map (code to produce this figure, data) Suppose we have the following data matrix, stored in heat_map_data.txt. 6 5 4 3 1 [...]]]></description>
				<content:encoded><![CDATA[<p>We discussed already the plotting <a href="http://www.gnuplotting.org/heat-maps/">of heat maps</a> at <a href="http://www.gnuplotting.org/color-maps-and-the-scale-of-axes/">more than</a> one <a href="http://www.gnuplotting.org/matlab-colorbar-with-gnuplot/">occasions</a>. Here we will add the possibility to interpolate the data in a heat map figure.</p>
<div class="figure">
        <img src="http://www.gnuplotting.org/figs/heat_map_interpolation1.png" alt="Heat map" width="350"/>
<p class="caption">
        <strong>Fig. 1 </strong>A simple heat map (<a href="http://www.gnuplotting.org/code/heat_map_interpolation1.gnu" type="text/plain">code to produce this figure</a>, <a href="http://www.gnuplotting.org/data/heat_map_data.txt" type="text/plain">data</a>)
    </p>
</div>
<p>Suppose we have the following data matrix, stored in <a href="http://www.gnuplotting.org/data/heat_map_data.txt">heat_map_data.txt</a>.</p>
<pre>
6 5 4 3 1 0
3 2 2 0 0 1
0 0 0 0 1 0
0 0 0 0 2 3
0 0 1 2 4 3
0 1 2 3 4 5
</pre>
<p>The normal way of plotting them would be with</p>
<pre class="prettyprint">
plot 'heat_map_data.txt' matrix with image
</pre>
<p>But to be able to interpolate the data we have to use <a href="http://www.gnuplotting.org/manpage-gnuplot-4-6#x1-370000III" class="manpage">splot</a> and <a href="http://www.gnuplotting.org/manpage-gnuplot-4-6#x1-265000III" class="manpage">pm3d</a> instead. </p>
<pre class="prettyprint">
set pm3d map
splot 'heat_map_data.txt' matrix
</pre>
<p>In Fig. 1 the result of plotting the data just with splot, without interpolation is shown. Note, that the result differs already from the plot command. The plot command would have created six points, whereas the splot command comes up with only five different regions for every axis.</p>
<div class="figure">
        <img src="http://www.gnuplotting.org/figs/heat_map_interpolation2.png" alt="Interpolated heat map" width="350"/>
<p class="caption">
        <strong>Fig. 2 </strong>A heat map interpolated to use twice as much points on every axis (<a href="http://www.gnuplotting.org/code/heat_map_interpolation2.gnu" type="text/plain">code to produce this figure</a>, <a href="http://www.gnuplotting.org/data/heat_map_data.txt" type="text/plain">data</a>)
    </p>
</div>
<p>Now if we want to double the number of visible points, we can tell pm3d easily to interpolate the data by the <a href="http://www.gnuplotting.org/manpage-gnuplot-4-6#x1-272000III" class="manpage">interpolate</a> command.</p>
<pre class="prettyprint">
set pm3d interpolate 2,2
</pre>
<p>The two numbers <code>2,2</code> are the number of additional points along the x- and y-axis.<br />
The resulting plot can be found in Fig. 2.</p>
<div class="figure">
        <img src="http://www.gnuplotting.org/figs/heat_map_interpolation3.png" alt="Strong interpolated heat map" width="350"/>
<p class="caption">
        <strong>Fig. 3 </strong>A heat map interpolated with an optimal number of points (<a href="http://www.gnuplotting.org/code/heat_map_interpolation3.gnu" type="text/plain">code to produce this figure</a>, <a href="http://www.gnuplotting.org/data/heat_map_data.txt" type="text/plain">data</a>)
    </p>
</div>
<p>In addition to explicitly setting the number of points we can tell gnuplot to choose the correct number of interpolation points by itself, by setting them to 0.</p>
<pre class="prettyprint">
set pm3d interpolate 0,0
</pre>
<p>Now gnuplot decides by itself how to interpolate, which leads to the result in Fig. 3.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gnuplotting.org/interpolation-of-heat-maps/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Design update and manpage</title>
		<link>http://www.gnuplotting.org/design-update-and-manpage/</link>
		<comments>http://www.gnuplotting.org/design-update-and-manpage/#comments</comments>
		<pubDate>Sun, 17 Feb 2013 19:17:35 +0000</pubDate>
		<dc:creator>hagen</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.gnuplotting.org/?p=1645</guid>
		<description><![CDATA[As you may have noticed some little changes have occurred. The width of the text area and the font size is larger now. But the most noticeable change is the addition of the gnuplot manpage as a HTML side. That was part of the gnuplot documentation site for older versions of gnuplot, but disappeared with [...]]]></description>
				<content:encoded><![CDATA[<p>As you may have noticed some little changes have occurred. The width of the text area and the font size is larger now.<br />
But the most noticeable change is the addition of the gnuplot manpage as a HTML side. That was part of the <a href="http://www.gnuplot.info/documentation.html">gnuplot documentation</a> site for older versions of gnuplot, but disappeared with version 4.4. Now we have the <a href="http://www.gnuplotting.org/manpage-gnuplot-4-6/">manpage for version 4.6</a> directly integrated with this site. That gives the nice opportunity to directly link to the description in the manpage of some commands. For example have a look at the placing of a text <a class="manpage" href="http://www.gnuplotting.org/manpage-gnuplot-4-6#x1-234000III">label</a>.<br />
Another nice feature is the availability of all the code for the blog entries and the wordpress theme on <a href="http://github.com/Gnuplotting">github</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gnuplotting.org/design-update-and-manpage/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Filledcurves with different transparency</title>
		<link>http://www.gnuplotting.org/filledcurves-with-different-transparency/</link>
		<comments>http://www.gnuplotting.org/filledcurves-with-different-transparency/#comments</comments>
		<pubDate>Wed, 06 Feb 2013 13:50:50 +0000</pubDate>
		<dc:creator>hagen</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.gnuplotting.org/?p=1609</guid>
		<description><![CDATA[Maybe you all know the nice example of gnuplots transparent fill style. I have replotted it slightly modified in Fig. 1. Fig. 1 Filledcurves with transparency settings as on the gnuplot demo site (code to reproduce this figure) The interesting part in the code looks like this. set style fill transparent solid 0.5 noborder plot [...]]]></description>
				<content:encoded><![CDATA[<p>Maybe you all know the nice <a href="http://gnuplot.sourceforge.net/demo/transparent.html">example of gnuplots transparent fill style</a>. I have replotted it slightly modified in Fig. 1.</p>
<div class="figure">
    <img src="http://www.gnuplotting.org/figs/different_transparency1.png" alt="Filledcurves with transparency"/>
<p class="caption">
        <strong>Fig. 1 </strong>Filledcurves with transparency settings as on the <a href="http://gnuplot.sourceforge.net/demo/transparent.html">gnuplot demo site</a> (<a href="http://www.gnuplotting.org/code/different_transparency1.gnu">code to reproduce this figure</a>)
    </p>
</div>
<p>The interesting part in the code looks like this.</p>
<pre class="prettyprint">
set style fill transparent solid 0.5 noborder
plot d1(x) fs solid 1.0 lc rgb "forest-green" title 'µ= 0.5 &sigma;=0.5', \
     d2(x) lc rgb "gold" title 'µ= 2.0 &sigma;=1.0', \
     d3(x) lc rgb "red" title 'µ=-1.0 &sigma;=2.0'
</pre>
<p>The set style command sets the fill style to 50% transparency, which is overwritten by the explicit fs option to the first plotting command in order to plot the green curve without transparency.</p>
<div class="figure">
    <img src="http://www.gnuplotting.org/figs/different_transparency2.png" alt="Filledcurves with different transparency"/>
<p class="caption">
        <strong>Fig. 2 </strong>Filledcurves with different transparency settings (<a href="http://www.gnuplotting.org/code/different_transparency2.gnu">code to reproduce this figure</a>)
    </p>
</div>
<p>Now the question is how to plot filled curves with different transparency settings? The simple answer is, by just using this explicit fs plot argument. The result is shown in Fig.2 and can be reached with the following code. Now we apply a transparency of 75%, 50%, and 25% going from the green to the red curve.</p>
<pre class="prettyprint">
set style fill noborder
plot d1(x) fs transparent solid 0.75 lc rgb "forest-green" \
        title 'µ= 0.5&sigma;=0.5', \
     d2(x) fs transparent solid 0.50 lc rgb "gold" \
        title 'µ= 2.0 &sigma;=1.0', \
     d3(x) fs transparent solid 0.25 lc rgb "red" \
        title 'µ=-1.0 &sigma;=2.0'
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.gnuplotting.org/filledcurves-with-different-transparency/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Plotting the world revisited</title>
		<link>http://www.gnuplotting.org/plotting-the-world-revisited/</link>
		<comments>http://www.gnuplotting.org/plotting-the-world-revisited/#comments</comments>
		<pubDate>Tue, 18 Dec 2012 18:24:07 +0000</pubDate>
		<dc:creator>hagen</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[4.6]]></category>
		<category><![CDATA[data]]></category>
		<category><![CDATA[hidden3d]]></category>
		<category><![CDATA[linestyle]]></category>
		<category><![CDATA[linetype]]></category>
		<category><![CDATA[parametric]]></category>

		<guid isPermaLink="false">http://www.gnuplotting.org/?p=1559</guid>
		<description><![CDATA[More than a year ago, we draw a map of the world with gnuplot. But it has been pointed out the low resolution of the map data. For example, Denmark is totally missing in the original data file. The good thing is, there is other data available in the web. In this entry we will [...]]]></description>
				<content:encoded><![CDATA[<p>More than a year ago, we <a href="http://www.gnuplotting.org/plotting-the-world/">draw a map of the world with gnuplot</a>. But it has been pointed out the low resolution of the map data. For example, Denmark is totally missing in the original <a href="http://www.gnuplotting.org/data/world.dat">data file</a>. The good thing is, there is other data available in the web. In this entry we will consider how to use the physical coastline data from  <a href="http://www.naturalearthdata.com/downloads/">http://www.naturalearthdata.com/downloads/</a> together with gnuplot.</p>
<div class="figure">
    <img src="http://www.gnuplotting.org/figs/world3d_revisited.png" alt=""/>
<p class="caption">
        <strong>Fig. 1 </strong>Plot of the world with the new data file and a resolution of 1:110m (<a href="http://www.gnuplotting.org/code/world3d_revisited.gnu" type="text/plain">code to produce this figure</a>, <a href="http://www.gnuplotting.org/data/world_110m.txt">data</a>)
    </p>
</div>
<p>At the download page, three different resolutions of the data are available with a scale of 1:10m, 1:50m, or 1:110m. The data itself is stored as <a href="http://en.wikipedia.org/wiki/Shapefile">shape files</a> on naturalearthdata.com. Hence I wrote a <a href="http://www.gnuplotting.org/code/shape2txt">script</a> that converts the data first to a csv file using the <a href="http://www.gdal.org/ogr2ogr.html">ogr2ogr</a> program. Afterwards the data is shaped with <a href="http://www.gnu.org/software/sed/">sed</a> into the form of the original <a href="http://www.gnuplotting.org/data/world.dat">world.dat</a> file.<br />
Here are the resulting files:</p>
<ul>
<li>1:10m: <a href="http://www.gnuplotting.org/data/world_10m.txt">world_10m.txt</a></li>
<li>1:50m: <a href="http://www.gnuplotting.org/data/world_50m.txt">world_50m.txt</a></li>
<li>1:110m: <a href="http://www.gnuplotting.org/data/world_110m.txt">world_110m.txt</a></li>
</ul>
<p>Fig.1 shows the result for a resolution of 1:110m. Note that we have to use linetype instead of linestyle in gnuplot 4.6 in order to set the colors of the grid and coast line.</p>
<p>In order to compare the different resolutions of the coast line files, we plot only the part of the map where Denmark is located (which is completely missing in the <a href="http://www.gnuplotting.org/data/world.dat">original data</a>).<br />
Here is the example code for a scale of 1:110m.</p>
<pre class="prettyprint">
set xrange [7.5:13]
set yrange [54.5:58]
plot 'world_110m.txt' with filledcurves ls 1, \
    '' with l ls 2
</pre>
<div class="figure">
    <img src="http://www.gnuplotting.org/figs/denmark_110m.png" alt=""/>
<p class="caption">
        <strong>Fig. 2 </strong>A plot of Denmark at a resolution of 1:110m. (<a href="http://www.gnuplotting.org/code/denmark.gnu" type="text/plain">code to produce this figure</a>, <a href="http://www.gnuplotting.org/data/world_110m.txt">data</a>)
    </p>
</div>
<div class="figure">
    <img src="http://www.gnuplotting.org/figs/denmark_50m.png" alt=""/>
<p class="caption">
        <strong>Fig. 3 </strong>A plot of Denmark at a resolution of 1:50m. (<a href="http://www.gnuplotting.org/code/denmark.gnu" type="text/plain">code to produce this figure</a>, <a href="http://www.gnuplotting.org/data/world_50m.txt">data</a>)
    </p>
</div>
<div class="figure">
    <img src="http://www.gnuplotting.org/figs/denmark_10m.png" alt=""/>
<p class="caption">
        <strong>Fig. 4 </strong>A plot of Denmark at a resolution of 1:10m. (<a href="http://www.gnuplotting.org/code/denmark.gnu" type="text/plain">code to produce this figure</a>, <a href="http://www.gnuplotting.org/data/world_10m.txt">data</a>)
    </p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.gnuplotting.org/plotting-the-world-revisited/feed/</wfw:commentRss>
		<slash:comments>23</slash:comments>
		</item>
		<item>
		<title>Vector field from function</title>
		<link>http://www.gnuplotting.org/vector-field-from-function/</link>
		<comments>http://www.gnuplotting.org/vector-field-from-function/#comments</comments>
		<pubDate>Sat, 01 Dec 2012 22:25:12 +0000</pubDate>
		<dc:creator>hagen</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[++]]></category>
		<category><![CDATA[functions]]></category>
		<category><![CDATA[isosamples]]></category>
		<category><![CDATA[palette]]></category>
		<category><![CDATA[samples]]></category>
		<category><![CDATA[special-filenames]]></category>
		<category><![CDATA[vectors]]></category>

		<guid isPermaLink="false">http://www.gnuplotting.org/?p=1515</guid>
		<description><![CDATA[In an earlier entry we created a vector field from measured data. Now we will visualize functions with the vector plotting style. As functions we have two 1/r potentials which define the amplitude of the vectors, as can be seen in Fig. 1. It is often better to indicate the amplitude by a color instead [...]]]></description>
				<content:encoded><![CDATA[<p>In an earlier entry we <a href="http://www.gnuplotting.org/vector-field-from-data-file/">created a vector field from measured data</a>. Now we will visualize functions with the <code>vector</code> plotting style. As functions we have two 1/r potentials which define the amplitude of the vectors, as can be seen in Fig. 1. It is often better to indicate the amplitude by a color instead of by the length of the single vectors, especially if there are big changes. For the exact functions have a look into the <a href="http://www.gnuplotting.org/code/vector_fields2.gnu">corresponding file</a>.</p>
<div class="figure">
    <img src="http://www.gnuplotting.org/figs/vector_fields2.png" alt="Vector field showing two sources"/>
<p class="caption">
        <strong>Fig. 1 </strong>Vector field of two sources with the opposite charge. The color indicates the amplitude. (<a href="http://www.gnuplotting.org/code/vector_fields2.gnu" type="text/plain">code to produce this figure</a>)
    </p>
</div>
<p>By analogy to the <a href="http://www.gnuplotting.org/vector-field-from-data-file/">data vector field</a> we have again a dx, and dy function for the length of the vectors.</p>
<pre class="prettyprint">
dx(x,y) = scaling*ex(x,y)/enorm(x,y)
dy(x,y) = scaling*ey(x,y)/enorm(x,y)
</pre>
<p>Now we need a trick, because we have to fill the <code>u 1:2:3:4</code> for the vector style with our function data. The four columns are then x,y,dx,dy of the vectors, where dx, dy are the lengths of the vector in x and y direction. Here the special filename <code>++</code> is a big help. It gives us x and y points as a first and second column, which we could address by <code>$1</code> and <code>$2</code>. The number of points for the two axes are handled by the <code>samples</code> and <code>isosamples</code> command.</p>
<pre class="prettyprint">
set samples 17    # x-axis
set isosamples 15 # y-axis
plot '++' u ($1-dx($1,$2)/2.0):($2-dy($1,$2)/2.0):\
    (dx($1,$2)):(dy($1,$2)):(v($1,$2)) \
    with vectors head size 0.08,20,60 filled lc palette
</pre>
<p>To place the vector at the center of the single x, y points, we move the starting point of the vectors to x-dx/2, y-dy/2.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gnuplotting.org/vector-field-from-function/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Not so Frequently Asked Questions site down</title>
		<link>http://www.gnuplotting.org/not-so-frequently-asked-questions-site-down/</link>
		<comments>http://www.gnuplotting.org/not-so-frequently-asked-questions-site-down/#comments</comments>
		<pubDate>Sun, 11 Nov 2012 17:54:20 +0000</pubDate>
		<dc:creator>hagen</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.gnuplotting.org/?p=1530</guid>
		<description><![CDATA[The superb site not so Frequently Asked Questions from Kawano, which I read a lot at the beginning of my gnuplot journey is down at the moment. Hence I changed the link to a backup mirror.]]></description>
				<content:encoded><![CDATA[<p>The superb site <a href="http://t16web.lanl.gov/Kawano/gnuplot/index-e.html">not so Frequently Asked Questions</a> from Kawano, which I read a lot at the beginning of my gnuplot journey is down at the moment.<br />
Hence I changed the link to a <a href="http://web.archive.org/web/20110721043630/http://t16web.lanl.gov/Kawano/gnuplot/index-e.html"><span style="text-decoration: line-through;">backup</span></a> <a href="http://www.ualberta.ca/~xz10/gnuplot/index-e.html">mirror</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gnuplotting.org/not-so-frequently-asked-questions-site-down/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Animation IV &#8211; trajectory</title>
		<link>http://www.gnuplotting.org/animation-iv-trajectory/</link>
		<comments>http://www.gnuplotting.org/animation-iv-trajectory/#comments</comments>
		<pubDate>Wed, 07 Nov 2012 22:34:34 +0000</pubDate>
		<dc:creator>hagen</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.gnuplotting.org/?p=1523</guid>
		<description><![CDATA[Assume you have a data file describing a trajectory that you would like to animate like the spiral shown in Fig. 1. Fig. 1 An animated spiral trajectory (code to produce this figure, data) In order to create the animation we have to produce a set of png images and create the resulting gif animation [...]]]></description>
				<content:encoded><![CDATA[<p>Assume you have a data file describing a trajectory that you would like to animate like the spiral shown in Fig. 1.</p>
<div class="figure">
    <img src="http://www.gnuplotting.org/figs/spiral.gif" alt="moving spiral"/>
<p class="caption">
        <strong>Fig. 1 </strong>An animated spiral trajectory (<a href="http://www.gnuplotting.org/code/spiral.gnu" type="text/plain">code to produce this figure</a>, <a href="http://www.gnuplotting.org/data/spiral.txt">data</a>)
    </p>
</div>
<p>In order to create the animation we have to produce a set of png images and create the resulting gif animation with GIMP as shown in the <a href="http://www.gnuplotting.org/animation-gif/">Animation I – gif</a> entry. Therefor, we have to tell gnuplot at which point of the data it has to stop for each image. This can be achieved by the <code>every</code> option. The point at the end of the line is just one data point. Here the start point and end point for <code>every</code> are just the same.</p>
<pre class="prettyprint">
do for [ii=1:99] {
    splot 'spiral.txt' every ::1::ii w l ls 1, \
          'spiral.txt' every ::ii::ii w p ls 1
}
</pre>
<p>The downward spiral is created by running the loop in the other direction.</p>
<pre class="prettyprint">
do for [ii=99:1:-1] {
    splot 'spiral.txt' every ::1::ii w l ls 1, \
          'spiral.txt' every ::ii::ii w p ls 1
}
</pre>
<p>By the way, I don&#8217;t know why the antialiasing of the output png images is not working in this example. If you have any idea, feel free to tell me.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gnuplotting.org/animation-iv-trajectory/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Vector field from data file</title>
		<link>http://www.gnuplotting.org/vector-field-from-data-file/</link>
		<comments>http://www.gnuplotting.org/vector-field-from-data-file/#comments</comments>
		<pubDate>Wed, 17 Oct 2012 13:51:45 +0000</pubDate>
		<dc:creator>hagen</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[data]]></category>
		<category><![CDATA[head]]></category>
		<category><![CDATA[linecolor]]></category>
		<category><![CDATA[palette]]></category>
		<category><![CDATA[vectors]]></category>

		<guid isPermaLink="false">http://gnuplot.kkdu.org/?p=38</guid>
		<description><![CDATA[Some data could be nicely visualized by representing them as arrows. For example, assume that we have done an experiment where we played something to a subject through three loudspeakers and the subject should name the direction where he or she perceived it. In Fig. 1 we show the named direction by the direction of [...]]]></description>
				<content:encoded><![CDATA[<p>Some data could be nicely visualized by representing them as arrows. For example, assume that we have done an experiment where we played something to a subject through three loudspeakers and the subject should name the direction where he or she perceived it. In Fig. 1 we show the named direction by the direction of the arrows. The color of the arrow indicates the deviation from the desired direction. A white and not visible arrow means no deviation and a dark red one a deviation of 40° or more.</p>
<div class="figure">
    <img src="http://www.gnuplotting.org/figs/vector_fields1.png" alt="Vector field showing localization data"/>
<p class="caption">
        <strong>Fig. 1 </strong>Vector field showing localization results. The arrows are pointing towards the direction the subject had named. The color indicates the deviation from the desired direction. (<a href="http://www.gnuplotting.org/code/vector_fields1.gnu" type="text/plain">code to produce this figure</a>, <a href="http://www.gnuplotting.org/code/set_loudspeakers.gnu">set_loudspeakers.gnu</a>, <a href="http://www.gnuplotting.org/data/localization_data.txt">data</a>)
    </p>
</div>
<p>In gnuplot the <code>with vectors</code> command enables the arrows in the plot. It requires four parameters, x, y, dx, dy, where dx and dy controls the endpoint of the arrow as offset values to x,y. In our example the direction is stored as an angle, hence the following functions do the conversion to dx,dy. 0.1 defines the length of the arrows.</p>
<pre class="prettyprint">
xf(phi) = 0.1*cos(phi/180.0*pi+pi/2)
yf(phi) = 0.1*sin(phi/180.0*pi+pi/2)
</pre>
<p>An optional fifth parameter controls the color of the vector together with the <code>lc palette</code> setting. The arrows start at x-dx,y-dy and point to x+dx,y+dy.</p>
<pre class="prettyprint">
plot 'localization_data.txt' \
    u ($1-xf($3)):($2-yf($3)):(2*xf($3)):(2*yf($3)):4 \
    with vectors head size 0.1,20,60 filled lc palette
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.gnuplotting.org/vector-field-from-data-file/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
