<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=iso-8859-1"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
{font-family:Verdana;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
p
{mso-style-priority:99;
margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman",serif;}
span.EmailStyle18
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link="#0563C1" vlink="#954F72"><div class=WordSection1><p class=MsoNormal>Hi Ben,<br><br>nice to see here, and that you are actively using FieldTrip ;)<br>My guess is that the error occurs because you have negative values that you want to transform, e.g. because you are taking a contrats between conditions. Converting to decibels involves taking the logarithm, and the logarithm of negative numbers is not good (i.e. you get complex numbers out). A simple solution is to first take the logarithm of e.g. individual conditions and then subtract or, which is equivalent, dividing the two conditions from one another and then taking the logarithm.<br><br>Best,<br>Jörn<span lang=NL style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><o:p></o:p></span></p><p class=MsoNormal><span lang=NL style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><o:p> </o:p></span></p><div><p class=MsoNormal><b><span style='font-size:9.0pt;font-family:"Verdana",sans-serif;color:#626264;mso-fareast-language:NL'>--<o:p></o:p></span></b></p><p class=MsoNormal><b><span style='font-size:9.0pt;font-family:"Verdana",sans-serif;color:#255A9E;mso-fareast-language:NL'><o:p> </o:p></span></b></p><p class=MsoNormal><b><span style='font-size:9.0pt;font-family:"Verdana",sans-serif;color:#255A9E;mso-fareast-language:NL'>Jörn M. Horschig</span></b><span style='font-size:9.0pt;font-family:"Verdana",sans-serif;color:#626264;mso-fareast-language:NL'>, Software Engineer</span><b><span style='font-size:9.0pt;font-family:"Verdana",sans-serif;color:black;mso-fareast-language:NL'><o:p></o:p></span></b></p><p class=MsoNormal><span lang=NL style='font-size:9.0pt;font-family:"Verdana",sans-serif;color:#626264;mso-fareast-language:NL'><a href="http://www.artinis.com/"><span lang=EN-US style='color:#626264'>Artinis Medical Systems</span></a></span><span style='font-size:9.0pt;font-family:"Verdana",sans-serif;color:#626264;mso-fareast-language:NL'> | +31 481 350 980 </span><b><span style='font-size:9.0pt;font-family:"Verdana",sans-serif;color:#255A9E;mso-fareast-language:NL'><o:p></o:p></span></b></p></div><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><o:p> </o:p></span></p><div style='border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt'><div><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'>From:</span></b><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'> fieldtrip-bounces@science.ru.nl [mailto:fieldtrip-bounces@science.ru.nl] <b>On Behalf Of </b>van Lier Ben<br><b>Sent:</b> Tuesday, November 25, 2014 1:44 PM<br><b>To:</b> fieldtrip@science.ru.nl<br><b>Subject:</b> [FieldTrip] baselinetype decibel and plotting error<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Tahoma",sans-serif;color:black'>Hi,<br><br>I would like to plot my data in decibel. It works fine when running singleplotTFR, however I get an error when i use the plot interactivity to select a time/freq range within the singleplotTFR. The resulting topoplot has no color (it does show the contourlines of the data) and the layout outline is stretched (should be square).<br><br>running topoplotTFR directly works fine and using the other baselinetypes is also no problem. the error is only when interacting with a spectrogram in decibel.<br><br><br>Error using surf (line 75)<br>X, Y, Z, and C cannot be complex<br><br>Error in ft_plot_topo (line 251)<br> h = surf(Xi-deltax/2,Yi-deltay/2,zeros(size(Zi)), Zi, 'EdgeColor', 'none', 'FaceColor', shading);<br><br>Error in topoplot_common (line 704)<br> ft_plot_topo(chanX,chanY,datavector,'interpmethod',cfg.interpolation,...<br><br>Error in ft_topoplotTFR (line 186)<br>[cfg] = topoplot_common(cfg, varargin{:});<br><br>Error in ft_singleplotTFR>select_topoplotTFR (line 579)<br>ft_topoplotTFR(cfg, varargin{:});<br><br>Error in ft_select_range>evalCallback (line 325)<br> feval(funhandle, funargs{:}, val, cmenulab);<br><br>Error in ft_select_range (line 159)<br> evalCallback(callback, userData.range);<br> <br>Error while evaluating figure WindowButtonDownFcn<br><br><br>its not the end of the world, but its such a nice feature to have...<br><br>thank you,<br><br>Ben<o:p></o:p></span></p></div></div></div></body></html>