Alx
Alx

Reputation: 133

Bad output of pdfcairo terminal

I see very poor quality of pdfcairo terminal on latest gnuplot 5.2. My very simple script to test is:

reset
set terminal pdfcairo font ", 12"
set output 'graph.pdf' 

set samples 10000
unset key

plot sin(x**2) w l

reset
set term wxt
set out

The out pdf is: I did maximal zoom in pdf viewer

One can see strange jags. Picture goes even worse if we increase number of samples. It is very strange to me, as I thought curve shoud became more smooth with increasing number of samples.

The same behavior is observed when using export to pdf from wxt terminal. But if I set qt terminal and then make export to pdf I get the output curve much better with the same set samples 10000: Not ideal, but much much better

What is going on? Lack of antialiasing in pdfcairo terminal?

EDIT

I found discussion about the same issue here. One can take script from that thread and change samples to higher value, say 10000. This leads to "stepwise" lines instead of smooth curves when we zoom-in the plot.

Upvotes: 2

Views: 894

Answers (1)

ewcz
ewcz

Reputation: 13087

It looks like some artefact of the line endings and joins (triggered by the mitering effect of the default butt style) of the elementary line segments within the plot due to finite line width. In order to mitigate this, it seems to help to use:

set terminal pdfcairo rounded font ",12"

i.e., to prescribe rounded line endings/joins instead of the default butt.

Upvotes: 2

Related Questions