Mathematica 解決導出圖片的刻度線又短又粗醜爆炸的問題

經過一番折騰,發現最好的方法還是自定義刻度線,而且這也是最自由的方法了,而且實現起來還不復雜

查找替換的方法試過了 出圖也不滿意

原代碼:

ListLinePlot[data,
  PlotStyle -> Directive[Black, Thin],
  MeshStyle -> Black, PlotMarkers -> "\[FilledDiamond]",
  Frame -> {{True, False}, {True, False}},
  FrameLabel -> {s@"Temperature T/\[Degree]C", s@"Pressure P/MPa"},
  FrameTicksStyle -> 
   Directive[FontFamily -> "Times New Roman", 12, Black],
  FrameStyle -> AbsoluteThickness[1]] /. 
 s[t_] :> Style[t, FontFamily -> "Times New Roman", 12, Black, Italic]

最終代碼

ListLinePlot[data,
  PlotStyle -> Directive[Black, [email protected]],
  MeshStyle -> Black, PlotMarkers -> Style["\[FilledDiamond]", 8],
  Frame -> {{True, False}, {True, False}},
  FrameTicks -> {Table[
     If[Mod[i, 5] == 0, {i, i, {0.02, 0}}, {i, "", {0.01, 0}}], {i, 0, 25}],
    Table[
     If[Mod[i, 5] == 0, {i, i, {0.02, 0}}, {i, "", {0.01, 0}}], {i, 0, 35}]},
  FrameLabel -> {s@"Temperature T/\[Degree]C", s@"Pressure P/MPa"},
  FrameTicksStyle -> 
   Directive[FontFamily -> "Times New Roman", 12, Black]] /. 
 s[t_] :> Style[t, FontFamily -> "Times New Roman", 12, Black, Italic]

導出圖片的代碼,注意最後的ImageResolution -> 300

Export["1.png",圖片 , ImageResolution -> 300]

在這裏插入圖片描述
最終得到的圖片

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章