nschloe/matlab2tikz — Issue #49: Crossing lines in contour plots when multiple isolines at same contour level
Author: drgz
Created: 2011-10-25 10:07:36+00:00
State: open

For contour plots with multiple isolines at a given contour level the m2t script (as per today) connects this isolines, producing straight lines in the plot which shouldn't be there: take a look at first figure at http://folk.ntnu.no/mitrevsk/m2t/contour_m2t_vs_pgfplots.pdf

By sorting the data in the contour plot before writing it to the TikZ-file one may avoid this, look at second figure in same pdf (link above).

For this plot I've just used the the built in options for contour plots, and specifying how the format of the data is (compare http://folk.ntnu.no/mitrevsk/m2t/m2t_result.tikz and http://folk.ntnu.no/mitrevsk/m2t/pgfplots_result.tikz). *.dat file for pgfplots_result.tikz is also available at http://folk.ntnu.no/mitrevsk/m2t/, together with the sorting algorithm I used in MATLAB in order to do the sorting. If desirable to test for yourself, all other data and scripts for making it is also available in the same directory.