@acer

I found the label after the transformation is disappeared as shown as follows. How do I solve it? Thank you.

The codes are as follows:

****************************************************

with(plots);

Eqn01:=sqrt((1+48/(-8*X^2+16*X*t-24*t^2-12))^2+1024*X^2/(-8*X^2+16*X*t-24*t^2-12)^2);

x:=X+t+(16*(-2*t*(-1-I*sqrt(2))*(-1+I*sqrt(2))-X*(-1-I*sqrt(2))-X*(-1+I*sqrt(2))))/(-(4*(-1-I*sqrt(2)))*(-1+I*sqrt(2))-(8*(-t*(-1+I*sqrt(2))-X))*(-t*(-1-I*sqrt(2))-X));

**ContoursWithLabels**:= proc(

Expr::algebraic,

Range1::(name= range(realcons)), Range2::(name= range(realcons)),

{contours::{posint, {set,list}(realcons)}:= 8},

{ImplicitplotOptions::{list,set}({name, name= anything}):= NULL},

{GraphicOptions::{list,set}({name, name= anything}):= NULL},

{TextOptions::{list,set}({name, name= anything}):= NULL},

{Coloring::{list,set}({name, name= anything}):= NULL}

)

local

r1, r2, f, L1, h, S1, P, r, M, C, T, p, p1, m, n, i,

x:= lhs(Range1), y:= lhs(Range2)

;

f:= unapply(Expr, (x,y));

if contours::posint then

r1:= rand(convert(rhs(Range1), float));

r2:= rand(convert(rhs(Range2), float));

L1:= select(type, (f@op)~({seq([r1,r2](), i= 1..205)}), realcons);

h:= (L1[-6]-L1[1])/contours;

S1:= [seq(L1[1]+h/2+h*(n-1), n= 1..contours)]

else #contours::{set,list}(realcons)

S1:= [contours[]]

end if;

userinfo(1, ContoursWithLabels, print('Contours' = evalf[2](S1)), `\n`);

r:= k-> rand(20..k-20);

for C in S1 do

P:= plots:-implicitplot(

Expr = C, Range1, Range2,

gridrefine= 3, ImplicitplotOptions[]

);

for p in [plottools:-getdata(P)] do

p1:= convert(p[3], listlist);

n:= nops(p1);

if n < 500 then

m:= `if`(40 < n, r(n)(), round(n/2));

M[`if`(40 < n, [p1[1..m-11], p1[m+11..n]], [p1])[]]:= NULL;

T[[p1[m][], evalf[2](C)]]:= NULL

else

h:= trunc(n/2);

m:= r(h)();

M[p1[1..m-11], p1[m+11..m+h-11], p1[m+h+11..n]]:= NULL;

T[[p1[m][], evalf[2](C)], [p1[m+h][], evalf[2](C)]]:= NULL

end if

end do

end do;

plots:-display(

[`if`(

Coloring = NULL,

NULL,

plots:-densityplot(Expr, Range1, Range2, Coloring[])

),

plot([indices(M, 'nolist')], color= black, GraphicOptions[]),

plots:-textplot([indices(T, 'nolist')], TextOptions[])

], 'axes'= 'box', 'gridlines'= false, _rest

)

end proc:

conts1:=[0.1, 0.3, 0.5, 0.7, 0.9, 1.3, 2.0];

Pft := **ContoursWithLabels**(

Eqn01,**X**=-20..20, t=-20..20, contours= conts1,

TextOptions=[font=[HELVETICA,BOLD,10], color= black],

ImplicitplotOptions=[gridrefine=4],

GraphicOptions=[thickness=0],

labelfont=[TIMES,BOLDITALIC,10], axesfont=[HELVETICA,18]);

P2D1 :=plots:-display(

plottools:-transform((a,b)->eval([x,t],[** X** =a,**t**=b]))(Pft),

labels=["x","t"]

);