Group Abstract Group Abstract

Message Boards Message Boards

How can I add a plot label inside the plot?

Posted 1 year ago

I solve a nonlinear ODE system in Mathematica. But the labels of the plot are showed outside of the plot.
My notebook

  1. I want labels inside the plot
  2. Also labels are displayed like 30 ° not 30 Degree.
  3. How to zoom particular are in this plot like the following enter image description here
Attachments:
POSTED BY: J Prakash
5 Replies
POSTED BY: Michael Rogers
Posted 1 year ago
POSTED BY: J Prakash

Try this change:

solForAlphaNN[alpha0_] := 
 NDSolve[{eq1, eq2, eq3, ics, bcs} /. alpha -> alpha0, {f, theta, 
   phi}, {eta, 0, 7}, MaxStepSize -> 0.5, MaxSteps -> 10^3, 
  Method -> {"StiffnessSwitching", 
    Method -> {"ExplicitRungeKutta", Automatic}}];

Also, N[b] = 0.1 is probably not what you meant. N is a system function, and N[b] = 0.1 sets an NValue for the symbol b. If you don't know what that means, then it is certainly not what you intended. I usually avoid starting my variable and function names with capital letters, and I especially avoid using single capitals, since several are used by the system. Like N. Sometimes when I want the variable to resemble traditional notation found in journals, I will compromise and use a double letter, like NN[b] = 0.1; similarly for, say, GG[r] = 5. But that's up to you. Just know that some things such as N[t] = 0.1 have a special meaning and may break your code.

POSTED BY: Michael Rogers

Some alternatives for 30°:

ToString[alpha,TraditionalForm]
PlotLegends->{Row[{"\[Alpha] = ",alpha}]}
POSTED BY: Michael Rogers
  1. Use Placed:

    PlotLegends -> 
     Placed[{StringJoin["\[Alpha] = ", ToString[alpha]]}, 
      Scaled[{.5, .5}]]
    
  2. Write Quantity[30, "AngularDegrees"] instead of 30 Degree

  3. Use Inset.

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