Mathematica Creating a Plot in Two Variables - A Guide

  • Thread starter Thread starter Safinaz
  • Start date Start date
  • Tags Tags
    Plot
Click For Summary
To create a plot similar to the one in arXiv:1312.1935, Figure 2, a user initially attempted to use ListPlot but encountered limitations since it is designed for one-variable data. The discussion highlights that for plotting a function of two variables, a 3D ListPlot is more appropriate. The user is advised to use a Table to generate data points and apply styles to represent the function visually with color coding based on its values. The conversation also references a method for plotting multiple datasets on the same graph, suggesting that users can find elegant solutions for complex visualizations in Mathematica. Overall, the focus is on effectively utilizing Mathematica's plotting capabilities to achieve the desired representation of a two-variable function.
Safinaz
Messages
255
Reaction score
8
Hi all,

I'd like to make a plot like that in [arXiv:1312.1935], FiG. (2), it's a function plotted in a plan of two variables.

I tried :

* ListPlot: for example;

##\lambda##[s_,f_]= s+f;
list1 = Table[{s, f, ##\lambda##[s, f]}, {s, -1, 1, 0.1}, {f, -1, 1, 0.1}];
ListPlot[list1]

But it dosn't work, cause I think ListPlot like that works for one variable.

Also, There is RegionPlot, but it gives a continuous coloured region, while i'd like to have the function as 'dotes' as the green and red in the FIG.

Any help ?
 
Physics news on Phys.org
Safinaz said:
list1 = Table[{s, f, ##\lambda##[s, f]}, {s, -1, 1, 0.1}, {f, -1, 1, 0.1}]
Instead try:

Code:
list1 = Table[Style[{s, f},Hue[ ##\lambda##[s, f]], {s, -1, 1, 0.1}, {f, -1, 1, 0.1}]

A similar example is shown in the documentation for ListPlot
 
Thanks :)
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 5 ·
Replies
5
Views
1K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 10 ·
Replies
10
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K