Gnuplot: line opacity / transparency?

风流意气都作罢 提交于 2020-05-24 21:24:09

问题


I am using Gnuplot to successfully plot some time series data. However, the series are fairly dense (10,000's of samples in about 5 inches of space), and when I plot multiple series, it is hard to see underneath the series that was plotted on top. Is there any way to make the lines have a bit of opacity or transparency (i.e. make the line transparent so underneath lines are visible)?

Excel has this capability, but I would much prefer to use Gnuplot.

Below is a sample of what I'm talking about. You can't see the red lines under the green lines. I would actually like to add a third time series. I am plotting with the command:

plot [][-3:3] 'samples_all.csv' using 1:7 title 'horizontal' w l ls 1, '' using 1:8 title 'vertical' w l ls 2"

enter image description here


回答1:


Good news! This has been implemented in gnuplot. Example syntax is

plot x lw 10, -x lw 10 lc rgb "#77000000"

This will plot x as a red line and -x as a transparent black line (it looks gray). The first pair of two characters in the rgb specification define the alpha (transparency) channel ("#AARRGGBB"). The normal syntax ("#RRGGBB") still works.

old (gnuplot < 5.0 or so) answer for reference:

If you want to make lines plotted for time series data, the answer is no (see discussion here). You can't set a line style to be transparent. Transparency only works for filling under curves, and it has to be printed to the right terminal type.

I ran into this problem myself recently, I hope this feature will be added in a future version of gnuplot.




回答2:


This may be what you're looking for.



来源:https://stackoverflow.com/questions/12325410/gnuplot-line-opacity-transparency

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!