Graphics, Figures & Tables ⇒ Tweaking some parts of a chart
Re: Tweaking some parts of a chart
Thank you for all
Best regards
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
Tweaking some parts of a chart
Only says I have any problem in code
Code: Select all
\documentclass[border=5mm]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\begin{document}
\definecolor{mycolor1}{rgb}{1,0,1}
\definecolor{mycolor2}{rgb}{0,0.498039215803146,0}
\begin{tikzpicture}
\begin{axis}[
color=black,
scale only axis,
xmin=1,
xmax=24,
%xtick={1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24},
xtick={0,4,8,12,24}, %%%<------------- here
xlabel={$y$},
ymin=1,
ymax=10,
ytick={1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0,10.0},
yticklabels={1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0,10.0},
y axis line style={blue},
ytick style={blue},
yticklabel style={blue},
axis x line*=bottom,
axis y line*=left,
tick align = outside,]
\addplot [
color=blue,
solid,
line width=0.5pt,
mark size=2.5pt,
mark size=2.5pt,
mark=square*,
mark options={solid,,rotate=180,fill=blue}]
table[row sep=crcr]{
1 4\\
4 6\\
8 8.8\\
12 2.8\\
24 8.162\\};
\end{axis}
\end{tikzpicture}%
\begin{tikzpicture}
\begin{axis}[
color=black,
scale only axis,
xmin=1,
xmax=24,
%xtick={1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24},
xtick={0,4,8,12,24}, %%%<------------- here
xlabel={$y$},
ymin=1,
ymax=10,
ytick={1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0,10.0},
yticklabels={1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0,10.0},
y axis line style={blue},
ytick style={blue},
yticklabel style={blue},
axis x line*=bottom,
axis y line*=left,
tick align = outside,]
\addplot [
color=blue,
solid,
line width=0.5pt,
mark size=2.5pt,
mark size=2.5pt,
mark=square*,
mark options={solid,,rotate=180,fill=blue}]
table[row sep=crcr]{
1 4\\
4 6\\
8 8.8\\
12 2.8\\
24 8.162\\};
\end{axis}
\end{tikzpicture}%
\begin{tikzpicture}
\begin{axis}[
color=black,
scale only axis,
xmin=1,
xmax=24,
%xtick={1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24},
xtick={0,4,8,12,24}, %%%<------------- here
xlabel={$y$},
ymin=1,
ymax=10,
ytick={1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0,10.0},
yticklabels={1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0,10.0},
y axis line style={blue},
ytick style={blue},
yticklabel style={blue},
axis x line*=bottom,
axis y line*=left,
tick align = outside,]
\addplot [
color=blue,
solid,
line width=0.5pt,
mark size=2.5pt,
mark size=2.5pt,
mark=square*,
mark options={solid,,rotate=180,fill=blue}]
table[row sep=crcr]{
1 5\\
4 5\\
8 9.8\\
12 6.8\\
24 6.162\\};
\end{axis}
\end{tikzpicture}%
\begin{tikzpicture}
\begin{axis}[
color=black,
scale only axis,
xmin=1,
xmax=24,
%xtick={1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24},
xtick={0,4,8,12,24}, %%%<------------- here
xlabel={$y$},
ymin=1,
ymax=10,
ytick={1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0,10.0},
yticklabels={1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0,10.0},
y axis line style={black},
ytick style={yellow},
yticklabel style={red},
axis x line*=bottom,
axis y line*=left,
tick align = outside,]
\addplot [
color=black,
solid,
line width=0.5pt,
mark size=2.5pt,
mark size=2.5pt,
mark=square*,
mark options={solid,,rotate=180,fill=blue}]
table[row sep=crcr]{
1 5\\
4 5\\
8 9.8\\
12 6.8\\
24 6.162\\};
\addplot [
color=black,
solid,
line width=0.5pt,
mark size=2.5pt,
mark size=2.5pt,
mark=square*,
mark options={solid,,rotate=180,fill=blue}]
table[row sep=crcr]{
1 2\\
4 3\\
8 4.8\\
12 7.8\\
24 8.162\\};
\end{axis}
\end{tikzpicture}%
\begin{table}
\begin{tabular}{ll}
1 & 2 \\
3 & 4
\end{tabular}
\end{table}
\end{document}
- Stefan Kottwitz
- Site Admin
- Posts: 10360
- Joined: Mon Mar 10, 2008 9:44 pm
Tweaking some parts of a chart
LaTeX complains about the table environment. The standalone class (in your first line) doesn't have it. A normal class, such as book, report, article, scrbook, etc. provides it.dasag wrote:Only says I have any problem in code
Stefan
Tweaking some parts of a chart
Code: Select all
\documentclass[border=5mm]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\begin{document}
\definecolor{mycolor1}{rgb}{1,0,1}
\definecolor{mycolor2}{rgb}{0,0.498039215803146,0}
\begin{tikzpicture}
\begin{axis}[
color=black,
scale only axis,
xmin=1,
xmax=24,
%xtick={1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24},
xtick={0,4,8,12,24}, %%%<------------- here
xlabel={$y$},
ymin=1,
ymax=10,
ytick={1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0,10.0},
yticklabels={1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0,10.0},
y axis line style={blue},
ytick style={blue},
yticklabel style={blue},
axis x line*=bottom,
axis y line*=left,
tick align = outside,]
\addplot [
color=blue,
solid,
line width=0.5pt,
mark size=2.5pt,
mark size=2.5pt,
mark=square*,
mark options={solid,,rotate=180,fill=blue}]
table[row sep=crcr]{
1 4\\
4 6\\
8 8.8\\
12 2.8\\
24 8.162\\};
\end{axis}
\end{tikzpicture}%
\begin{tikzpicture}
\begin{axis}[
color=black,
scale only axis,
xmin=1,
xmax=24,
%xtick={1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24},
xtick={0,4,8,12,24}, %%%<------------- here
xlabel={$y$},
ymin=1,
ymax=10,
ytick={1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0,10.0},
yticklabels={1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0,10.0},
y axis line style={blue},
ytick style={blue},
yticklabel style={blue},
axis x line*=bottom,
axis y line*=left,
tick align = outside,]
\addplot [
color=blue,
solid,
line width=0.5pt,
mark size=2.5pt,
mark size=2.5pt,
mark=square*,
mark options={solid,,rotate=180,fill=blue}]
table[row sep=crcr]{
1 4\\
4 6\\
8 8.8\\
12 2.8\\
24 8.162\\};
\end{axis}
\end{tikzpicture}%
\begin{tikzpicture}
\begin{axis}[
color=black,
scale only axis,
xmin=1,
xmax=24,
%xtick={1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24},
xtick={0,4,8,12,24}, %%%<------------- here
xlabel={$y$},
ymin=1,
ymax=10,
ytick={1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0,10.0},
yticklabels={1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0,10.0},
y axis line style={blue},
ytick style={blue},
yticklabel style={blue},
axis x line*=bottom,
axis y line*=left,
tick align = outside,]
\addplot [
color=blue,
solid,
line width=0.5pt,
mark size=2.5pt,
mark size=2.5pt,
mark=square*,
mark options={solid,,rotate=180,fill=blue}]
table[row sep=crcr]{
1 5\\
4 5\\
8 9.8\\
12 6.8\\
24 6.162\\};
\end{axis}
\end{tikzpicture}%
\begin{tikzpicture}
\begin{axis}[
color=black,
scale only axis,
xmin=1,
xmax=24,
%xtick={1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24},
xtick={0,4,8,12,24}, %%%<------------- here
xlabel={$y$},
ymin=1,
ymax=10,
ytick={1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0,10.0},
yticklabels={1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0,10.0},
y axis line style={black},
ytick style={yellow},
yticklabel style={red},
axis x line*=bottom,
axis y line*=left,
tick align = outside,]
\addplot [
color=black,
solid,
line width=0.5pt,
mark size=2.5pt,
mark size=2.5pt,
mark=square*,
mark options={solid,,rotate=180,fill=blue}]
table[row sep=crcr]{
1 5\\
4 5\\
8 9.8\\
12 6.8\\
24 6.162\\};
\addplot [
color=black,
solid,
line width=0.5pt,
mark size=2.5pt,
mark size=2.5pt,
mark=square*,
mark options={solid,,rotate=180,fill=blue}]
table[row sep=crcr]{
1 2\\
4 3\\
8 4.8\\
12 7.8\\
24 8.162\\};
\end{axis}
\end{tikzpicture}%
\begin{table}
\begin{tabular}{ll}
1 & 2 \\
3 & 4
\end{tabular}
\end{table}
\end{document}
I want to separate two graph in above two in below. Bust, says I have some mistake of code
- Stefan Kottwitz
- Site Admin
- Posts: 10360
- Joined: Mon Mar 10, 2008 9:44 pm
Tweaking some parts of a chart
Code: Select all
\documentclass[border=5mm]{article}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
\begin{document}
\definecolor{mycolor1}{rgb}{1,0,1}
\definecolor{mycolor2}{rgb}{0,0.498039215803146,0}
\begin{tikzpicture}
\begin{axis}[
color=black,
scale only axis,
xmin=1,
xmax=24,
%xtick={1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24},
xtick={0,4,8,12,24}, %%%<------------- here
xlabel={$y$},
ymin=1,
ymax=10,
ytick={1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0,10.0},
yticklabels={1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0,10.0},
y axis line style={blue},
ytick style={blue},
yticklabel style={blue},
axis x line*=bottom,
axis y line*=left,
tick align = outside,]
\addplot [
color=blue,
solid,
line width=0.5pt,
mark size=2.5pt,
mark size=2.5pt,
mark=square*,
mark options={solid,,rotate=180,fill=blue}]
table[row sep=crcr]{
1 4\\
4 6\\
8 8.8\\
12 2.8\\
24 8.162\\};
\end{axis}
\end{tikzpicture}%
\begin{tikzpicture}
\begin{axis}[
color=black,
scale only axis,
xmin=1,
xmax=24,
%xtick={1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24},
xtick={0,4,8,12,24}, %%%<------------- here
xlabel={$y$},
ymin=1,
ymax=10,
ytick={1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0,10.0},
yticklabels={1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0,10.0},
y axis line style={blue},
ytick style={blue},
yticklabel style={blue},
axis x line*=bottom,
axis y line*=left,
tick align = outside,]
\addplot [
color=blue,
solid,
line width=0.5pt,
mark size=2.5pt,
mark size=2.5pt,
mark=square*,
mark options={solid,,rotate=180,fill=blue}]
table[row sep=crcr]{
1 4\\
4 6\\
8 8.8\\
12 2.8\\
24 8.162\\};
\end{axis}
\end{tikzpicture}%
\begin{tikzpicture}
\begin{axis}[
color=black,
scale only axis,
xmin=1,
xmax=24,
%xtick={1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24},
xtick={0,4,8,12,24}, %%%<------------- here
xlabel={$y$},
ymin=1,
ymax=10,
ytick={1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0,10.0},
yticklabels={1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0,10.0},
y axis line style={blue},
ytick style={blue},
yticklabel style={blue},
axis x line*=bottom,
axis y line*=left,
tick align = outside,]
\addplot [
color=blue,
solid,
line width=0.5pt,
mark size=2.5pt,
mark size=2.5pt,
mark=square*,
mark options={solid,,rotate=180,fill=blue}]
table[row sep=crcr]{
1 5\\
4 5\\
8 9.8\\
12 6.8\\
24 6.162\\};
\end{axis}
\end{tikzpicture}%
\begin{tikzpicture}
\begin{axis}[
color=black,
scale only axis,
xmin=1,
xmax=24,
%xtick={1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24},
xtick={0,4,8,12,24}, %%%<------------- here
xlabel={$y$},
ymin=1,
ymax=10,
ytick={1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0,10.0},
yticklabels={1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0,10.0},
y axis line style={black},
ytick style={yellow},
yticklabel style={red},
axis x line*=bottom,
axis y line*=left,
tick align = outside,]
\addplot [
color=black,
solid,
line width=0.5pt,
mark size=2.5pt,
mark size=2.5pt,
mark=square*,
mark options={solid,,rotate=180,fill=blue}]
table[row sep=crcr]{
1 5\\
4 5\\
8 9.8\\
12 6.8\\
24 6.162\\};
\addplot [
color=black,
solid,
line width=0.5pt,
mark size=2.5pt,
mark size=2.5pt,
mark=square*,
mark options={solid,,rotate=180,fill=blue}]
table[row sep=crcr]{
1 2\\
4 3\\
8 4.8\\
12 7.8\\
24 8.162\\};
\end{axis}
\end{tikzpicture}%
\end{document}
Code: Select all
\documentclass{standalone}
\usepackage{pgfplots}
\usepgfplotslibrary{polar}
\newcommand*{\sample}{%
\begin{tikzpicture}
\begin{polaraxis}
\addplot+[mark=none,domain=0:720,samples=600]
{sin(2*x)*cos(2*x)};
\end{polaraxis}
\end{tikzpicture}}
\begin{document}
\begin{tabular}{cc}
\sample & \sample \\
\sample & \sample
\end{tabular}
\end{document}
- Stefan Kottwitz
- Site Admin
- Posts: 10360
- Joined: Mon Mar 10, 2008 9:44 pm
Tweaking some parts of a chart
tabular
in my example for arranging the plots. You did not use it in your last code.Previously, you used
tabular
just for printing 1, 2, 3, 4, instead of charts. And you added a table
environment around, which caused the error with the standalone
class.Read my
tabular
example again, and use tabular
for containing your plots.Stefan
Tweaking some parts of a chart
Code: Select all
\documentclass{table}
\usepackage{pgfplots}
\usepgfplotslibrary{axis}
\newcommand*{\sample}{%
\begin{document}
\definecolor{mycolor1}{rgb}{1,0,1}
\definecolor{mycolor2}{rgb}{0,0.498039215803146,0}
\begin{tikzpicture}
\begin{axis}[
color=black,
scale only axis,
xmin=1,
xmax=24,
%xtick={1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24},
xtick={0,4,8,12,24}, %%%<------------- here
xlabel={$y$},
ymin=1,
ymax=10,
ytick={1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0,10.0},
yticklabels={1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0,10.0},
y axis line style={blue},
ytick style={blue},
yticklabel style={blue},
axis x line*=bottom,
axis y line*=left,
tick align = outside,]
\addplot [
color=blue,
solid,
line width=0.5pt,
mark size=2.5pt,
mark size=2.5pt,
mark=square*,
mark options={solid,,rotate=180,fill=blue}]
table[row sep=crcr]{
1 4\\
4 6\\
8 8.8\\
12 2.8\\
24 8.162\\};
\end{axis}
\end{tikzpicture}%
\begin{tikzpicture}
\begin{axis}[
color=black,
scale only axis,
xmin=1,
xmax=24,
%xtick={1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24},
xtick={0,4,8,12,24}, %%%<------------- here
xlabel={$y$},
ymin=1,
ymax=10,
ytick={1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0,10.0},
yticklabels={1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0,10.0},
y axis line style={blue},
ytick style={blue},
yticklabel style={blue},
axis x line*=bottom,
axis y line*=left,
tick align = outside,]
\addplot [
color=blue,
solid,
line width=0.5pt,
mark size=2.5pt,
mark size=2.5pt,
mark=square*,
mark options={solid,,rotate=180,fill=blue}]
table[row sep=crcr]{
1 4\\
4 6\\
8 8.8\\
12 2.8\\
24 8.162\\};
\end{axis}
\end{tikzpicture}%
\begin{tikzpicture}
\begin{axis}[
color=black,
scale only axis,
xmin=1,
xmax=24,
%xtick={1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24},
xtick={0,4,8,12,24}, %%%<------------- here
xlabel={$y$},
ymin=1,
ymax=10,
ytick={1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0,10.0},
yticklabels={1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0,10.0},
y axis line style={blue},
ytick style={blue},
yticklabel style={blue},
axis x line*=bottom,
axis y line*=left,
tick align = outside,]
\addplot [
color=blue,
solid,
line width=0.5pt,
mark size=2.5pt,
mark size=2.5pt,
mark=square*,
mark options={solid,,rotate=180,fill=blue}]
table[row sep=crcr]{
1 5\\
4 5\\
8 9.8\\
12 6.8\\
24 6.162\\};
\end{axis}
\end{tikzpicture}%
\begin{tikzpicture}
\begin{axis}[
color=black,
scale only axis,
xmin=1,
xmax=24,
%xtick={1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24},
xtick={0,4,8,12,24}, %%%<------------- here
xlabel={$y$},
ymin=1,
ymax=10,
ytick={1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0,10.0},
yticklabels={1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0,10.0},
y axis line style={black},
ytick style={yellow},
yticklabel style={red},
axis x line*=bottom,
axis y line*=left,
tick align = outside,]
\addplot [
color=black,
solid,
line width=0.5pt,
mark size=2.5pt,
mark size=2.5pt,
mark=square*,
mark options={solid,,rotate=180,fill=blue}]
table[row sep=crcr]{
1 5\\
4 5\\
8 9.8\\
12 6.8\\
24 6.162\\};
\addplot [
color=black,
solid,
line width=0.5pt,
mark size=2.5pt,
mark size=2.5pt,
mark=square*,
mark options={solid,,rotate=180,fill=blue}]
table[row sep=crcr]{
1 2\\
4 3\\
8 4.8\\
12 7.8\\
24 8.162\\};
\end{axis}
\end{tikzpicture}%
\begin{document}
\begin{tabular}{cc}
\sample & \sample \\
\sample & \sample
\end{tabular}
\end{document}
- Stefan Kottwitz
- Site Admin
- Posts: 10360
- Joined: Mon Mar 10, 2008 9:44 pm
Tweaking some parts of a chart
\sample
which was just a macro created for containing a picture's code. A macro for containing code is one of the most basic things. You can ask simple things here, no problem, but don't skip learning LaTeX and thinking about code.I don't write your thesis or parts of it for the purpose of saving your time so you don't need to learn LaTeX at all. I know you don't want advice, which is what you can get here. You want ready-made code, so perhaps ask a TeX consultant.
You can return any time later here to get advice or small code solutions.
Stefan
Re: Tweaking some parts of a chart
Best regards