1
$\begingroup$

I have data from a stress-strain simulation of a washer: Please download it here: https://expirebox.com/download/46f2e72dd2bd04e857e9209b78f40ddf.html

The output should look like this:

enter image description here

I am trying to recreate the plot with Mathematica using the data which I got from the simulation software .

I am using ListDensityPlot with 0 InterpolationOrder. Also I found the maximum stress by computing:

MapThread[Max, data]

Which got me about 83. Therefore, I mapped the blue color from the visible spectrum to 0 and the red one to 83. ... but as you can see the result is very different:

enter image description here

The color should be red in the middle as there is the maximum stress but there is no red and also all other colors are somehow off ??

This is how I created the plot:

ListDensityPlot[data, InterpolationOrder -> 0,
 ColorFunction -> (ColorData["VisibleSpectrum"][
     Rescale[#, {0, 83}, {400, 700}]] &), ColorFunctionScaling -> False
 ]

Can anyone please help me ?

$\endgroup$
  • $\begingroup$ Using the color theme from this post, then ListDensityPlot[data, InterpolationOrder -> 0, PlotRange -> All, ColorFunction -> JetCM, PlotLegends -> Automatic] produces this plot. I don't see the high values on the side like in your plot. $\endgroup$ – Jason B. Jul 25 '18 at 15:22
  • $\begingroup$ @JasonB. Thanks for your comment. This is interesting, because it was made using the same data but plotted by the simulation software. Maybe they use a non-linear color scale ? ...and what is JetCM ? It does not work for me. $\endgroup$ – james Jul 25 '18 at 15:51
  • $\begingroup$ JetCM is the popular Jet color map implemented in Mathematica, it's defined in the post I linked above. I used it because your example plot seems to use it. I actually prefer the default color map used by ListDensityPlot to Jet, but that is just a preference $\endgroup$ – Jason B. Jul 25 '18 at 15:58

Your Answer

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

Browse other questions tagged or ask your own question.