Group Abstract Group Abstract

Message Boards Message Boards

0
|
3.9K Views
|
1 Reply
|
0 Total Likes
View groups...
Share
Share this post:

Plot equation with three variables using ListPlot3D?

Posted 5 years ago

Good evening, I contact you to ask for help. Given the file :

A= {{"\[Lambda]", "zo", "K1", "zmax", "val2", "val3", "Index"}} ,

I created a graph in which I plotted the three variables "[Lambda]", "zo", and "val1". I wrote:

p1 = ListPlot3D[A[[All, {1, 2, 4}]], PlotRange -> All, Mesh -> True, ColorFunction -> "Rainbow", AxesStyle -> Directive[14], AxesLabel -> {Style["\[Lambda]  (s)", 16], Style["zo  (m)", 16], Style["zmax  (m)", 16],}, ViewPoint -> {1, 2, 1.3}] 

and it worked. Now I want to do the same, but getting a different graph for each value of k1. A graph in which to plot the three variables with k1 = 1, another with k1 = 2, etc ... Can someone help me?

POSTED BY: salvatore longo
Posted 5 years ago

See if this will work with your data

A= RandomInteger[{2,6},{200,7}]; (* random data generated to test the code *)
allk1values=DeleteDuplicates[A[[All,3]]]; (* find unique k1 values *)
onelist[v_]:=Select[A,#[[3]]==v&]; (* extract list of points for one k1 value *)
alllists=Map[onelist,allk1values]; (* extract list of points for every k1 value *)
Map[Print[ListPlot3D[#[[All, {1, 2, 4}]]]]&,alllists]; (* display plots *)
POSTED BY: Bill Nelson
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard