Group Abstract Group Abstract

Message Boards Message Boards

How can I add a plot label inside the plot?

Posted 10 months 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 10 months ago

Thanks for your support. I have one more question. How can I get f, theta and phi values? The following commands didn't display the results for f(eta), theta(eta) and phi(eta).

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

I dislike all the picky picayune details of plotting (not Mathematica's fault — seems a problem in whatever system). Especially Inset and PlotLegends.

Here's a code to give you some hints (plotsfNN generated with PlotLegends -> {Row[{"\[Alpha] = ", alpha}]}):

Show[
  Flatten[plotsfNN],
  Graphics[{Arrow[{{5.5,0.055},{5.6,0.36}}]}],
  Graphics[
  Inset[                   (* edits to plot: *)
   Show[First /@ plotsfNN, (*   remove legending *)
    AxesOrigin->{5,0},     (*   or use Frame instead of Axes *)
    PlotLabel->None,       (*   remove plot label *)
    PlotRange->{{5,6},{0,0.04}} (* select highlight *)
  ],
  Scaled[{5.5/7,0.75/1.7}], (* fiddle with placement *)
  {Center,Center},
  Scaled[0.4]]              (* fiddle with size *)
 ]]


enter image description here

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