我想尝试使用“提克兹特” 创建一个循环图。但我遇到了一点麻烦。软件下载链接
使用现有的 tikz 代码可能很容易。https://texample.net/tikz/examples/cycle/
% A simple cycle
% Author : Jerome Tremblay
\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\def \n {5}
\def \radius {3cm}
\def \margin {6} % margin in angles, depends on the radius
\foreach \s in {1,...,\n}
{
\node[draw, circle] at ({360/\n * (\s - 1)}:\radius) {$\s$};
\draw[-, >=latex] ({360/\n * (\s -1)+\margin}:\radius)
arc ({360/\n * (\s - 1)+\margin}:{360/\n * (\s)-\margin}:\radius);
}
\end{tikzpicture}
\end{document}
当我想使用Tikzit软件时,绘制上述图形似乎很困难。
关键在于顶点的位置和曲线曲率的设定,这对我来说非常困难。不知道如何调整它们。
以下代码均来自于该软件。
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{backgrounds}
\usetikzlibrary{arrows}
\usetikzlibrary{shapes,shapes.geometric,shapes.misc}
% these are dummy properties used by TikZiT, but ignored by LaTex
\pgfkeys{/tikz/tikzit fill/.initial=0}
\pgfkeys{/tikz/tikzit draw/.initial=0}
\pgfkeys{/tikz/tikzit shape/.initial=0}
\pgfkeys{/tikz/tikzit category/.initial=0}
% standard layers used in .tikz files
\pgfdeclarelayer{edgelayer}
\pgfdeclarelayer{nodelayer}
\pgfsetlayers{background,edgelayer,nodelayer,main}
% style for blank nodes
\tikzstyle{none}=[inner sep=0mm]
% Node styles
\tikzstyle{white_node}=[fill=white, draw=black, shape=circle]
\tikzstyle{blackedge}=[-, draw=black]
\begin{document}
\begin{tikzpicture}
\begin{pgfonlayer}{nodelayer}
\node [style={white_node}] (0) at (5, 6) {};
\node [style={white_node}] (1) at (7, 4) {};
\node [style={white_node}] (2) at (5, 2) {};
\node [style={white_node}] (3) at (3, 3) {};
\node [style={white_node}] (4) at (3, 5) {};
\end{pgfonlayer}
\begin{pgfonlayer}{edgelayer}
\draw [style=blackedge, bend left] (0) to (1);
\draw [style=blackedge, bend left] (1) to (2);
\draw [style=blackedge, bend right=330] (2) to (3);
\draw [style=blackedge, bend left=45, looseness=0.75] (3) to (4);
\draw [style=blackedge, bend left] (4) to (0);
\end{pgfonlayer}
\end{tikzpicture}
\end{document}
编辑: 经过 SebGlav 的提醒,我的问题实际上可以等同于:
如何使用 TikZ 代码制作具有适当边缘的圆形图?
答案1
这是我的简单解决方案。
\documentclass[tikz,border=5mm]{standalone}
\begin{document}
\begin{tikzpicture}[thick]
\def\r{2}
\draw (0,0) circle(\r)
(0,0)--(90:\r)
(0,0)--(150:\r)
(0,0)--(-30:\r);
\foreach \point in {(0,0),(90:\r),(150:\r),(210:\r),(30:\r),(-30:\r),(-90:\r),(150:\r/3),(150:2*\r/3),(-30:\r/2),(90:\r/2)}
\draw[teal,fill=white] \point circle(.1);
\path
(0,0) node[below=1mm]{$\omega$}
(-30:\r) node[below right]{$u$}
(-30:\r/2) node[above=1mm]{$P'$}
(90:\r) node[above=1mm]{$z$}
(90:\r/2) node[left=1mm]{$P$}
(150:\r) node[left=1mm]{$y$}
(150:2*\r/3) node[below=1mm]{$x$}
(-90:\r) node[below=1mm]{$C$}
;
\end{tikzpicture}
\end{document}