# Canvas to TeX: no markers, no transparency

**URL:** <https://root-forum.cern.ch/t/canvas-to-tex-no-markers-no-transparency/33426>\
**Category:** Newbie\
**Created:** [April 2, 2019, 7:54pm UTC](https://root-forum.cern.ch/t/canvas-to-tex-no-markers-no-transparency/33426 "2019-04-02T19:54:57Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![berserker](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/berserker/32/17693_2.png) [@berserker](https://root-forum.cern.ch/u/berserker)\
**Post date:** [April 2, 2019, 7:54pm UTC](https://root-forum.cern.ch/t/canvas-to-tex-no-markers-no-transparency/33426/1 "2019-04-02T19:54:57Z")

</div>

Here are 2 files:

- [c.pdf](https://root-forum.cern.ch/uploads/default/original/3X/2/9/2985c8ae5b51d545768f54eb19a53c2a20802d1a.pdf) (20.5 KB) a canvas saved as PDF file
- [tex.pdf](https://root-forum.cern.ch/uploads/default/original/3X/8/4/8476250750c4d676545f7c2064cedea8ed774720.pdf) (20.3 KB) a canvas saved to TeX file and then included into a `\documentclass{standalone}` document.

As it can be seen, in the second case there are no markers and transparency. Why?

P.S. I use ROOT 6.14/00 on Ubuntu 18.04.

---

<div class="post-metadata">

**Author:** ![couet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/couet/32/12037_2.png) [@couet](https://root-forum.cern.ch/u/couet)\
**Post date:** [April 3, 2019, 8:31am UTC](https://root-forum.cern.ch/t/canvas-to-tex-no-markers-no-transparency/33426/2 "2019-04-03T08:31:35Z")

</div>

> [@berserker](#):
>
> As it can be seen, in the second case there are no markers and transparency. Why?

Could you provide a small macro reproducing the problem ?  
Transparency is not available for TikZ output but the markers should be there.

---

<div class="post-metadata">

**Author:** ![berserker](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/berserker/32/17693_2.png) [@berserker](https://root-forum.cern.ch/u/berserker)\
**Post date:** [April 3, 2019, 9:32am UTC](https://root-forum.cern.ch/t/canvas-to-tex-no-markers-no-transparency/33426/3 "2019-04-03T09:32:25Z")

</div>

> [@couet](#):
>
> Transparency is not available for TikZ output

> [@https://root.cern.ch/doc/v614/classTAttFill.html](#):
>
> The transparency is available on all platforms when the `flagOpenGL.CanvasPreferGL` is set to `1` in `$ROOTSYS/etc/system.rootrc` , or on Mac with the Cocoa backend. On the file output it is visible with PDF, PNG, Gif, JPEG, SVG, **TeX** … but not PostScript.

Post must be at least 20 characters.

---

<div class="post-metadata">

**Author:** ![Axel](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/axel/32/11084_2.png) [@Axel](https://root-forum.cern.ch/u/Axel)\
**Post date:** [April 3, 2019, 10:07am UTC](https://root-forum.cern.ch/t/canvas-to-tex-no-markers-no-transparency/33426/4 "2019-04-03T10:07:15Z")

</div>

@couet I believe @berserker is pointing out that the doc should be updated, mentioning that TikZ (aka `TeX` output as the doc currently calls it) does in fact _not_ support transparency.

---

<div class="post-metadata">

**Author:** ![berserker](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/berserker/32/17693_2.png) [@berserker](https://root-forum.cern.ch/u/berserker)\
**Post date:** [April 3, 2019, 10:38am UTC](https://root-forum.cern.ch/t/canvas-to-tex-no-markers-no-transparency/33426/5 "2019-04-03T10:38:40Z")

</div>

> [@Axel](#):
>
> the doc should be updated

Or the code… (Post must be at least 20 characters.)

---

<div class="post-metadata">

**Author:** ![couet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/couet/32/12037_2.png) [@couet](https://root-forum.cern.ch/u/couet)\
**Post date:** [April 3, 2019, 10:39am UTC](https://root-forum.cern.ch/t/canvas-to-tex-no-markers-no-transparency/33426/6 "2019-04-03T10:39:09Z")

</div>

Yes TAttFill description was not correct. All the other TAtt\* and TColor are fine. Now fixed. Still the marker issue would need some reproducer to be understood.

---

<div class="post-metadata">

**Author:** ![couet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/couet/32/12037_2.png) [@couet](https://root-forum.cern.ch/u/couet)\
**Post date:** [April 3, 2019, 10:44am UTC](https://root-forum.cern.ch/t/canvas-to-tex-no-markers-no-transparency/33426/7 "2019-04-03T10:44:21Z")

</div>

> [@berserker](#):
>
> Or the code…

To be complete, it seems that TiKz allows to play with “opacity” for filled polygon. The ROOT backend uses it. But for line, text and marker it seems it does not… as far as I can see on the web.

---

<div class="post-metadata">

**Author:** ![couet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/couet/32/12037_2.png) [@couet](https://root-forum.cern.ch/u/couet)\
**Post date:** [April 3, 2019, 10:48am UTC](https://root-forum.cern.ch/t/canvas-to-tex-no-markers-no-transparency/33426/8 "2019-04-03T10:48:59Z")

</div>

That’s the reason why TeX was mentioned in TAttFill only … I made it clear now …

---

<div class="post-metadata">

**Author:** ![berserker](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/berserker/32/17693_2.png) [@berserker](https://root-forum.cern.ch/u/berserker)\
**Post date:** [April 3, 2019, 10:54am UTC](https://root-forum.cern.ch/t/canvas-to-tex-no-markers-no-transparency/33426/9 "2019-04-03T10:54:47Z")

</div>

> [@couet](#):
>
> But for line, text and marker it seems it does not

```latex
\documentclass[tikz]{standalone}

\begin{document}
\begin{tikzpicture}[line width=1ex]
    \draw[blue, opacity=0.5] (0,0) -- (3,1);
    \draw[red, opacity=0.5] (0,1) -- (3,0);
\end{tikzpicture}
\end{document}

```

![canvas](https://root-forum.cern.ch/uploads/default/original/3X/5/c/5cc4000809f5bc5e8aaa8a3295118ac892e78fe8.png)

---

<div class="post-metadata">

**Author:** ![berserker](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/berserker/32/17693_2.png) [@berserker](https://root-forum.cern.ch/u/berserker)\
**Post date:** [April 3, 2019, 11:14am UTC](https://root-forum.cern.ch/t/canvas-to-tex-no-markers-no-transparency/33426/10 "2019-04-03T11:14:21Z")

</div>

I forgot to `\usepgflibrary{plotmarks}`.

---

<div class="post-metadata">

**Author:** ![couet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/couet/32/12037_2.png) [@couet](https://root-forum.cern.ch/u/couet)\
**Post date:** [April 3, 2019, 11:24am UTC](https://root-forum.cern.ch/t/canvas-to-tex-no-markers-no-transparency/33426/11 "2019-04-03T11:24:40Z")

</div>

Ok I will see how to upgrade.  
What about text ?

---

<div class="post-metadata">

**Author:** ![berserker](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/berserker/32/17693_2.png) [@berserker](https://root-forum.cern.ch/u/berserker)\
**Post date:** [April 3, 2019, 11:25am UTC](https://root-forum.cern.ch/t/canvas-to-tex-no-markers-no-transparency/33426/12 "2019-04-03T11:25:30Z")

</div>

> [@couet](#):
>
> What about text ?

```tex
\begin{tikzpicture}
    \node[blue, opacity=0.5] {$123$};
    \node[red, opacity=0.5] {$456$};
\end{tikzpicture}

```

![image](https://root-forum.cern.ch/uploads/default/original/3X/9/d/9d9d1e93ed1a1509490d9bd14a594c165211b35e.png)

---

<div class="post-metadata">

**Author:** ![couet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/couet/32/12037_2.png) [@couet](https://root-forum.cern.ch/u/couet)\
**Post date:** [April 3, 2019, 11:40am UTC](https://root-forum.cern.ch/t/canvas-to-tex-no-markers-no-transparency/33426/13 "2019-04-03T11:40:42Z")

</div>

Thanks for your input. The transparency macro [here](https://root.cern/doc/master/classTColor.html#C07) produces the attached TeX file. As you see the structure is a bit different from what you just exposed. I will see how to do it.

[transparency.txt](https://root-forum.cern.ch/uploads/default/original/3X/e/0/e04c8bd93a4aa30de66cd3c9c0215b064f696047.txt) (10.2 KB)

---

<div class="post-metadata">

**Author:** ![berserker](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/berserker/32/17693_2.png) [@berserker](https://root-forum.cern.ch/u/berserker)\
**Post date:** [April 3, 2019, 11:56am UTC](https://root-forum.cern.ch/t/canvas-to-tex-no-markers-no-transparency/33426/14 "2019-04-03T11:56:47Z")

</div>

> [@couet](#):
>
> As you see the structure is a bit different from what you just exposed.

What do you mean?

```tex
\draw [anchor=base west,] (2.77937,3.55301) node[scale=4.0092, color=c, opacity=0.476, rotate=26]{This text is transparent};

```

makes the text transparent.

---

<div class="post-metadata">

**Author:** ![couet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/couet/32/12037_2.png) [@couet](https://root-forum.cern.ch/u/couet)\
**Post date:** [April 3, 2019, 3:10pm UTC](https://root-forum.cern.ch/t/canvas-to-tex-no-markers-no-transparency/33426/15 "2019-04-03T15:10:44Z")

</div>

Transparency is now implemented for line, text and marker in the TeX output.

 ![25](https://root-forum.cern.ch/uploads/default/original/3X/4/f/4f60ab0f0dee7f6c0ef6e856a841e4ced0116917.png)
