开发者

Inserting formula into plot

开发者 https://www.devze.com 2023-02-09 23:30 出处:网络
What\'s a standard way to insert formula into Plot? My plot is below. I\'d like to have the formula of the plot nicely formatted and inserted into plot. TraditionalForm looks OK, but it puts the form

What's a standard way to insert formula into Plot?

My plot is below. I'd like to have the formula of the plot nicely formatted and inserted into plot. TraditionalForm looks OK, but it puts the formula in one line, whereas I want a two-line fraction.

Plot[{1, (开发者_如何学Go\[CapitalDelta] - 1)^(\[CapitalDelta] - 
   1)/(\[CapitalDelta] - 2)^\[CapitalDelta]}, {\[CapitalDelta], 3, 6},
  PlotRange -> {0, 4}, PlotStyle -> {Dashing[.02], Thick}, 
 AxesLabel -> {"\[CapitalDelta]", "\[Lambda]"}]


Sorry for being late :D. I mostly use a simplified version of Leonid's answer. Not sure if it is general enough for any purpose, but certainly works here.

Plot[{1, (\[CapitalDelta] - 1)^(\[CapitalDelta] - 
      1)/(\[CapitalDelta] - 2)^\[CapitalDelta]}, {\[CapitalDelta], 3, 
  6}, PlotRange -> {0, 4}, PlotStyle -> {Dashing[.02], Thick}, 
 AxesLabel -> {"\[CapitalDelta]", "\[Lambda]"}, 

Epilog -> Inset[HoldForm@TraditionalForm[

   (\[CapitalDelta] - 1)^(\[CapitalDelta] - 1)/
   (\[CapitalDelta] - 2)^\[CapitalDelta]]]]  

Inserting formula into plot

Or use Epilog -> Inset[Panel@HoldForm@TraditionalForm... for a nice box around the function:

Inserting formula into plot


Perhaps this could get you started?

Plot[{1,(\[CapitalDelta]-1)^(\[CapitalDelta]-1)/(\[CapitalDelta]-2)^\[CapitalDelta]}, 
{\[CapitalDelta],3,6},PlotRange->{0,4},
PlotStyle->{Dashing[.02],Thick},AxesLabel->{"\[CapitalDelta]","\[Lambda]"},
Epilog->Inset[Style[
   HoldForm@@MakeExpression@MakeBoxes@TraditionalForm[(\[CapitalDelta]-1)^
   (\[CapitalDelta]-1)/(\[CapitalDelta]-2)^\[CapitalDelta]],10]]]
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号