Graphics, Figures & Tables ⇒ How to include graphs with different colored lines
How to include graphs with different colored lines
Hi,
I am relatively inexperienced with LaTex (I am using PcTex) and am writing a paper that has graphs with two different line colors, but includegraphics doesn't seem to support it. I have tried several different export formats: png, eps, etc. without success Thank you.
I am relatively inexperienced with LaTex (I am using PcTex) and am writing a paper that has graphs with two different line colors, but includegraphics doesn't seem to support it. I have tried several different export formats: png, eps, etc. without success Thank you.
NEW: TikZ book now 40% off at Amazon.com for a short time.
- Stefan Kottwitz
- Site Admin
- Posts: 10323
- Joined: Mon Mar 10, 2008 9:44 pm
How to include graphs with different colored lines
Hi,
welcome to the forum!
\includegraphics supports colors. Perhaps post the exported image here as attachment (as pdf in the best case, or png; with eps I'm not sure about color conversion), and we can look at it.
Stefan
welcome to the forum!
\includegraphics supports colors. Perhaps post the exported image here as attachment (as pdf in the best case, or png; with eps I'm not sure about color conversion), and we can look at it.
Stefan
LaTeX.org admin
How to include graphs with different colored lines
Stefan,
Thank you so much! Attached is a pdf example of what I am trying to include. Note that it was exported from RStudio.
Best,
Jim
Thank you so much! Attached is a pdf example of what I am trying to include. Note that it was exported from RStudio.
Best,
Jim
- Attachments
-
- Rplot02.pdf
- (10.96 KiB) Downloaded 129 times
- Stefan Kottwitz
- Site Admin
- Posts: 10323
- Joined: Mon Mar 10, 2008 9:44 pm
How to include graphs with different colored lines
Hi Jim,
I get two colors - try and click the "Run LaTeX here" button:
What do you get?
Stefan
I get two colors - try and click the "Run LaTeX here" button:
Code: Select all
Code, edit and compile here:
\documentclass{article}\usepackage{graphicx}\begin{document}\includegraphics[width=\textwidth]{Rplot02.pdf}\end{document}
Stefan
LaTeX.org admin
How to include graphs with different colored lines
Stefan,
Thank you for your help. I think I may have sorted out the issue. For some reason, the DVI file only shows black and white, but curiously when I convert the DVI to pdf, the color is there. Attached are the examples. Have you run across this before? Any suggestion as to a fix? Thanks, again.
Best,
Jim
Thank you for your help. I think I may have sorted out the issue. For some reason, the DVI file only shows black and white, but curiously when I convert the DVI to pdf, the color is there. Attached are the examples. Have you run across this before? Any suggestion as to a fix? Thanks, again.
Best,
Jim
- Attachments
-
- FigTest.pdf
- (25.4 KiB) Downloaded 131 times
-
- DVI Screen Capture.png (24.87 KiB) Viewed 2072 times
- Stefan Kottwitz
- Site Admin
- Posts: 10323
- Joined: Mon Mar 10, 2008 9:44 pm
How to include graphs with different colored lines
Hi Jim,
DVI viewers are sometimes limited in capabilities, this may be a cause. Another possible cause may be that the coloring, in this case, uses a PDF feature which is not interpreted by the DVI viewer but survives converting to PDF.
I guess DVI will not be your final document format, so it's probably ok, just annoying in the preview.
Btw. I would use pgfplots for such jobs, see, for example, PGFplots.net. I just finished a plotting chapter of my upcoming TikZ book, I could send you a copy of that chapter if you like.
Stefan
DVI viewers are sometimes limited in capabilities, this may be a cause. Another possible cause may be that the coloring, in this case, uses a PDF feature which is not interpreted by the DVI viewer but survives converting to PDF.
I guess DVI will not be your final document format, so it's probably ok, just annoying in the preview.
Btw. I would use pgfplots for such jobs, see, for example, PGFplots.net. I just finished a plotting chapter of my upcoming TikZ book, I could send you a copy of that chapter if you like.
Stefan
LaTeX.org admin
How to include graphs with different colored lines
Thank you, Stefan.
Right that I would use the pdf for printing and dissemination, but frustrating nonetheless. Yes, I would like to read your chapter on pgfplots as ultimately I would like nicer looking graphs. I truly appreciate your help.
Best,
Jim
Right that I would use the pdf for printing and dissemination, but frustrating nonetheless. Yes, I would like to read your chapter on pgfplots as ultimately I would like nicer looking graphs. I truly appreciate your help.
Best,
Jim