-
-
Notifications
You must be signed in to change notification settings - Fork 364
Open
Description
At the moment it does not seem to be possible to use anything other than unicode symbols.
Using LaTeX strings as output of a labelformatter function crash contour() function.
Meaning that this does not work:
function Q1d(; N=50, h=1, EsmA = 0, a=1)
E(k) = EsmA + 2*h*( cos( k[1]*a ) + cos(k[2]*a) )
testX = [ pi/a*j/N for j in -N:N]
xx = [ [ testX[i] , testX[j] ] for i in 1:length(testX), j in 1:length(testX)]
Es = E.(xx)
levels = [ EsmA+2*h , EsmA+h , EsmA , EsmA-2*h ]
customLabels = [L"E-A+2h" ,L"E-A + h", L"E-A ", L"E-A -2h" ]
levelsVText = [ [levels[i], customLabels[i]] for i in 1:length(levels) ]
function labelformatter(aa)
return customLabels[ findfirst(==(aa) , levels ) ]
end
fig, ax, ct = contour(testX,testX,Es;levels=levels, labels=true, labelformatter)
return fig
end
Would it be possible to add this kind of functionality to contour?
Metadata
Metadata
Assignees
Labels
No labels