简体   繁体   English

在Mathematica中绘制多条网格线并给出单独的标签

[英]Plotting multiple gridlines and give seperate labels in Mathematica

I am trying to make the following plot: 我正在尝试绘制以下情节:

Pars = {ep -> 0.5, f1p -> 0.3, f2p -> 0.1, dp -> 0.05, q -> 0.1, 
   en -> 0.4, d -> 0.1, Q -> 0.1, f2n -> 0.3, f1n -> 0.4, a -> 0.05, 
   N1 -> 0.5, N2 -> 0.5}; #Parameters

PlotREq1 = 
  Plot[R = S /. Pars, {S, 0, 0.9375}, 
   PlotRange -> {{0, 3.5}, {0, 2}}, PlotStyle -> {Red, Thick, Dashed},
    GridLines -> {{0.9375}, {}}];  
PlotREq2 = 
  Plot[R = (a + d)/(en f1n) /. Pars, {S, 0.9375, 1.4375}, 
   PlotRange -> {{0, 3.5}, {0, 2}}, PlotStyle -> {Red, Thick, Dashed},
    GridLines -> {{1.4375}, {}}];
PlotREq3 = 
  Plot[R = ((a + d) (f1p - f2p))/(en (f1p f2n - f1n f2p)) /. Pars, {S,
     1.4375, 2.3}, PlotRange -> {{0, 3.5}, {0, 2}}, 
   PlotStyle -> {Red, Thick, Dashed}, GridLines -> {{2.3}, {}}];
Show[PlotREq1, PlotREq2, PlotREq3]

However, only the first gridline shows up and the other two vertical lines at 1.4375 and 2.3 do not appear. 但是,仅显示第一条网格线,而其他两条垂直线分别位于1.4375和2.3。 Also, can anyone suggest a way to label the gridlines? 另外,有人可以建议一种标记网格线的方法吗? I tried to insert a axeslabel within the Gridline function as: Gridlines -> {{{0.9375},{}}, AxesLabel -> {"R",""}} but it does not seem to work. 我试图在Gridline函数内插入axislabel: Gridlines -> {{{0.9375},{}}, AxesLabel -> {"R",""}}但它似乎不起作用。

Using Show , only the first version of an option is followed. 使用Show ,仅遵循选项的第一个版本。 Place all the gridlines in the first plot, or add them as options to Show , which will override any others. 将所有网格线放在第一个绘图中,或将它们添加为Show选项,它将覆盖其他所有网格线。

Show[PlotREq1, PlotREq2, PlotREq3, GridLines -> {{0.9375, 1.4375, 2.3}, {}}]

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM