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!!
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}]
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}]
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.
I can’t help if you don’t put a example code.What have you done?. ![]()
I want to plot two equations on a line graph, (prices depending on costs), no luck anything I try:
P1 = C1 + aP2
P2 = C1 +bP1
Can you help?

