R 如何在LaTeX中使用ggplot的符号和颜色作为图形标题?
我在写一篇论文,我在用R来画我的情节。《华尔街日报》的指导方针规定,图的图例必须在图的标题中。所以我想知道这是否可能,以及如何在LaTeX中使用R符号和颜色作为标题 此外,红色圆圈未出现在已编译文档中 在R中绘图R 如何在LaTeX中使用ggplot的符号和颜色作为图形标题?,r,text,ggplot2,latex,caption,R,Text,Ggplot2,Latex,Caption,我在写一篇论文,我在用R来画我的情节。《华尔街日报》的指导方针规定,图的图例必须在图的标题中。所以我想知道这是否可能,以及如何在LaTeX中使用R符号和颜色作为标题 此外,红色圆圈未出现在已编译文档中 在R中绘图 library(ggplot2) A <- seq(0, 10, by = 1) B <- seq(0, 20, by = 2) C <- seq(0, 30, by = 3) DF <- data.frame(A, B, C) pdf( file =
library(ggplot2)
A <- seq(0, 10, by = 1)
B <- seq(0, 20, by = 2)
C <- seq(0, 30, by = 3)
DF <- data.frame(A, B, C)
pdf(
file = "Figure1.pdf",
width = 8/2.54,
height = 5/2.54,
pointsize = 8
)
ggplot(data = DF) +
geom_point(aes(x = 0:10, y = A, color = "A", shape = "A")) +
geom_point(aes(x = 0:10, y = B, color = "B", shape = "B")) +
geom_point(aes(x = 0:10, y = C, color = "C", shape = "C")) +
scale_shape_manual(name = "Legend", values = c(0, 1, 2)) +
scale_color_manual(name = "Legend", values = c("black", "red", "blue"))
dev.off()
有什么帮助吗?我会在LaTeX中找到相应的符号并手动添加颜色。我可以推荐寻找符号。三角形符号如下所示: 相关:
\documentclass[10pt,a4paper, twocolumns]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\begin{document}
This is a test\par
%
\begin{figure}[htb]
\centering
\includegraphics{Figure1.pdf}
\caption{I want here the symbols and colors that were used in R}
\label{fig:figure1}
\end{figure}
\end{document}