如何解决局部放大的图像标签显示不完整?
mathematica吧
全部回复
仅看楼主
level 1
helloapple11 楼主
我想要使用一个局部放大的图像。以下是代码。正如您所看到的,在放大图像中,“Min”和“RF”等“PlotLabels”未能完全显示。然而,在可以插入“PlotLabels”的位置存在明显的空白空间。如何解决这个问题呢?
```
ttt = Table[{5, 10, 20, 50, 100, 200, 500, 1000, 2000, 5000, 10000,
50000, 100000, 500000, 1000000}]
ttttt = {0.5411080105624226`, 0.4746114896441091`,
0.45560476211921547`, 0.3920375515864554`, 0.3688071154680211`,
0.37303695707239365`, 0.35986703180178964`, 0.3454025968800972`,
0.33737968696907666`, 0.332893155320118`, 0.330917731450119`,
0.328349013701957`, 0.3275433810401204`, 0.32654069972569133`,
0.32644824704879566`, 0.17576476308174965`, 0.14935405824951864`,
0.20544610516687922`, 0.23442829580276892`, 0.2794037021607155`,
0.289177
13986193516
`, 0.30219001700545106`, 0.3100617228918656`,
0.3
15014265095
92156`, 0.3178735474098285`, 0.32019011261868147`,
0.32284032044479144`, 0.32405254386607507`, 0.32405254386607507`,
0.32405254386607507`}
ans1 = ListPlot[Table[{ttt[[i]], ttttt[[i]]}, {i, 15}],
Joined -> True, ScalingFunctions -> {"Log"}, PlotRange -> All,
PlotLabels -> Callout["Max", {Scaled[0], Above}], PlotStyle -> Red];
ans2 = ListPlot[Table[{ttt[[i]], ttttt[[i + 15]]}, {i, 15}],
Joined -> True, ScalingFunctions -> {"Log"}, PlotRange -> All,
PlotLabels -> Callout["Min", {Scaled[0], Above}],
PlotStyle -> Cyan];
ans3 = ListPlot[Table[{ttt[[i]], 0.32488628166902345`}, {i, 15}],
Joined -> True, ScalingFunctions -> {"Log"}, PlotRange -> All,
PlotLabels -> Callout["RF", {Scaled[0], Above}]];
Show[ans1, ans2, ans3, PlotRange -> All, AxesOrigin -> {0, 0},
AxesLabel -> {"Path number", MaTeX[Q]}]
ans4 = ListPlot[Table[{ttt[[i]], ttttt[[i]]}, {i, 13, 15}],
Joined -> True, ScalingFunctions -> {"Log"}, PlotRange -> All,
PlotLabels -> Callout["Max", {Scaled[0], Above}], PlotStyle -> Red];
ans5 = ListPlot[Table[{ttt[[i]], ttttt[[i + 15]]}, {i, 13, 15}],
Joined -> True, ScalingFunctions -> {"Log"}, PlotRange -> All,
PlotLabels -> Callout["Min", {Scaled[0], Above}],
PlotStyle -> Cyan];
ans6 = ListPlot[Table[{ttt[[i]], 0.32488628166902345`}, {i, 13, 15}],
Joined -> True, ScalingFunctions -> {"Log"}, PlotRange -> All,
PlotLabels -> Callout["RF", {Scaled[1], Above}]];
Show[ans4, ans5, ans6, PlotRange -> All,
AxesOrigin -> {Log[10^5], 0.32},
AxesLabel -> {"Path number", MaTeX[Q]}, Frame -> True,
ImageSize -> 500]
xyMinMax = {{Log[10^5], Log[10^6]}, {0.31, 0.34}};
Show[{ans1, ans2, ans3}, PlotRange -> All, AxesOrigin -> {0, 0},
AxesLabel -> {"Path number", MaTeX[Q]},
Epilog -> {Transparent, EdgeForm[Thick],
Rectangle[Sequence @@ Transpose[xyMinMax]],
Inset[Show[ans4, ans5, ans6,
PlotRange -> {{Log[10^5], Log[10^6]}, {0.32, 0.33}},
AxesOrigin -> {Log[10^5], 0.3},
AxesLabel -> {"Path number", MaTeX[Q]}, Frame -> True,
ImageSize -> 200], {10., 0.5}]}, ImageSize -> 600]
```
2024年04月12日 08点04分 1
level 1
helloapple11 楼主
如下图
2024年04月12日 08点04分 2
level 1
helloapple11 楼主
我也正在网页链接 询问这个问题
2024年04月12日 08点04分 3
1