How to Solve Plotting Issues in Mathematica 7?

  • Thread starter k_squared
  • Start date
  • Tags
    Plotting
In summary, to plot the point (-3,f(-3)) on the same graph as f using Mathematica 7, we need to define our function f(x) using the syntax f[x_]:=x^3+4x^2-6, plot it using the Plot function, and then use the Show function to combine it with the point (-3,f(-3)) plotted using the Graphics and Point functions. We can also use the PlotRange option to adjust the y-axis range to include the point.
  • #1
k_squared
64
0
[solved] Mathmatica 7... Plotting Issue

Homework Statement


Plot the point (-3,f(-3)) on the same graph as f (using Mathmatica 7.)


Homework Equations



f(x)=x^3+4x^2-6

The Attempt at a Solution



A red box, or a graph without a box:
Graphics[Point[{5, 10}], Plot[x^2, {x, -15, 15}, PlotRange -> {-10, 10}]]

Depending on the order of Point and Plot.

And thanks for any help!

FIXED:

I don't have it in front of me, but try to remember,

mygraph = Plot[x^3+4x^2-6, {-15, 15}, PlotRange -> {-10, 10}]]
mypoint=Graphics[Point[{3,#^3+#x^2-6&[-3]}]]
Show[mygraph, mypoint]

You can ignore the plotrange stuff.
 
Last edited:
Physics news on Phys.org
  • #2


Hello,

Thank you for bringing this issue to our attention. I am a scientist who specializes in using Mathematica for data analysis and visualization. I understand that you are having trouble plotting a point on the same graph as your function f(x). Let me walk you through the steps to solve this issue.

First, we need to define our function f(x) using the syntax f[x_]:=x^3+4x^2-6. This tells Mathematica that f is a function of x and the right side of the equation is the expression for f(x). Next, we need to plot our function using the Plot function, which takes in the function and the range of x values to plot. In this case, we will plot f(x) from -15 to 15 using the syntax Plot[f[x], {x, -15, 15}]. This will give us the graph of f(x).

Now, to plot the point (-3,f(-3)), we need to use the Graphics function and specify the point using the Point function. The syntax for this is Graphics[Point[{x, y}]], where x and y are the coordinates of the point. In this case, x=-3 and y=f(-3). Since we have already defined f(x), we can simply write f[-3] to get the value of f(-3). Putting it all together, we get Graphics[Point[{-3, f[-3]}]].

Finally, we need to combine the two plots using the Show function, which takes in the two plots as arguments. The final code will look like this:

f[x_]:=x^3+4x^2-6
Plot[f[x], {x, -15, 15}]
Graphics[Point[{-3, f[-3]}]]
Show[%, %%, PlotRange -> {-10, 10}]

The % and %% symbols refer to the previous plots, so we don't have to type them again. The PlotRange option is used to adjust the range of the y-axis to include the point we plotted.

I hope this helps you plot your point successfully. Let me know if you have any further questions. Happy plotting!
 

FAQ: How to Solve Plotting Issues in Mathematica 7?

What is Mathmatica 7 Plotting Issue?

Mathematica 7 Plotting Issue refers to a common problem encountered by users of Mathematica 7 software when attempting to plot data or functions. It can manifest as incorrect or missing plots, or error messages.

What causes Mathmatica 7 Plotting Issue?

There are several potential causes for Mathmatica 7 Plotting Issue, including incorrect syntax, incompatible data types, and missing or outdated packages. It can also occur due to bugs or glitches in the software itself.

How can I fix Mathmatica 7 Plotting Issue?

The first step in fixing Mathmatica 7 Plotting Issue is to carefully check your syntax and data types to ensure they are correct and compatible. If the issue persists, try updating your software and any relevant packages. You can also consult online forums or seek help from experienced Mathematica users.

Can I prevent Mathmatica 7 Plotting Issue from happening?

While it is not always possible to prevent Mathmatica 7 Plotting Issue from occurring, there are a few steps you can take to reduce the likelihood. These include regularly updating your software and packages, double-checking your syntax and data types, and avoiding uncommon or unsupported functions.

Is there an alternative to using Mathematica 7 for plotting?

Yes, there are several alternatives to using Mathematica 7 for plotting, such as Python's Matplotlib library, MATLAB, or GNU Octave. Each of these options has its own advantages and drawbacks, so it is important to research and choose the best one for your specific needs.

Similar threads

Replies
2
Views
709
Replies
2
Views
2K
Replies
4
Views
1K
Replies
1
Views
921
Replies
1
Views
830
Replies
1
Views
1K
Back
Top