使用 PGFPlots 使用 CSV 文件中的数据绘制极坐标图

使用 PGFPlots 使用 CSV 文件中的数据绘制极坐标图

我想使用 CSV 文件中的数据在 PGF/TikZ 中绘制图表。以下是 CSV 文件的链接: https://www.dropbox.com/scl/fi/3be8309dhs4yspji25zrl/plot3_detailed_ground_shear_pressure.csv?rlkey=npbbqk3t0tfx8frvk5er5ea50&dl=0

在此处输入图片描述

我尝试使用以下 TikZ/PGFPlots 代码创建绘图,但遇到了一些问题。以下是第三个绘图“详细地面剪切压力”的代码示例:

\begin{polaraxis}[
    title={Detailed Ground Shear Pressure},
    legend pos=north west,
    ymajorgrids=true,
    grid style=dashed,

]

\pgfplotstableread[col sep=comma]{plot3_transformed_detailed_ground_shear_pressure.csv}\datatable

\addplot+[no markers] table[x=data_phi_deg, y=Gs] from \datatable;
\addlegendentry{Transformed Gs}

\addplot+[no markers, fill=red, fill opacity=0.3] table[x=data_phi_deg, y expr=\thisrow{Gs}*\thisrow{exceed_mask}] from \datatable;
\addlegendentry{Critical Regions where Gs > Gp}

\addplot+[no markers, fill=orange, fill opacity=0.3] table[x=data_phi_deg, y expr=\thisrow{Gs}*\thisrow{below_mask}] from \datatable;
\addlegendentry{Critical Regions where Gs < -Gp}

\end{polaraxis}
\end{tikzpicture}

有人能提供指导或建议,说明如何使用提供的 CSV 文件中的数据在 PGF/TikZ 中正确绘制这些图表吗?我正在寻找建议,看看在 PGF/TikZ 中执行此操作是否合理,或者是否最好坚持使用 Python,因为我已经在 Python 中生成了这些图。但是,为了保持文章的一致性,我更愿意使用 PGF/TikZ 来匹配我的其他图的样式。任何见解或建议都将不胜感激。

相关内容