Plotting Parameter t vs. e1 Values

In summary, the user is looking to generate a plot with t on the x-axis and e1 values varying from 0 to 0.95. Their current code is plotting each of the 950 points on different graphs and they are seeking a solution to plot them on the same graph. The expert suggests creating a table of values first and then using ListPlot, and advises against using For[] and instead using Do[] or Table[].
  • #1
jemma
36
0
I would like to generate a plot displaying the parameter t on the x axis, varying from 0 to 0.95 and the corresponding values of e1. My code below does what I want (I think) but is plotting all the different points on different graphs (all 950 of them!). How can I get it to plot on the same graph? Thanks


For[i = 0, i ≤ 950, ++i,
ListPlot[e1 /. NSolve[{equ1 == 0, equ2 == 0, equ3 == 0}
/. t -> i/1000.0, {e1, e2, e3}]]]
 
Physics news on Phys.org
  • #2
Make your table of values first, then use ListPlot.
With out details of your code (or, better yet, a simplified example that shows the same issues) it is not worth trying to give you working code.

As an aside: don't use For[] unless you really need to test for some condition to end the loop. It's probably best to use Do[] or Table[] for the above type of problem.
 

1. What is the purpose of plotting parameter t vs. e1 values?

The purpose of plotting parameter t vs. e1 values is to visualize the relationship between these two variables and identify any patterns or trends in the data. This can help in understanding the behavior of the data and making informed decisions based on the insights gained from the plot.

2. How do I determine which variable should be plotted on the x-axis and which on the y-axis?

The variable that represents the independent or input parameter should be plotted on the x-axis, while the dependent or output parameter should be plotted on the y-axis. This convention allows for a clear understanding of cause and effect relationships between the variables.

3. Can I use any type of graph to plot parameter t vs. e1 values?

Yes, there are various types of graphs that can be used to plot these variables, such as line graphs, scatter plots, and bar graphs. The choice of graph will depend on the nature of the data and the specific objectives of the analysis.

4. What does a steep slope on the plot indicate?

A steep slope on the plot indicates a strong relationship between the two variables, where a change in one variable is associated with a significant change in the other variable. This can also indicate a high correlation between the variables.

5. How can I use the plot to make predictions about the data?

The plot can provide insights into the behavior of the data and help in identifying any patterns or trends. These insights can then be used to make informed predictions about future data points or to identify areas for further analysis and investigation.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
250
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
213
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
9
Views
4K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
12
Views
3K
  • Programming and Computer Science
Replies
2
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
8
Views
1K
Back
Top