Message Boards Message Boards

GROUPS:

Plot a free energy landscape?

Posted 1 month ago
297 Views
|
4 Replies
|
0 Total Likes
|

Most times I get the correct rainbow colors of the Gibbs free energies. But some data is giving me a different image. I don't know what to change.

please, I very new to Mathematica.

I have attached the following: The .nb file I am using. The image I'm getting (amber12_23) The image I expect (FEL) the data (amber12_23.txt)

Any help will be appreciated.

4 Replies

Hi Lucy,

if I execute you code I do get the desired/expected result (i.e. similar to FEL.tiff). Maybe you need to make a clean start (e.g. by executing ClearAll["Global`*"] at the beginning of you notebook). And the PlotRange option is not really needed.

Regards -- Henrik

Thank you Henrik. But it has refused to work. I have even "quit the kernel" to completely refresh but it's not working. Maybe could be the version of the Mathematica? I'm using 10.2

Well, strange, I do not have any idea of what the problem could be here. I was trying this successfully on v11.3 and v12.0. Instead of using ListContourPlot: Does probably ContourPlot work for you?, e.g.

fel = Interpolation[{{#1, #2}, #3} & @@@ arrayData];
ContourPlot[fel[\[FormalX], \[FormalY]], 
 Evaluate[Sequence @@ 
   MapThread[Prepend, {First[fel], {\[FormalX], \[FormalY]}}]], 
 ColorFunction -> ColorData["Rainbow"], ContourStyle -> None, 
 FrameLabel -> {"PC2", "PC3"}, GridLines -> Automatic, 
 LabelStyle -> {FontSize -> 20, FontFamily -> "Times", Black, Bold},
 PlotRange -> All, 
 FrameTicks -> {{{0.4, 0.6, 0.8, 1.0, 1.2, 1.4}, 
    None}, {{0.4, 0.6, 0.8, 1.0, 1.2, 1.4}, None}}, 
 PlotLabel -> Style["FEL: Amber/Tip4p-eW", FontSize -> 18], 
 PlotLegends -> 
  BarLegend[All, LegendLabel -> "kJ/mol", 
   LabelStyle -> {Bold, Black, "Times", Bold[0.3], 18}]]

EDIT:

What happens when you use your original code with:

ListContourPlot[(*bla bla*), PlotRange->All]

Dear Henrik! I have used your code and it has worked!!!!

Also, PlotRange -> All, has worked fine with my code!

I'm grateful, Thank you so much!!

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract