New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Levels in contourf #1140
Comments
The error message from Matlab is as follows: `Error using vertcat Error in matlab2tikz>drawFilledContours (line 3013) Error in matlab2tikz>drawContourHG2 (line 2879) Error in matlab2tikz>drawContour (line 2826) Error in matlab2tikz>handleObject (line 3172) Error in matlab2tikz>drawHggroup (line 3103) Error in matlab2tikz>handleObject (line 3172) Error in matlab2tikz>handleAllChildren (line 697) Error in matlab2tikz>drawAxes (line 892) Error in matlab2tikz>saveToFile (line 485) Error in matlab2tikz (line 337) Error in Untitled (line 9) |
Forgive me if I use Github in the wrong way here, spamming my own thread as I take steps in the troubleshooting. The error happens when backdrop is generated. backdrop is a 2x5 matrix where the bottom 4 rows are the x and y coordinates of the corners of the plot area. The error happens in the first row when LevelList contain more than 1 entries MORE than Levels have. The lists seem to be the same if Levels (given in the contourf-fuction originally) has values that are within the minimum and maximum values in the plot. But if Levels have values that extend outside of the data in the plot, these vectors do not match and the setdiff-function returns a vector with more than one value, making the first row of the backdrop matrix too long (the other rows are only 2 values long). (rows 3013:3017) |
I get an error in Matlab when tring to generate a tikz-file from a contourf-figure containing levels.
Example below. If I take away the levels it works. If I make contour instead of contourf (the f for fill is the difference), it works. But not like this.
`x = [0 1 2];
y = [1 2];
d = [1 2 2; 2 2 3];
levels = 0:0.5:3;
close all
figure()
contourf(x,y,d,levels)
matlab2tikz('testcontour.tikz','showinfo',false)`
The text was updated successfully, but these errors were encountered: