如何最好地将这个扫描质量不佳的图表转换为 TikZ?

如何最好地将这个扫描质量不佳的图表转换为 TikZ?

我在一篇论文中发现了这张图片,由于扫描效果不佳而难以阅读,我想创建一个更清晰的版本:

在此处输入图片描述

我对 TikZ 还不太熟悉,所以我不确定开始绘制这样的图表的最佳方法。

答案1

一种稍微不那么痛苦的方法是使用“Engauge Digitizer”应用程序。

Engauge Digitizer 应用程序非常直观,可以满足我的需要,而且是开源的。

如果开发人员包含 Tikz 中需要使用的格式的导出,那么使用起来会更容易。

可以将任意曲线转换为坐标并在 tikz 中绘制。

如果您想要的是用直线段和圆弧绘制图形,Engauge 将帮助您从图形中确定比例中的兴趣点,如第二个 tikz 文件所示。

在 Engauge 中,加载图像,指出定义轴的点,然后选择“沿线段扫描”。在这些曲线上,有些点没有被线段工具选中,我将它们逐个数字化(这些曲线大约有十个点)。如果曲线不够平滑,请使用重新定位工具更改某些点的位置。我更喜欢一次扫描一条曲线。当您满意时,导出到 csv,得到类似以下内容:

x,Curve1
"0,0836","14,0468"
"0,4403","13,9776"
"0,8362","13,9591"
"1,2323","13,8877"

在文本编辑器中打开 .csv 文件,然后执行“替换”。生成的格式是根据我的地区而定的,所以我将指出我使用的顺序。

首先:<","> 到 <%>

然后 <,> 被 <.> 替换

将 <%> 替换为 <,>

然后 <" 换行 "> 通过

<*\yScale) (\xScale*>

点击第一行和最后一行,使其变成类似这样的内容:

(\xScale*0.0836,14.0468*\yScale) (\xScale*0.4403,13.9776*\yScale) ...

然后按照指示在 tikz 文件中使用。

\documentclass[margin=1cm]{standalone}
\usepackage{tikz}

\begin{document}
\begin{tikzpicture}
\def\xScale{-0.4}
\def\yScale{0.4}

\draw[thick,-latex] (0,0) -- (10*\xScale-0.5,0) node[below] {x};
\draw[thick,-latex] (0,0) -- (0,14*\yScale+0.5) node[right] {y};

\draw[very thick,red]  plot[smooth, tension=.7] coordinates {(\xScale*0.0836,14.0468*\yScale) (\xScale*0.4403,13.9776*\yScale) (\xScale*0.8362,13.9591*\yScale) (\xScale*1.2323,13.8877*\yScale) (\xScale*1.6283,13.7987*\yScale) (\xScale*2.0245,13.6921*\yScale) (\xScale*2.4042,13.5503*\yScale) (\xScale*2.8004,13.426*\yScale) (\xScale*3.1637,13.249*\yScale) (\xScale*3.527,13.0544*\yScale) (\xScale*3.8409,12.8423*\yScale) (\xScale*4.1129,12.6365*\yScale) (\xScale*4.3991,12.4528*\yScale) (\xScale*4.7687,12.1745*\yScale) (\xScale*5.1628,11.888*\yScale) (\xScale*5.4769,11.623*\yScale) (\xScale*5.8074,11.358*\yScale) (\xScale*6.1214,11.1283*\yScale) (\xScale*6.3532,10.7755*\yScale) (\xScale*6.6676,10.3696*\yScale) (\xScale*6.9323,10.0167*\yScale) (\xScale*7.1806,9.6814*\yScale) (\xScale*7.3837,9.3664*\yScale) (\xScale*7.5818,9.0886*\yScale) (\xScale*7.7768,8.6936*\yScale) (\xScale*7.9757,8.3056*\yScale) (\xScale*8.191,7.9352*\yScale) (\xScale*8.4063,7.5648*\yScale) (\xScale*8.5888,7.1416*\yScale) (\xScale*8.7547,6.7361*\yScale) (\xScale*8.9042,6.3306*\yScale) (\xScale*9.0371,5.9251*\yScale) (\xScale*9.1701,5.5021*\yScale) (\xScale*9.3031,5.0966*\yScale) (\xScale*9.4031,4.656*\yScale) (\xScale*9.5196,4.233*\yScale) (\xScale*9.6196,3.81*\yScale) (\xScale*9.7031,3.3871*\yScale) (\xScale*9.7701,2.9466*\yScale) (\xScale*9.8207,2.5237*\yScale) (\xScale*9.8547,2.0833*\yScale) (\xScale*9.9053,1.6428*\yScale) (\xScale*9.9393,1.2023*\yScale) (\xScale*9.9607,0.805*\yScale) (\xScale*9.9619,0.7034*\yScale) (\xScale*9.9729,0.0615*\yScale)};
\draw[very thick,blue]  plot[smooth, tension=.7] coordinates {(\xScale*0.0353,10.9665*\yScale) (\xScale*0.3983,10.8952*\yScale) (\xScale*0.7943,10.859*\yScale) (\xScale*1.1903,10.7877*\yScale) (\xScale*1.5865,10.681*\yScale) (\xScale*1.9662,10.5392*\yScale) (\xScale*2.3459,10.3798*\yScale) (\xScale*2.7093,10.2028*\yScale) (\xScale*3.0397,9.973*\yScale) (\xScale*3.3867,9.7432*\yScale) (\xScale*3.7172,9.4782*\yScale) (\xScale*4.0312,9.2133*\yScale) (\xScale*4.3288,8.9307*\yScale) (\xScale*4.6264,8.6482*\yScale) (\xScale*4.8912,8.2953*\yScale) (\xScale*5.1393,7.9952*\yScale) (\xScale*5.3876,7.6424*\yScale) (\xScale*5.6772,7.2806*\yScale) (\xScale*5.9667,6.9188*\yScale) (\xScale*6.1486,6.7246*\yScale) (\xScale*6.3639,6.363*\yScale) (\xScale*6.4966,6.0721*\yScale) (\xScale*6.6296,5.649*\yScale) (\xScale*6.7296,5.226*\yScale) (\xScale*6.8541,4.891*\yScale) (\xScale*6.9046,4.4594*\yScale) (\xScale*7.0294,4.0099*\yScale) (\xScale*7.1459,3.5869*\yScale) (\xScale*7.2459,3.1639*\yScale) (\xScale*7.3295,2.7233*\yScale) (\xScale*7.3965,2.3004*\yScale) (\xScale*7.4635,1.8599*\yScale) (\xScale*7.4976,1.4195*\yScale) (\xScale*7.5317,0.979*\yScale) (\xScale*7.5491,0.5915*\yScale) (\xScale*7.5917,0.0365*\yScale)};
\end{tikzpicture}
\end{document}

在此处输入图片描述

\begin{tikzpicture}
\def\xScale{-0.4}
\def\yScale{0.4}
\pgfmathsetmacro\raioA{((6.9035*\xScale)^2+(4.6452*\yScale)^2)^0.5}
\pgfmathsetmacro\angA{atan(4.6452/6.9035)}
\pgfmathsetmacro\angB{atan(10.6743/6.455)}
\pgfmathsetmacro\angC{atan((4.6452-12.1668)/(6.9035-4.7364))}

\draw[thick,-latex] (0,0) -- (10*\xScale-0.5,0);
\draw[thick,-latex] (0,0) -- (0,14*\yScale+0.5);
\draw (0,0) --(6.455*\xScale,10.6743*\yScale);
\draw (0,0) --(6.9035*\xScale,4.6452*\yScale);
\draw (6.455*\xScale,10.6743*\yScale) --(6.9035*\xScale,4.6452*\yScale);
\draw (6.9035*\xScale,4.6452*\yScale) -- (4.7*\xScale,12.4*\yScale);
\draw (0,0) --(6.9035*\xScale,4.6452*\yScale);
\draw (0,0) ++(180-\angA:\raioA) arc(180-\angA:90:\raioA);
\draw (6.9035*\xScale,4.6452*\yScale) ++(-\angA:1.1) arc (-\angA:-0.5*\angC:1.1) coordinate (maa) arc (-0.5*\angC:-\angC:1.1);
\node[right] at (maa) {\tiny$El+90$};
\draw (0,0) ++(180-\angB:0.8)  arc  (180-\angB:180-\angA:0.8) ;
\node[rotate = 90-0.5*\angA-0.5*\angB , above] at (180-0.5*\angB-0.5*\angA :0.8) {$\theta'$};
\draw[thick] (0,0) ++(180-\angB:1.5)  arc  (180-\angB:180:1.5) ;
\node[rotate = 90-0.5*\angB , above] at (180-0.5*\angB+5 :1.5) {$\theta$};
\node[right] at (\xScale*0.0836,14.0468*\yScale) {Orbital};
\node[right] at (\xScale*0.0353,10.9665*\yScale) {Earth radius};
\draw[blue, very thick] (\xScale*0.0353,10.9665*\yScale) arc   (90:180:-\xScale*7.5917 and 10.9665*\yScale);
\draw[red, very thick] (\xScale*0.0836,14.0468*\yScale) arc   (90:180:-\xScale*9.9729 and 14.0468*\yScale);
\end{tikzpicture}

在此处输入图片描述

相关内容