Find Max & Min Y-Axis Values on 2D Plots with Mathematica

  • Mathematica
  • Thread starter natski
  • Start date
  • Tags
    Mathematica
In summary: Yes, it is possible to have the ToString function replace the '10% Complete' message.Great, thank you very much!
  • #1
natski
267
2
I wanted to know whether it was possible for Mathematica to give you an exact read out of the maximum and minimum y-axis values on a 2D plot?

I have tried Maximize function but it seems to think there are imaginery parts in my function (which there are not or how would it plot the function in the first place) and so refuses to work out the maximum.

What I'm looking for is a way to plot the graph and then simply read off the max and min values with speed and accuracy.

Thanks
Natski
 
Physics news on Phys.org
  • #2
Maximize should work. Perhaps you should provide us with the function you're trying to work with.

- Warren
 
  • #3
Sorry I can't supply you with the function, but suffice to know that maximize does not work because it thinks the function has imaginery parts depsite the fact I implicity select Maximize[Re[f],x]. However, FindMaximum does seem to give a good numerical estimate.

As an aside on forming 'programs' in Mathematica, I want to hide a calculation output since it's several pages long and completely useless to see the result anyway. Is there a way of 'hiding' the result of a calculation from view?
 
  • #4
I think there are 2 things here.

One if the output is too long you could use the Short function(something like:
Code:
Short[your_function,number_of_lines_you_want_to_see]
)

or maybe the Shallow function (don't really remember how that works).

If you don't whant to se the out put it might be good to use := instead of =
As for really hiding the output I never heard of a way aldo that doesn't mean there isn't one.
 
  • #5
natski said:
As an aside on forming 'programs' in Mathematica, I want to hide a calculation output since it's several pages long and completely useless to see the result anyway. Is there a way of 'hiding' the result of a calculation from view?
IIRC, to hide the output, simply put a semi colon at the end of the statement.
 
  • #6
Excellent, thank-you very much Fred. I don't suppose I could trouble you also on how you create a text message? I've tried Print, StylePrint, Message,etc but they all seem to want to print expressions rather than just plain text.

Natski
 
  • #7
I actually think I may have stumbled across the solution myself, I think it's Print["text here"]
 
  • #8
Maybe you could try the ToString function (checkout: http://documents.wolfram.com/v4/RefGuide/ToString.html" for more information).
 
Last edited by a moderator:
  • #9
I think the Print function works fine for my purposes. I'm have 10 parts to a lengthy calculation and I simply want to print out '10% complete', etc at each part of the calculation. What would be really useful is if when '20% Complete' message appears it automatically replaces the '10% Complete' message. Is that possible?

Natski
 

1. What is Mathematica and how can it be used to find the maximum and minimum y-axis values on 2D plots?

Mathematica is a powerful computational software program used by scientists, engineers, and mathematicians for various tasks such as data analysis, visualization, and solving complex equations. It can also be used to create 2D plots and has built-in functions to easily find the maximum and minimum y-axis values on these plots.

2. How do I input data into Mathematica to create a 2D plot?

To create a 2D plot in Mathematica, you first need to input your data into a table or list format. This can be done manually or by importing data from an external file. Once your data is in the correct format, you can use the built-in ListPlot function to create a 2D plot.

3. Can Mathematica handle large datasets for finding maximum and minimum y-axis values?

Yes, Mathematica is capable of handling large datasets for finding maximum and minimum y-axis values. However, the time it takes to calculate these values may vary depending on the complexity of the dataset and the processing power of your computer.

4. Are there any limitations to using Mathematica for finding maximum and minimum y-axis values?

While Mathematica is a powerful tool for data analysis and visualization, it may not be the best choice for finding maximum and minimum y-axis values in certain cases. For example, if your data has a lot of noise or outliers, you may need to use other statistical methods to accurately determine the maximum and minimum values.

5. Can Mathematica be used to find maximum and minimum y-axis values for non-linear plots?

Yes, Mathematica has functions that can find the maximum and minimum y-axis values for non-linear plots as well. These functions take into account the curvature of the plot and can accurately determine the maximum and minimum values. However, it is important to ensure that your data is properly formatted and any outliers have been removed before using these functions.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
2K
Replies
4
Views
871
  • MATLAB, Maple, Mathematica, LaTeX
Replies
12
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
4K
  • Calculus and Beyond Homework Help
Replies
5
Views
935
  • Programming and Computer Science
Replies
6
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
24K
Back
Top