2017-12-18 256 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

相關問題