3

Today I face the problem of writing a big article and I need my plots to look very nice and neat. I've looked into gnuplot documentation and was horrified: there are many different terminals with tons of options. I always use epslatex with only size option terminal in gnuplot to include my plots to latex projects. But there are epscairo, latexcairo, latex, pslatex, tikz and another different terminals. Which of them I should use? Which options I should use? Could you provide some recommendations how to get good-looking plots, please?

More accurate questions:

1) Which terminal and options I should use to get the most beautiful vector plot with latex text processing to input it in latex project later?

Please, provide the example like set terminal type [options] if it possible

2) Which terminal and options I should use to get the most beautiful NON-vector plot with latex text-processing? For example, if I want share my plot as just image.

3) Are there something like color schemes for plots? For example I have 10 sets of data with approximation to plot them on single figure. I would like to plot data with points, and an approximation with lines, so, I need 20 different colors which should look nice, and colors of point and line should combine. It's very hard to pick up colors empirically.

  • 1
    I would use pgfplots instead of gnuplot or together with gnuplot (gnuplot only to calculate the values). – Schweinebacke Apr 15 '17 at 7:10
  • @Schweinebacke, thanks for answer. Does pgfplots has some features that gnuplot doesn't have? Maybe something like color schemes which I've described in 3 paragraph? Or another useful things? Because I am a bit of skeptic of learning new tool if it does not have good advantages. – danielleontiev Apr 15 '17 at 10:57
  • pgfplots provides a lot of features, but you are the only one who can decide whether or not these are relevant for you. Starting from your question: You do not need to think about text processing, because text processing is always done using LaTeX. There are something like color schemes but AFAIK the default are not made for 20 different colors. You can add additional graphic elements using very powerful TikZ. – Schweinebacke Apr 15 '17 at 11:28
  • Take a look at this thread: tex.stackexchange.com/questions/129771/… – tuxador Apr 15 '17 at 12:52
  • @tuxador, thank you, it provides some new information for me, but unfortunately does not cover some terminal types am interesting in – danielleontiev Apr 15 '17 at 16:15
4
  1. For some nice vectorised graphics in ones latex I use gnuplot like this with cairolatex output

    set term cairolatex pdf
    set output "data.tex"
    plot 'data.csv' using 1:2 with lines,
    

    And then I use the output from gnuplot in my latex like this

    \begin{figure}
      \centering
      \input{data.tex}
      \caption{}
    \end{figure} 
    

enter image description here

  1. For the non-vectorised version you can just change

    set term cairolatex pdf
    set output "data.tex"
    

    to

    set term png
    set output "data.png"
    
  2. As for color schemes I just go with the defaults or black so I don`t really know

  • Thanks a lot for your answer. In fact it's almost year since I've asked, but I still haven't found universal solution for my plots. I'll make a note your variant, thanks – danielleontiev Mar 24 '18 at 0:28
  • I would suggest having #3 as a separate question. Maybe you'll get a better response then – Fredrik Mar 24 '18 at 9:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.