I am currently getting 2 seperate plots for the stress variation with t as shown in the picture below. I would like to get them in a single plot with legend to distinguish them. Could someone please help me out on this.

Seperate graphs that needs to be put on one graph

  • 3
    $\begingroup$ Please have a look at the examples here. $\endgroup$ – b.gates.you.know.what Nov 16 '18 at 14:54
  • $\begingroup$ The link provided by @b.gatessucks is more than enough if you plot the lists provided by Table (or even the S functions directly) but if you still have problems please provide the functional forms and the data or range. $\endgroup$ – Titus Nov 16 '18 at 15:13
  • $\begingroup$ Thank you b.gatessucks and Titus $\endgroup$ – Kepha Nov 16 '18 at 15:31
  • $\begingroup$ Please provide code instead of screenshots of code, to make it easier for others to reproduce your results. $\endgroup$ – Themis Dec 16 '18 at 17:25

OK, here goes. I think this will work.

Plot[{Sxx[t,0], Syy[t,0]}, {t, 1, 2}, PlotLegends -> {"one", "two"}]

will work. I assume your functions are continuous between 1 and 2. My toy examples are easy to adjust. This is for continuous functions...

f[x_] := 2 x
g[x_] := 3 x
Plot[{f[x], g[x]}, {x, 0, 2}, PlotLegends -> "Expressions"]

...and this is for dicrete functions, where a and b are lists (sets) which contain the output of Sxx, Syy

ListPlot[{a, b}, PlotLegends -> {"one", "two"}]
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.