2017-12-18 326 views
2

我正在写一篇论文,我正在使用R作为我的情节。期刊指南指出,情节的传说必须在数字标题中。所以我想知道是否有可能以及如何将R符号和颜色用于LaTeX的标题中?如何将ggplot的符号和颜色用于LaTeX中的图形标题?

此外,红色圆圈并未出现在已编译的文档中。

中的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 = "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() 

enter image description here

的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} 

enter image description here

任何帮助情节?

+1

相关:https://stackoverflow.com/q/35936319/471093 https://tex.stackexchange.com/questions/102925/how-can -i-insert-the-symbols-into-the-caption-of-a-figure https://github.com/baptiste/caption – baptiste

回答

1

我只是在LaTeX中找到相应的符号并手动添加着色。我可以推荐detexify查找符号。三角符号,可以发现这样的:

Like this

相关问题