Finding Max/Min Y-Axis Values in Mathematica Plots

  • Mathematica
  • Thread starter natski
  • Start date
  • Tags
    Mathematica
In summary, the user is trying to find a way to get an exact readout of the maximum and minimum y-axis values on a 2D plot in Mathematica. They have tried using the Maximize function but have encountered issues with imaginary parts in their function. They have also tried using the FindMaximum and FindMinimum functions, and using the RealValued function from the Algebra`ReIm` package, but have not had success. They are seeking further advice or alternative methods to achieve their goal.
  • #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. Even if I try and Maximise the real part of my function it doesn't work.

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 and perhaps even form another plot of contrast (max-min) vs another variable in the formula.

Thanks
Natski
 
Physics news on Phys.org
  • #2
It might help us you tell us what your function is, if for whatever reason you can't than I can only give you some general advice.

First you could try something like:
Code:
Re[your_function]

This should get read of the imaginery parts.

Secondly it might be a good idea to use the FindMaximum and FindMinimum functions (the FindMaximum is new in version 5.0 so if you have an older version perhaps FindMinimum[-your_function] would be a good alternative) with the x_min,x_max options of your Plot (something like this:
Code:
FindMinimum[f, {x,x_0 ,x_min , x_max}]
). I however don't remember if this function returns one or more minimums (maximums) so you might think about using other mathods such as deriveing the function if you only get one minimum when there are obvieusly more. As for finding the max and min from a graph I think it's hard to do an acctually not a good idea in the first place becouse the Plot function isn't meant to be used in such a way and could in some cases also produce errors (becouse of the PlotPoints option ).

If nothing helps try posting agein and explain the problem in more detail or try finding help at:

http://www.wolfram.com/
 
Last edited:
  • #3
The function is several pages long and repeatedly has parts like:
(1.3+0.0i)sin(...)

So there are already no imaginery parts. However, if I take the real part of my function, the same expression is produced, as in 0.0i. So when I try and use maximize function, it tells me there are imaginery parts, even though I am using the specific Real part!

Natski
 
  • #4
Have you thought about using the <<Algebra`ReIm` package? There are some things there that you might find useful (perhaps RealValued).
 

Related to Finding Max/Min Y-Axis Values in Mathematica Plots

What is the purpose of finding the maximum and minimum y-axis values in Mathematica plots?

Finding the maximum and minimum y-axis values in Mathematica plots can help identify the range of values represented in the plot and provide a better understanding of the data being presented. It can also help with data analysis and comparison between different plots.

How do I find the maximum and minimum y-axis values in a Mathematica plot?

To find the maximum and minimum y-axis values in a Mathematica plot, you can use the built-in functions MaxValue and MinValue. These functions take in the plot as an argument and return the maximum and minimum values respectively. Alternatively, you can also use the PlotRange option to specify the desired range of values for the y-axis.

Can I customize the maximum and minimum y-axis values in a Mathematica plot?

Yes, you can customize the maximum and minimum y-axis values in a Mathematica plot by using the PlotRange option. This allows you to specify the desired range of values for the y-axis, giving you more control over the appearance of the plot.

What should I do if the automatic y-axis range in my Mathematica plot is not suitable for my data?

If the automatic y-axis range in your Mathematica plot is not suitable for your data, you can manually set the y-axis range using the PlotRange option. You can also use the MaxValue and MinValue functions to determine the appropriate range of values for your data.

Is it possible to find the maximum and minimum y-axis values for specific regions in a Mathematica plot?

Yes, it is possible to find the maximum and minimum y-axis values for specific regions in a Mathematica plot. You can use the RegionFunction option to specify the desired region, and then use the MaxValue and MinValue functions to find the maximum and minimum values for that region.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
4K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
8
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
3K
  • High Energy, Nuclear, Particle Physics
Replies
4
Views
1K
  • Calculus and Beyond Homework Help
Replies
5
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
5K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
4K
Back
Top