I tested "Elasticity with Mathematica" notebook (Mathematica 6) in Mathematica 11.3 and tested C05_stress_kirsch.nb, I added some trigger code to protected function in the tensor2analysis.m file, and then ran C05_stress_kirsch.nb. All of the output match with the original file, but it gave different result in either ContourPlot or Show function.

here is the sample that has different output code (link above to see full codes) :

SS = Stress /. myrule /. numrule;
SC = StressCart /. numrule;
d = 3;
g1 = ContourPlot[N[SC[[1, 1]]], {x, -d, d}, {y, -d, d}, 
   PlotPoints -> 50, Contours -> 50, Compiled -> True, 
   ContourShading -> True, ContourLines -> False, 
   ColorFunction -> (Hue[2/3 (1 - #)] &), DisplayFunction -> Identity];
g2 = Show[
   Graphics[{GrayLevel[1], Disk[{0, 0}, 1]}, AspectRatio -> Automatic,
     Axes -> Automatic], DisplayFunction -> Identity];
Show[{g1, g2}, DisplayFunction -> $DisplayFunction


here is the desired result :

enter image description here

and here is mine :

enter image description here


  • 2
    $\begingroup$ I assume you're referring to the white lobes around the disk in the bottom picture? My guess would be that the two version have different automatic plot ranges. You could try playing around with the option PlotRange -> {{-3, 3}, {-3, 3}, {zmin, zmax}}. It looks to me like part of the red region is getting cut off as it's either greater than zmax or less than zmin. Try changing zmin and zmax and see what you get. $\endgroup$ – MassDefect Feb 15 '19 at 1:49

Please try the option ClippingStyle with ContourPlot, for example


enter image description here


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.