Ansys Learning Forum › Forums › Discuss Simulation › General Mechanical › Inversed Contour Legend Issue in MAPDL When Changing Legend Position › Reply To: Inversed Contour Legend Issue in MAPDL When Changing Legend Position
November 5, 2024 at 5:08 pm
wrbulat
Ansys Employee
Hello there,
Erik posted your request internally to us, his coworkers. After a lot of trial and error, I came up with something that might work for you:
Â
Please copy the listing below into a text file and then read that file into an interactive MAPDL session with the /INPUT command.
fini
/cle
Â
/vie,1,1,1,1
/vup,1,z
Â
/prep7 ! TEST MODEL
bloc,,1,,1,,5
et,1,278
mp,kxx,1,60
vmes,all
nsel,s,loc,z
d,all,temp,22
nsel,s,loc,z,5
d,all,temp,100
alls
fini
Â
/solu ! SOLVE
alls
solv
fini
Â
/post1 ! POST PROCESSING
Â
Â
Â
C*** FIRST CONTOUR PLOT USING DEFAULT COLORS, LEGEND NOT DISPLAYED
/plo,info,3
/plo,leg3,off
plns,temp
/wait,2
Â
*get,minval,plns,,min ! minval = LOWEST NUMBER IN PREVIOUS CONTOUR PLOT
*get,maxval,plns,,max ! maxval = HIGHEST NUMBER IN PREVIOUS CONTOUR PLOT
Â
Â
C*** SECOND CONTOUR PLOT, ONLY LEGEND DISPLAYED w/REVERSED NUMBERS AND COLORS
/noe ! DON'T ERASE SCREEN
/plo,leg3,on ! DISPLAY LEGEND THIS TIME
/foc,1,5,,,1 ! SEND MODEL OUT OF FRAME OF GRAPHICS WINDOW
/udoc,1,cntr,left ! DISPLAY CONTOUR LEGEND ON LEFT
/contour,1,9,maxval,(maxval-minval)/9,minval ! REVERSE NUUMBERING ON CONTOUR LEGEND
Â
/COLOR,CNTR,RED,1Â Â ! REVERSE COLOR ASSIGNMENT ON CONTOUR LEGEND
/COLOR,CNTR,ORAN,2Â Â
/COLOR,CNTR,YELL,3Â Â
/COLOR,CNTR,YGRE,4Â Â
/COLOR,CNTR,GREE,5Â Â
/COLOR,CNTR,GCYA,6Â Â
/COLOR,CNTR,CYAN,7Â Â
/COLOR,CNTR,CBLU,8Â Â
/COLOR,CNTR,BLUE,9Â Â
Â
plns,temp ! CREATE CONTOUR PLOT (MODEL NOT SHOWN, JUST LEGEND)
Â
/reset ! RESET ALL GRAPHICS SETTINGS
Â
Â
/eof
Â
I hope this works for you.
Kind regards,
Bill
Â