<?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 &#187; load</title>
	<atom:link href="http://www.gnuplotting.org/tag/load/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.gnuplotting.org</link>
	<description>Create scientific plots using gnuplot</description>
	<lastBuildDate>Mon, 10 Jun 2013 15:03:45 +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>Color maps from colorbrewer</title>
		<link>http://www.gnuplotting.org/color-maps-from-colorbrewer/</link>
		<comments>http://www.gnuplotting.org/color-maps-from-colorbrewer/#comments</comments>
		<pubDate>Wed, 05 Jun 2013 13:49:15 +0000</pubDate>
		<dc:creator>hagen</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[colormap]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[lines]]></category>
		<category><![CDATA[load]]></category>
		<category><![CDATA[palette]]></category>

		<guid isPermaLink="false">http://www.gnuplotting.org/?p=1732</guid>
		<description><![CDATA[If you are looking for nice color maps which are especially prepared to work with cartographic like plots you should have a look at colorbrewer2.org. On that site hosted by Cynthia Brewer you can pick from a large set of well balanced color maps. The maps are ordered regarding their usage. Figure 1 shows example [...]]]></description>
				<content:encoded><![CDATA[<p>If you are looking for nice color maps which are especially prepared to work with cartographic like plots you should have a look at <a href="http://colorbrewer2.org/">colorbrewer2.org</a>. On that site hosted by Cynthia Brewer you can pick from a large set of well balanced color maps. The maps are ordered regarding their usage. Figure 1 shows example color maps for three different use cases. </p>
<div class="figure">
    <img src="http://www.gnuplotting.org/figs/colorbrewer.png" alt="Colorbrew color maps"/>
<p class="caption">
        <strong>Fig. 1 </strong>Examples of color maps from <a href="http://colorbrewer2.org/">colorbrewer2.org</a> ordered in three categories (<a href="http://www.gnuplotting.org/code/colorbrewer.gnu" type="text/plain" rel="nofollow">code to produce this figure</a>, <a href="http://www.gnuplotting.org/data/colorbrewer.txt" rel="nofollow">data</a>)
    </p>
</div>
<p>The diverging color maps are for data with extremes at both points of a neutral value, for example like the below and above sea level. The sequential color maps are for data ordered from one point to another and the qualitative color maps are for  categorically-grouped data with now explicit ordering.<br />
Thanks to Anna Schneider there is an easy way to include them (at least the ones with eight colors each) into gnuplot. Just go to her <a href="http://github.com/aschn/gnuplot-colorbrewer">gnuplot-colorbrewer github site</a> and download the color maps. Place them in the same path as your plotting file, or add the three pathes of the repository to your load pathes, for example by adding the following to your <a href="http://www.gnuplotting.org/manpage-gnuplot-4-6/#x1-52000I" class="manpage">.gnuplot</a> file.</p>
<pre class="prettyprint">
set loadpath '~/git/gnuplot-colorbrewer/diverging' \
    '~/git/gnuplot-colorbrewer/qualitative' \
    '~/git/gnuplot-colorbrewer/sequential'
</pre>
<div class="figure">
    <img src="http://www.gnuplotting.org/figs/colorbrewer_map_example.png" alt="YlGnBu color map from colorbrewer"/>
<p class="caption">
        <strong>Fig. 2 </strong>Photoluminescence yield plotted with the YlGnBu color map from <a href="http://colorbrewer2.org/" rel="nofollow">colorbrewer2.org</a> (<a href="http://www.gnuplotting.org/code/colorbrewer_map_example.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>After this you can pick the right color map for you on <a href="http://colorbrewer2.org/">colorbrewer2.org</a>, keep its name and load it before your plot command. For example in Fig. 2 we are plotting <a href="http://www.gnuplotting.org/default-color-map/">again</a> the photoluminescence yield with the sequential color map named <code>YlGnBu</code>. First we load the color map, then switch the two poles of the color map by setting the palette to <code>negative</code>, and finally plotting the data.</p>
<pre class="prettyprint">
load 'YlGnBu.plt'
set palette negative
plot 'matlab_colormap.txt' u ($1/3.0):($2/3.0):($3/1000.0) matrix with image
</pre>
<div class="figure">
    <img src="http://www.gnuplotting.org/figs/colorbrewer_line_example.png" alt="Paired color map from colorbrewer"/>
<p class="caption">
        <strong>Fig. 3 </strong>Eight lines plotted with the Paired color map from <a href="http://colorbrewer2.org/">colorbrewer2.org</a> (<a href="http://www.gnuplotting.org/code/colorbrewer_line_example.gnu" type="text/plain" rel="nofollow">code to produce this figure</a>)
    </p>
</div>
<p>The nice thing of the palettes coming with <a href="http://github.com/aschn/gnuplot-colorbrewer">gnuplot-colorbrewer</a> is that they also include the corresponding line colors. In Fig. 3 you see the <code>Paired</code> qualitative color map in action with lines.</p>
<pre class="prettyprint">
load 'Paired.plt'
plot for [ii=1:8] f(x,ii) ls ii lw 2
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.gnuplotting.org/color-maps-from-colorbrewer/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<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>Animation II &#8211; video</title>
		<link>http://www.gnuplotting.org/animation-video/</link>
		<comments>http://www.gnuplotting.org/animation-video/#comments</comments>
		<pubDate>Fri, 03 Feb 2012 13:25:37 +0000</pubDate>
		<dc:creator>hagen</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[animation]]></category>
		<category><![CDATA[if]]></category>
		<category><![CDATA[load]]></category>
		<category><![CDATA[reread]]></category>
		<category><![CDATA[system]]></category>

		<guid isPermaLink="false">http://www.gnuplotting.org/?p=1189</guid>
		<description><![CDATA[In the first post regarding animations we have created a bunch of png files and combined them to a single gif animation. Now we want to generate again a bunch of png files, but combine them to a movie. Download the video Fig. 1 Video animation of Huygens principle (code to produce this figure, loop [...]]]></description>
				<content:encoded><![CDATA[<p>In the <a href="http://www.gnuplotting.org/animation-gif/">first post regarding animations</a> we have created a bunch of png files and combined them to a single gif animation. Now we want to generate again a bunch of png files, but combine them to a movie.</p>
<div class="figure">
  <video id="huygens_principle" controls loop><source src="http://www.gnuplotting.org/video/huygen.webm" type='video/webm; codecs="vorbis,vp8"' /><a href="http://www.gnuplotting.org/video/huygen.webm">Download the video</a></video>
<p class="caption">
  <strong>Fig. 1 </strong>Video animation of Huygens principle (<a href="http://www.gnuplotting.org/code/huygen.gnu" type="text/plain">code to produce this figure</a>, <a href="http://www.gnuplotting.org/code/huygen.plt">loop function</a>)
  </p>
</div>
<p>We create the png files in analogy to the gif example, hence we will discuss only the generation of the movie here. In order to compose a avi file from the png files we are using <a href="http://www.mplayerhq.hu">Mencoder</a>. Gnuplot is able to directly start Mencoder by its <code>system</code> command.</p>
<pre class="prettyprint">
# Create movie with mencoder
<span class="v">ENCODER</span> = system('which mencoder');
if (<span class="f">strlen</span>(<span class="v">ENCODER</span>)==0) print '=== mencoder not found ==='; exit
<span class="v">CMD</span> = 'mencoder mf://animation/*.png -mf fps=25:type=png -ovc lavc -lavcopts vcodec=mpeg4:mbd=2:trell -oac copy -o huygen.avi'
system(<span class="v">CMD</span>)
</pre>
<p>The first two lines check if Mencoder is available and quit gnuplot if not. The Mencoder command itselfs gets the directory containing the png files <code>mf://animation/*.png</code>, frames per second and input type<code>-mf fps=25:type=png</code>, video <code>-ovc</code> and audio <code>-oac</code> options, and finally of course the output file <code>-o huygen.avi</code>.</p>
<p>In order to generate a <a href="http://www.webmproject.org/">webm</a> video file for a web site, ffmpeg can be used to convert the video.</p>
<pre class="prettyprint">
<span class="pr">$</span> ffmpeg -i huygen.avi huygen.webm
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.gnuplotting.org/animation-video/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://www.gnuplotting.org/video/huygen.webm" length="192914" type="video/webm" />
		</item>
		<item>
		<title>Animation I &#8211; gif</title>
		<link>http://www.gnuplotting.org/animation-gif/</link>
		<comments>http://www.gnuplotting.org/animation-gif/#comments</comments>
		<pubDate>Fri, 21 Oct 2011 14:13:53 +0000</pubDate>
		<dc:creator>hagen</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[animation]]></category>
		<category><![CDATA[bessel]]></category>
		<category><![CDATA[gif]]></category>
		<category><![CDATA[if]]></category>
		<category><![CDATA[load]]></category>
		<category><![CDATA[reread]]></category>

		<guid isPermaLink="false">http://gnuplot.kkdu.org/?p=134</guid>
		<description><![CDATA[For presentation or teaching purposes it can be useful to show not only a figure, but an animation to illustrate something more clear. There exists different possibilities to do this in Gnuplot. Today we will have a look at how to create a gif animation. Fig. 1 Animation of Bessel function (code to produce this [...]]]></description>
				<content:encoded><![CDATA[<p>For presentation or teaching purposes it can be useful to show not only a figure, but an animation to illustrate something more clear. There exists different possibilities to do this in Gnuplot. Today we will have a look at how to create a gif animation.</p>
<div class="figure">
    <img src="http://www.gnuplotting.org/figs/bessel.gif" alt="Bessel function" width="350"/>
<p class="caption">
        <strong>Fig. 1 </strong>Animation of Bessel function (<a href="http://www.gnuplotting.org/code/bessel.gnu" type="text/plain">code to produce this figure</a>, <a href="http://www.gnuplotting.org/code/bessel.plt">loop</a>)
    </p>
</div>
<p>Fig. 1 shows a gif animation of a Bessel function of first kind and zeroth order. Gnuplot has a gif output <code>terminal</code>, but the result will be smoother if we first create png files with Gnuplot and then the animated gif file with another program. In order to create a set of png files we have to loop through the time value <code>t</code> and different output files.</p>
<pre class="prettyprint">
# initializing values for the loop and start the loop
<span class="v">t</span> = 0
<span class="v">end_time</span> = 1
system('mkdir -p animation')
load 'bessel.plt'
</pre>
<p>The above code sets a start value for the running time variable <code>t</code> and the <code>end_time</code> variable at which the looping should be stopped. Then a folder for the output png files is created and the loop file <code>bessel.plt</code> is loaded. The content of this loop file is shown below.</p>
<pre class="prettyprint">
# bessel loop
<span class="v">t</span> = <span class="v">t</span> + 0.02
<span class="v">outfile</span> = sprintf('animation/bessel%03.0f.png',50*<span class="v">t</span>)
set output <span class="v">outfile</span>
splot <span class="v">u</span>*<span class="f">sin</span>(<span class="v">v</span>),<span class="v">u</span>*<span class="f">cos</span>(<span class="v">v</span>),<span class="f">bessel</span>(<span class="v">u</span>,<span class="v">t</span>) w pm3d ls 1
if(<span class="v">t</span>&lt;<span class="v">end_time</span>) reread;
</pre>
<p>Here we update the time <code>t</code>, create a file name with a different number and plot out Bessel function. Finally the last line checks if our time <code>t</code> is smaller than the <code>end_time</code> variable, and executes the loop again if this is the case.</p>
<p>After we have created the png files in the animation folder, we start <a href="http://www.gimp.org" target="_blank">GIMP</a> and load all the files as layers (File > Open as Layers). After this we save all layers together as an animated gif file.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gnuplotting.org/animation-gif/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>
