使用 LaTeX 缩放图形 - 圆变成椭圆
Graph scaling with LaTeX - Circle becomes Ellipse
我有以下 LaTeX 代码可以创建图形并绘制圆圈。然而,这个圆圈看起来并不像一个圆圈,而是一个椭圆形。我认为这是因为我的图表是如何设置的。有什么方法可以保持图表的当前 look/scaling,同时使圆看起来更像一个圆(我在下面包含了它的外观图像)?
\documentclass[14pt]{article}
\usepackage[letterpaper,bindingoffset=0.2in,%
left=1in,right=1in,top=1in,bottom=1in,%
footskip=.25in]{geometry}
\usepackage[english]{babel}
\usepackage[utf8x]{inputenc}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage[makeroom]{cancel}
\usepackage{tabularx}
\usepackage{xcolor}
\usepackage{hyperref}
\usepackage{tikz}
\usepackage{pgfplots}
\pgfplotsset{compat=1.11}
\usetikzlibrary{calc}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
xtick distance=10,
ytick distance=10,
xmin=-0.0,xmax=144,
ymin=-0.0,ymax=144,
grid=both,
grid style={line width=.1pt, draw=gray!10},
major grid style={line width=.2pt,draw=gray!50},
axis lines=middle,
minor tick num=5,
enlargelimits={abs=0.5},
axis line style={latex-latex},
ticklabel style={font=\tiny,fill=white},
xlabel style={at={(ticklabel* cs:1)},anchor=north west},
ylabel style={at={(ticklabel* cs:1)},anchor=south west}
]
\draw (axis cs: 70, 70) circle [radius=10];
\end{axis}
\end{tikzpicture}
\end{document}
上面代码的Result/Output:
如果您将 width
和 height
键设置为相同的值,您将获得所需的圈子:
\documentclass{article}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
width=\textwidth,
height=\textwidth,
xtick distance=10,
ytick distance=10,
xmin=-0.0,xmax=144,
ymin=-0.0,ymax=144,
grid=both,
grid style={line width=.1pt, draw=gray!10},
major grid style={line width=.2pt,draw=gray!50},
axis lines=middle,
minor tick num=5,
enlargelimits={abs=0.5},
axis line style={latex-latex},
ticklabel style={font=\tiny,fill=white},
xlabel style={at={(ticklabel* cs:1)},anchor=north west},
ylabel style={at={(ticklabel* cs:1)},anchor=south west}
]
\draw (axis cs: 70, 70) circle [radius=10];
\end{axis}
\end{tikzpicture}
\end{document}
我有以下 LaTeX 代码可以创建图形并绘制圆圈。然而,这个圆圈看起来并不像一个圆圈,而是一个椭圆形。我认为这是因为我的图表是如何设置的。有什么方法可以保持图表的当前 look/scaling,同时使圆看起来更像一个圆(我在下面包含了它的外观图像)?
\documentclass[14pt]{article}
\usepackage[letterpaper,bindingoffset=0.2in,%
left=1in,right=1in,top=1in,bottom=1in,%
footskip=.25in]{geometry}
\usepackage[english]{babel}
\usepackage[utf8x]{inputenc}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage[makeroom]{cancel}
\usepackage{tabularx}
\usepackage{xcolor}
\usepackage{hyperref}
\usepackage{tikz}
\usepackage{pgfplots}
\pgfplotsset{compat=1.11}
\usetikzlibrary{calc}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
xtick distance=10,
ytick distance=10,
xmin=-0.0,xmax=144,
ymin=-0.0,ymax=144,
grid=both,
grid style={line width=.1pt, draw=gray!10},
major grid style={line width=.2pt,draw=gray!50},
axis lines=middle,
minor tick num=5,
enlargelimits={abs=0.5},
axis line style={latex-latex},
ticklabel style={font=\tiny,fill=white},
xlabel style={at={(ticklabel* cs:1)},anchor=north west},
ylabel style={at={(ticklabel* cs:1)},anchor=south west}
]
\draw (axis cs: 70, 70) circle [radius=10];
\end{axis}
\end{tikzpicture}
\end{document}
上面代码的Result/Output:
如果您将 width
和 height
键设置为相同的值,您将获得所需的圈子:
\documentclass{article}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
width=\textwidth,
height=\textwidth,
xtick distance=10,
ytick distance=10,
xmin=-0.0,xmax=144,
ymin=-0.0,ymax=144,
grid=both,
grid style={line width=.1pt, draw=gray!10},
major grid style={line width=.2pt,draw=gray!50},
axis lines=middle,
minor tick num=5,
enlargelimits={abs=0.5},
axis line style={latex-latex},
ticklabel style={font=\tiny,fill=white},
xlabel style={at={(ticklabel* cs:1)},anchor=north west},
ylabel style={at={(ticklabel* cs:1)},anchor=south west}
]
\draw (axis cs: 70, 70) circle [radius=10];
\end{axis}
\end{tikzpicture}
\end{document}