{"id":172,"date":"2016-12-20T15:25:30","date_gmt":"2016-12-20T13:25:30","guid":{"rendered":"http:\/\/benediktehinger.de\/blog\/science\/?p=172"},"modified":"2016-12-20T15:29:15","modified_gmt":"2016-12-20T13:29:15","slug":"eeg-contours-in-multiple-topoplots","status":"publish","type":"post","link":"https:\/\/benediktehinger.de\/blog\/science\/eeg-contours-in-multiple-topoplots\/","title":{"rendered":"EEG: Contours in multiple topoplots"},"content":{"rendered":"<h3>The problem<\/h3>\n<p>It is commonly accepted that axes of plots should align if data needs to be compared between subplots. But the default way on how multiple topoplots are plotted violates this principle. While usually the limits of the colormap are kept constant for all colormaps, the contours rarely are. This default plot looks similar to this one:<\/p>\n<p><a href=\"http:\/\/benediktehinger.de\/blog\/science\/upload\/sites\/2\/2016\/12\/topo_contour_01.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/benediktehinger.de\/blog\/science\/upload\/sites\/2\/2016\/12\/topo_contour_01-1024x69.png\" alt=\"\" width=\"1024\" height=\"69\" class=\"aligncenter size-large wp-image-173\" srcset=\"https:\/\/benediktehinger.de\/blog\/science\/upload\/sites\/2\/2016\/12\/topo_contour_01-1024x69.png 1024w, https:\/\/benediktehinger.de\/blog\/science\/upload\/sites\/2\/2016\/12\/topo_contour_01-300x20.png 300w, https:\/\/benediktehinger.de\/blog\/science\/upload\/sites\/2\/2016\/12\/topo_contour_01-768x51.png 768w, https:\/\/benediktehinger.de\/blog\/science\/upload\/sites\/2\/2016\/12\/topo_contour_01.png 1074w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/p>\n<h3>The solution<\/h3>\n<p>It is simple, keep the contours constant!<\/p>\n<p>In eeglab this is done using the <em>topoplot<\/em> function with the argument <code>'numcontours', linspace(-scale,scale,n_contours)<\/code> or similar. You can also use my new plotting script available <a href=\"http:\/\/github.com\/behinger\/eegvis\">here on github<\/a><br \/>\nSo if we would keep the values constant at which contours are generated it looks like this:<br \/>\n<a href=\"http:\/\/benediktehinger.de\/blog\/science\/upload\/sites\/2\/2016\/12\/topo_contour_02.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/benediktehinger.de\/blog\/science\/upload\/sites\/2\/2016\/12\/topo_contour_02-1024x69.png\" alt=\"\" width=\"1024\" height=\"69\" class=\"aligncenter size-large wp-image-174\" srcset=\"https:\/\/benediktehinger.de\/blog\/science\/upload\/sites\/2\/2016\/12\/topo_contour_02-1024x69.png 1024w, https:\/\/benediktehinger.de\/blog\/science\/upload\/sites\/2\/2016\/12\/topo_contour_02-300x20.png 300w, https:\/\/benediktehinger.de\/blog\/science\/upload\/sites\/2\/2016\/12\/topo_contour_02-768x51.png 768w, https:\/\/benediktehinger.de\/blog\/science\/upload\/sites\/2\/2016\/12\/topo_contour_02.png 1074w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/p>\n<h3>More ideas<\/h3>\n<p><a href=\"http:\/\/benediktehinger.de\/blog\/science\/upload\/sites\/2\/2016\/12\/topo_contour_03.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/benediktehinger.de\/blog\/science\/upload\/sites\/2\/2016\/12\/topo_contour_03-1024x65.png\" alt=\"\" width=\"1024\" height=\"65\" class=\"aligncenter size-large wp-image-175\" srcset=\"https:\/\/benediktehinger.de\/blog\/science\/upload\/sites\/2\/2016\/12\/topo_contour_03-1024x65.png 1024w, https:\/\/benediktehinger.de\/blog\/science\/upload\/sites\/2\/2016\/12\/topo_contour_03-300x19.png 300w, https:\/\/benediktehinger.de\/blog\/science\/upload\/sites\/2\/2016\/12\/topo_contour_03-768x49.png 768w, https:\/\/benediktehinger.de\/blog\/science\/upload\/sites\/2\/2016\/12\/topo_contour_03.png 1066w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a>Each topoplot has its individual color-limits. While the local (in a single topoplot) extremata a clearly visible, not much to compare between topoplots<br \/>\n<br \/>\n<a href=\"http:\/\/benediktehinger.de\/blog\/science\/upload\/sites\/2\/2016\/12\/topo_contour_04.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/benediktehinger.de\/blog\/science\/upload\/sites\/2\/2016\/12\/topo_contour_04-1024x65.png\" alt=\"\" width=\"1024\" height=\"65\" class=\"aligncenter size-large wp-image-176\" srcset=\"https:\/\/benediktehinger.de\/blog\/science\/upload\/sites\/2\/2016\/12\/topo_contour_04-1024x65.png 1024w, https:\/\/benediktehinger.de\/blog\/science\/upload\/sites\/2\/2016\/12\/topo_contour_04-300x19.png 300w, https:\/\/benediktehinger.de\/blog\/science\/upload\/sites\/2\/2016\/12\/topo_contour_04-768x49.png 768w, https:\/\/benediktehinger.de\/blog\/science\/upload\/sites\/2\/2016\/12\/topo_contour_04.png 1066w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a>Individual contours improve the readability of each map, but they do not add anything that eases the comparison.<br \/>\n<br \/>\n<a href=\"http:\/\/benediktehinger.de\/blog\/science\/upload\/sites\/2\/2016\/12\/topo_contour_05.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/benediktehinger.de\/blog\/science\/upload\/sites\/2\/2016\/12\/topo_contour_05-1024x69.png\" alt=\"\" width=\"1024\" height=\"69\" class=\"aligncenter size-large wp-image-177\" srcset=\"https:\/\/benediktehinger.de\/blog\/science\/upload\/sites\/2\/2016\/12\/topo_contour_05-1024x69.png 1024w, https:\/\/benediktehinger.de\/blog\/science\/upload\/sites\/2\/2016\/12\/topo_contour_05-300x20.png 300w, https:\/\/benediktehinger.de\/blog\/science\/upload\/sites\/2\/2016\/12\/topo_contour_05-768x51.png 768w, https:\/\/benediktehinger.de\/blog\/science\/upload\/sites\/2\/2016\/12\/topo_contour_05.png 1074w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a>Forcing the same color-limits in the colormap allows for direct comparison between topoplots. But whether the white of the 9th&#8217;s or the 12th&#8217;s topoplot is bigger is hard to tell.<br \/>\n<br \/>\n<a href=\"http:\/\/benediktehinger.de\/blog\/science\/upload\/sites\/2\/2016\/12\/topo_contour_06.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/benediktehinger.de\/blog\/science\/upload\/sites\/2\/2016\/12\/topo_contour_06-1024x65.png\" alt=\"\" width=\"1024\" height=\"65\" class=\"aligncenter size-large wp-image-178\" srcset=\"https:\/\/benediktehinger.de\/blog\/science\/upload\/sites\/2\/2016\/12\/topo_contour_06-1024x65.png 1024w, https:\/\/benediktehinger.de\/blog\/science\/upload\/sites\/2\/2016\/12\/topo_contour_06-300x19.png 300w, https:\/\/benediktehinger.de\/blog\/science\/upload\/sites\/2\/2016\/12\/topo_contour_06-768x49.png 768w, https:\/\/benediktehinger.de\/blog\/science\/upload\/sites\/2\/2016\/12\/topo_contour_06.png 1066w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a>Going back to individual colormaps, but keeping the same contours: This helps already a lot, I seem to abstract the colormap away a bit and use the contours for comparison<br \/>\n<br \/>\n<a href=\"http:\/\/benediktehinger.de\/blog\/science\/upload\/sites\/2\/2016\/12\/topo_contour_07.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/benediktehinger.de\/blog\/science\/upload\/sites\/2\/2016\/12\/topo_contour_07-1024x69.png\" alt=\"\" width=\"1024\" height=\"69\" class=\"aligncenter size-large wp-image-179\" srcset=\"https:\/\/benediktehinger.de\/blog\/science\/upload\/sites\/2\/2016\/12\/topo_contour_07-1024x69.png 1024w, https:\/\/benediktehinger.de\/blog\/science\/upload\/sites\/2\/2016\/12\/topo_contour_07-300x20.png 300w, https:\/\/benediktehinger.de\/blog\/science\/upload\/sites\/2\/2016\/12\/topo_contour_07-768x51.png 768w, https:\/\/benediktehinger.de\/blog\/science\/upload\/sites\/2\/2016\/12\/topo_contour_07.png 1074w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a>The opposite way, same color-limits but individual contours. Again I seem to rely more on the contours, in this case this is more confusing than before.<br \/>\n<br \/>\n<a href=\"http:\/\/benediktehinger.de\/blog\/science\/upload\/sites\/2\/2016\/12\/topo_contour_08.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/benediktehinger.de\/blog\/science\/upload\/sites\/2\/2016\/12\/topo_contour_08-1024x65.png\" alt=\"\" width=\"1024\" height=\"65\" class=\"aligncenter size-large wp-image-180\" srcset=\"https:\/\/benediktehinger.de\/blog\/science\/upload\/sites\/2\/2016\/12\/topo_contour_08-1024x65.png 1024w, https:\/\/benediktehinger.de\/blog\/science\/upload\/sites\/2\/2016\/12\/topo_contour_08-300x19.png 300w, https:\/\/benediktehinger.de\/blog\/science\/upload\/sites\/2\/2016\/12\/topo_contour_08-768x49.png 768w, https:\/\/benediktehinger.de\/blog\/science\/upload\/sites\/2\/2016\/12\/topo_contour_08.png 1066w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a>In the final plot colormap and contour are aligned. This enhances comparison between topoplots.<br \/>\n<br \/>\nOne problem with the same color-limits or the same contour lines between topoplots is, that large deflections could hide small ones. As in many cases, it depends on what features of the data you want to highlight. I recommend the final plot where contour and colormap align as the default.<\/p>\n<h3>Conclusion<\/h3>\n<p>If you are plotting multiple topoplots, try to keep the color-limits of the colormap as well as the contour levels constant<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The problem It is commonly accepted that axes of plots should align if data needs to be compared between subplots. But the default way on how multiple topoplots are plotted violates this principle. While usually the limits of the colormap are kept constant for all colormaps, the contours rarely are. This default plot looks similar to this one: The solution It is simple, keep the contours constant! In eeglab this is done using the topoplot function with the argument &#8216;numcontours&#8217;, linspace(-scale,scale,n_contours) or similar. You can also use my new plotting script available here on github So if we would keep&#8230;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-172","post","type-post","status-publish","format-standard","hentry","category-blog"],"_links":{"self":[{"href":"https:\/\/benediktehinger.de\/blog\/science\/wp-json\/wp\/v2\/posts\/172","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/benediktehinger.de\/blog\/science\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/benediktehinger.de\/blog\/science\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/benediktehinger.de\/blog\/science\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/benediktehinger.de\/blog\/science\/wp-json\/wp\/v2\/comments?post=172"}],"version-history":[{"count":0,"href":"https:\/\/benediktehinger.de\/blog\/science\/wp-json\/wp\/v2\/posts\/172\/revisions"}],"wp:attachment":[{"href":"https:\/\/benediktehinger.de\/blog\/science\/wp-json\/wp\/v2\/media?parent=172"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/benediktehinger.de\/blog\/science\/wp-json\/wp\/v2\/categories?post=172"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/benediktehinger.de\/blog\/science\/wp-json\/wp\/v2\/tags?post=172"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}