1
$\begingroup$

I show my data bellow, and I want to use ListPlot3D to make a plot of that data. In this process I have some problems that I will discuss them step by step:

list={{0., 0.2, 0.1}, {0., 0.4, 0.2}, {0., 0.6, 0.3}, {0., 0.8, 0.4}, {0., 
 1., 0.5}, {0., 1.2, 0.6}, {0., 1.4, 0.7}, {0., 1.6, 0.8}, {0., 1.8, 
 0.9}, {0., 2., 1.}, {0.2, 0., 0.0267949}, {0.2, 0.4, 
 0.0645751}, {0.2, 0.6, 0.14641}, {0.2, 0.8, 0.23589}, {0.2, 1., 
 0.32915}, {0.2, 1.2, 0.4245}, {0.2, 1.4, 0.52111}, {0.2, 1.6, 
 0.618535}, {0.2, 1.8, 0.716515}, {0.2, 2., 0.814889}, {0.4, 0., 
 0.0535898}, {0.4, 0.2, 0.0394449}, {0.4, 0.6, 0.0582576}, {0.4, 0.8,
 0.12915}, {0.4, 1., 0.208276}, {0.4, 1.2, 0.29282}, {0.4, 1.4, 
 0.381025}, {0.4, 1.6, 0.47178}, {0.4, 1.8, 0.564365}, {0.4, 2., 
 0.658301}, {0.6, 0., 0.0803848}, {0.6, 0.2, 0.0708497}, {0.6, 0.4, 
 0.0432236}, {0.6, 0.8, 0.0557439}, {0.6, 1., 0.12111}, {0.6, 1.2, 
 0.193725}, {0.6, 1.4, 0.27178}, {0.6, 1.6, 0.353939}, {0.6, 1.8, 
 0.43923}, {0.6, 2., 0.526943}, {0.8, 0., 0.10718}, {0.8, 0.2, 
 0.1}, {0.8, 0.4, 0.0788897}, {0.8, 0.6, 0.0450166}, {0.8, 1., 
 0.0544004}, {0.8, 1.2, 0.116515}, {0.8, 1.4, 0.184886}, {0.8, 1.6, 
 0.258301}, {0.8, 1.8, 0.335782}, {0.8, 2., 0.416553}, {1., 0., 
 0.133975}, {1., 0.2, 0.12822}, {1., 0.4, 0.111181}, {1., 0.6, 
 0.0834849}, {1., 0.8, 0.0460608}, {1., 1.2, 0.0535654}, {1., 1.4, 
 0.113553}, {1., 1.6, 0.178983}, {1., 1.8, 0.249}, {1., 2., 
 0.322876}, {1.2, 0., 0.16077}, {1.2, 0.2, 0.155969}, {1.2, 0.4, 
 0.141699}, {1.2, 0.6, 0.118335}, {1.2, 0.8, 0.0864471}, {1.2, 1., 
 0.0467437}, {1.2, 1.4, 0.0529964}, {1.2, 1.6, 0.111488}, {1.2, 1.8, 
 0.174773}, {1.2, 2., 0.242221}, {1.4, 0., 0.187564}, {1.4, 0.2, 
 0.183447}, {1.4, 0.4, 0.171179}, {1.4, 0.6, 0.151}, {1.4, 0.8, 
 0.123285}, {1.4, 1., 0.0885123}, {1.4, 1.2, 0.0472251}, {1.4, 1.6, 
 0.0525839}, {1.4, 1.8, 0.109967}, {1.4, 2., 0.171623}, {1.6, 0., 
 0.214359}, {1.6, 0.2, 0.210756}, {1.6, 0.4, 0.2}, {1.6, 0.6, 
 0.182255}, {1.6, 0.8, 0.157779}, {1.6, 1., 0.126908}, {1.6, 1.2, 
 0.0900331}, {1.6, 1.4, 0.0475825}, {1.6, 1.8, 0.0522712}, {1.6, 2., 
 0.108801}, {1.8, 0., 0.241154}, {1.8, 0.2, 0.23795}, {1.8, 0.4, 
 0.228377}, {1.8, 0.6, 0.212549}, {1.8, 0.8, 0.190652}, {1.8, 1., 
 0.162929}, {1.8, 1.2, 0.129671}, {1.8, 1.4, 0.0911993}, {1.8, 1.6, 
 0.0478585}, {1.8, 2., 0.0520259}, {2., 0., 0.267949}, {2., 0.2, 
 0.265065}, {2., 0.4, 0.25644}, {2., 0.6, 0.24216}, {2., 0.8, 
 0.222361}, {2., 1., 0.197224}, {2., 1.2, 0.16697}, {2., 1.4, 
 0.131846}, {2., 1.6, 0.0921216}, {2., 1.8, 0.0480779}};

1-The first question:

In an insane way, I have used the Toad answer for plotting:

ticks[min_, max_] := 
 Table[If[EvenQ[i], {i, i, .06, Red}, {i, i, .02, Blue}], {i, 
Ceiling[min], Floor[max], 1}];
With[{cf = Blend[{Blue, White, Red}, #] &, 
 data = Table[Sin[x y], {y, 0, 3, 0.1}, {x, 0, 3, 0.1}]}, 
 ListPlot3D[list, ColorFunction -> cf, PlotRange -> All, 
 AxesLabel -> {"i", "k", "\!\(\*SubscriptBox[\(P\), \(1\)]\)"}, 
 Ticks -> ticks[2, 1], 
 TicksStyle -> Directive[Black, 14, Bold, Thickness[0.003]], 
 AxesStyle -> Directive[Black, Bold, 14, FontFamily -> "Times"]]]

Sin[x y] is not related to my list but the code does not work by deleting that or being replaced by my list as data. I just want to use the color scheme (defined by Toad) because I like it. How can I use of this color scheme (or a more impactful one) without introducing Sin[x y]?

2- the second question:

(I Can't remember where I found ticks[min_, max_]) With ticks[min_, max_], I want to show more ticks on the axes of the plot and give them custom length and thickness, but there is no difference between ticks[2, 1] and ticks[2, 2] and ticks[5, 1].

3- The third question:

The shape of my plot is as shown bellow, but the axes labeling such as i, k, and P1 are encroaching on the numbers along the axes. I can separate them by using a smaller font, but I prefer the larger fonts as more readable. How can I adjust the distance between the labels and numbers?

polt

4- the fourth question:

I want to highlight the data on the plot which along a slice through the surface at j = 1, as shown bellow, but I am not able to show that. How can I do it?

enter image description here

$\endgroup$

1 Answer 1

5
$\begingroup$

Let me first of all note that using Mma requires some homework made. Most of the questions you put have the answers in the documentation. So, do have a look.

Your question 1: Sin has nothing to do with the color scheme. In the code you copied the latter is fixed by cf = Blend[{Blue, White, Red}, #] &, while data...only fixes the array of points presumably used in the example you site. You should have a look into Menu/Help/DocumentationCenter/ListPlot3D/Options/ColorFunction and probably into Menu/Help/DocumentationCenter/ColorSchemes to get more information and see "...more impactful design colored...". You will find a lot there.

Your 2nd question: You should check Menu/Help/DocumentationCenter/Ticks/Examples.

Your 3rd and 4th questions: First evaluate your cell contaning list and the function ticks definitions. Then let us form a list with k=0.....2 [0,2] and with just fixed i=1:

 list2 = Select[list, #[[1]] == 1 &]

(*   {{1., 0., 0.133975}, {1., 0.2, 0.12822}, {1., 0.4, 0.111181}, {1., 
  0.6, 0.0834849}, {1., 0.8, 0.0460608}, {1., 1.2, 0.0535654}, {1., 
  1.4, 0.113553}, {1., 1.6, 0.178983}, {1., 1.8, 0.249}, {1., 2., 
  0.322876}}   *)

Then evaluate the following:

    Show[{
  With[{cf = Blend[{Blue, White, Red}, #] &}, 
   ListPlot3D[list, ColorFunction -> cf, PlotRange -> All, 
    AxesLabel -> {Column[{Spacer[5], Style["i", 18, Italic]}], 
      Row[{Style["k", 18, Italic], Spacer[5]}], 
      Row[{Style["\!\(\*SubscriptBox[\(P\), \(1\)]\)", 18, Italic], 
        Spacer[10]}]}, Ticks -> ticks[2, 1], 
    TicksStyle -> Directive[Black, 14, Bold, Thickness[0.003]], 
    AxesStyle -> Directive[Black, Bold, 14, FontFamily -> "Times"]]],
  Graphics3D[{Yellow, Thickness[0.01], Line[list2]}]
  }]

yielding this.

enter image description here

Note that the offset of the i, k etc. from the axes is defined by the argument of Spacerin the constructs like

    Row[{Spacer[10], Style["k", 18, Italic]}]

while the yellow line - by the statement:

Graphics3D[{Yellow, Thickness[0.01], Line[list2]}]

Have fun!

Later edit: to address your later question. Try this:

Graphics3D[{Directive[Dashed, Purple, Thickness[0.005]], Line[list2]}]

giving the following:

enter image description here

$\endgroup$
5
  • $\begingroup$ I think All your address for help document center are similar. $\endgroup$ Sep 23, 2015 at 13:16
  • $\begingroup$ @Ackaran They all are in the DocumentationCenter, that is right. But they have all different last key word, or few last key words. That's, what counts. $\endgroup$ Sep 23, 2015 at 13:20
  • $\begingroup$ besides so much thanks for your help, an amazing problem please pay attention to: Graphics3D[{Dashed, Line[{{1, 1, -1}, {2, 2, 1}, {3, 3, -1}, {4, 4, 1}}]}]; But when I write Graphics3D[{Purple, Thickness[0.005], Line[list2], Dashed}]; Unfortunately, dashing doesn't work!!!! $\endgroup$ Sep 24, 2015 at 7:13
  • $\begingroup$ @Ackaran Welcome. Have a look at the edits for the last question. $\endgroup$ Sep 24, 2015 at 7:34
  • $\begingroup$ Nice, So much nice, $\endgroup$ Sep 24, 2015 at 16:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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