# Creating plots in Latex - easy to learn? [closed]

I am currently working on my summer project for which I created the following plot with Mathematica:

Now I am not 100% satisfied with the results and one of my professors recommended PGF and TikZ. The problem is I don't know anything about PGF and TikZ and I have to submit my project in 1.5 months.

So should I try to learn how to create `beautiful` plots with PGF and TikZ (i.e. is it possible to learn it in a week or so?) or should I just stick with my Mathematica plot? And are there even other alternatives?

edit:
As a few people have requested it, here is the Mathematica code:

``````max = 102000;
psi[x0_, y0_] := Module[{x = x0, y = y0, n = 2, c = 0},
Do[If[Max[First[Transpose[FactorInteger[n]]]] <= y, c++]; n++;, {x}]; c]
data = Parallelize[Table[{n, psi[n, Ceiling[Sqrt[n]]]/n*100}, {n, 2, max, 1000}]];
p1 = Plot[{PrimePi[Sqrt[n]]/PrimePi[n]*100}, {n, 2, max}, PlotRange -> {{0, max}, {0, 55}},
PlotStyle -> {Gray, Thick}, Epilog -> {Inset[Style["\[Pi](\!\(\*SqrtBox[\(n\)]\))/\[Pi](n)",
FontSize -> 13, Bold], {40000, 7}], Inset[Style["\[Psi](n,\!\(\*SqrtBox[\(n\)]\))/n",
FontSize -> 13, Bold], {max/2, 43}]}];
p2 = ListLinePlot[data, PlotRange -> {{0, max}, {0, 100}}, PlotStyle -> {Thick, Gray}];
p3 = Plot[{30}, {n, 2, max}, PlotRange -> {{0, max}, {0, 100}}, PlotStyle -> {Gray, Dashed}];
Show[p1, p2, p3, AxesLabel -> Table[Text[Style[{"n", "%"}[[i]], FontSize -> 13, Bold, Italic]],
{i, 1, 2}], Ticks -> {Table[1/10*(max - 2000)*k, {k, 0, 9, 3}], Table[10 k, {k, 1, 10}]}]
``````
• I asked a similar question at tex.stackexchange.com/questions/116869/…. If you are reasonably comfortable with `LaTeX` you can learn enough `pgfplots` functionality in a week or so to do a 1.5 month project - particularly with help from this site - but I don't know whether TeX is powerful/convenient enough for the actual calculations you need. Those may call for mathematica, in which case the time invested in TeX may not pay off. Commented Jul 13, 2013 at 16:22
• In my opinion the easiest thing to do is 1) elaborate the data you want to plot with some powerful program like `Mathematica`. 2) produce a file with the data and use `pgfplots` to plot it
– Red
Commented Jul 13, 2013 at 17:21
• The mathematical functions available in `pgfplots` can not compete with Mathematica. That is not the point though, I export all complicated data to ascii files and use pgfplots to create the plots. Just try it out for an afternoon or so, it is not that complicated and the manual is great. Commented Jul 13, 2013 at 17:21
• If you already have the data, one week is even too much. Edit your question and include some data (of 10-15 rows) otherwise this question is boring :P No seriously, just start with the manual it's quite straightforward but don't rush because it needs some initial care. As long as we can save another soul from matlab or mathematica (yes no capital letters, they can sue me) it would be great. Commented Jul 13, 2013 at 18:02
• @m0nhawk I edited my question. Commented Jul 13, 2013 at 18:53