Phi St

## 45 Reputation

4 years, 273 days

## @Carl Love  Updated. It is a squar...

Updated. It is a square.

## @acer  Thank you a lot. That is wh...

Thank you a lot. That is what I am looking for. Unfortunately, I am using the older Maple version. I can not run the "CP" function. Anyway, I appreciate your kind help very much!

## @acer  Sorry for the unclear of th...

Sorry for the unclear of the question. I have updated the question. Thank you for your help always.

## @acer  I see. It works. Thank you ...

I see. It works. Thank you very much again for your kind help!

Thank you for your reply. I am sorry that perhaps I didn't make my question clear.

I want to plot the 2d contour (x-y plane) in which the color of the line of the 2d contour is same as that in the 3d plot.

Thank you a lot for your help!

## @Kitonum & @Carl Love ...

Thank you for both of your help very much!

## @acer I found the label after the t...

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"]

);

## @tomleslie Thank you for your help....

Thank you for your help. It works.

## @acer  Thank you very much! I appr...

Thank you very much! I appreciate your kind help.

## @acer  Thank you very much for your...

@acer  Thank you very much for your help !

Can I project this two-dimensional contour plot (graph of x-t) on the bottom of a three dimensional plot (graph of u versus x-t)? i.e. a graph shows both the topology and the countours. Thank you again.

## @acer It works as well and it is ni...

@acer It works as well and it is nice.

I appreciate both of your kind help (@tomleslie & @acer) very much.