3
$\begingroup$

The question is to plot several functions with different colors. Using a Table, which contains important information into it.

You can see in the example above three functions with different values for each graph. However, in this example, all the curves are blue, I would like to show them differently.

Also, I would like to add it a caption, titles in Latex, i.e, superscript, vectors, etc. but it doesn´t work well.

Of course, after using the basic Math assistant but it does not work properly The output is wrong, (for example, something like that \vec{f}_x to call the function complaining. Here it is the code and the plot;

enter image description here

 Clear["Global`*"]; 

L = 15; pp = 100; k = 1;
v[x_] = {Sin[( n + 1) k  x], Cos[ n  k  x],   x Sin[n x k]}  ; 

graf1 = Table[Plot[v[x], {x, -L, L}, PlotRange -> Full], {n, 0, 2}];

TableForm[{graf1}, TableHeadings -> {TextCell[StringJoin[{"f", ToString@#}], 
      FontSize -> 12] & /@ {X, Y, Z }, 
   TextCell[StringJoin[{"n = ", ToString@#}], FontSize -> 12] & /@ 
    Range[0, 3]}, TableAlignments -> Center, TableSpacing -> {1, 1}]
$\endgroup$
7
  • 1
    $\begingroup$ I do not understand what the question is here. Please rephrase it. Make sure it is clear, concise, unambiguous, and most importantly: there is an explicitly stated and focused question. $\endgroup$
    – Szabolcs
    Jul 8, 2019 at 6:51
  • $\begingroup$ You can see that each panel have three different plots, How to put each one using a different color (Black, red, Brown). and how to add Latex Symbols in the caption? $\endgroup$
    – irondonio
    Jul 8, 2019 at 8:15
  • 1
    $\begingroup$ Please separate unrelated questions. The plotting one has been asked many times, see e.g. mathematica.stackexchange.com/q/1731/12 The LaTeX one I still do not understand. Please show a concrete example: this is what I tried, this is what happened, this is what I expected to happen instead. $\endgroup$
    – Szabolcs
    Jul 8, 2019 at 8:39
  • $\begingroup$ Of course, I reviewed all of these examples them, It does not work for this case. Try to run the code before to write an incorrect answer here $\endgroup$
    – irondonio
    Jul 8, 2019 at 8:47
  • $\begingroup$ If you add //Evaluate as in graf1 = Table[ Plot[v[x] // Evaluate, {x, -L, L}, PlotRange -> Full], {n, 0, 2}] ? $\endgroup$
    – chris
    Jul 8, 2019 at 8:49

1 Answer 1

1
$\begingroup$

How about

graf1 = Table[
 Plot[v[x] // Evaluate, {x, -L, L}, PlotRange -> Full],   {n, 0, 2}];
 TableForm[{graf1}, 
TableHeadings -> {TextCell[Subscript[f, #], 
  FontSize -> 12] & /@ {x, y, z}, 
 TextCell[StringJoin[{"n = ", ToString@#}], FontSize -> 12] & /@ 
Range[0, 3]}, TableAlignments -> Center, TableSpacing -> {1, 1}]

Mathematica graphics

$\endgroup$
1
  • $\begingroup$ Yes, this plot works great, also It can accept directly to use Greek letters from Palettes but in order to use operators symbols quotation marks as " " has to be used, Thanks!. $\endgroup$
    – irondonio
    Jul 9, 2019 at 8:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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