Group Abstract Group Abstract

Message Boards Message Boards

1
|
60.5K Views
|
4 Replies
|
5 Total Likes
View groups...
Share
Share this post:

Plot multiple functions?

Posted 9 years ago

I am very new to Mathematica. As a school project, we have to graph images using basically a very large piecewise function. The image I am working on is a Cardinal. I cannot for the life of me figure out how to use the "Show" function to graph multiple functions of various domains and ranges on the same plot. I've read the help guide multiple times and simply can't make sense of it... Any suggestions? Thank you!!

POSTED BY: Clarissa Hood
4 Replies
Posted 5 years ago

I want to plot two equations on a line graph, (prices depending on costs), no luck anything I try: P1 = C1 + a*P2 P2 = C1 +b*P1 Can you help?

POSTED BY: Frank Lobue

How about

  f[x_] := x
  g[x_] := x^2
  a[x_] := Piecewise[{{x^3, x < 0}, {1/x, x > 0}}]
  b[x_] := Piecewise[{{Sin[10*x]/x, x < 0}, {1, x == 0}}, Cos[10*x]]

  Show[{Plot[f[x], {x, 1, 2}, PlotStyle -> Blue], Plot[g[x], {x, -2, -1}, PlotStyle -> Green]}, PlotRange -> All,
  AxesOrigin -> {0, 0}]

enter image description here

Or more complex.

   Show[{Plot[f[x], {x, 1/2, 2}, PlotStyle -> Orange], 
   Plot[g[x], {x, -2, -1/2}, PlotStyle -> Blue], 
   Plot[a[x], {x, -1, 1}, PlotStyle -> Red], 
   Plot[b[x], {x, -2, 2}, PlotStyle -> Black]}, PlotRange -> All, 
   AxesOrigin -> {0, 0}]

enter image description here

POSTED BY: Mariusz Iwaniuk
Posted 9 years ago

Yes, thank you that helped a lot! However, I've put 5 functions into the graph now, and each time I go to put in the 6th a message pops up that says it "can't combine the graphic objects in show". I tried putting in different functions to see if it was only because my syntax was incorrect, but the same message comes up each time.

POSTED BY: Clarissa Hood

I can't help if you don't put a example code.What have you done?. :)

POSTED BY: Mariusz Iwaniuk
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard