# Latex typesetting for axis title not working with Matlab

**URL:** <https://community.plotly.com/t/latex-typesetting-for-axis-title-not-working-with-matlab/4379>\
**Category:** 📊 Plotly Python\
**Created:** [May 30, 2017, 6:34pm UTC](https://community.plotly.com/t/latex-typesetting-for-axis-title-not-working-with-matlab/4379 "2017-05-30T18:34:48Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![borregod](https://avatars.discourse-cdn.com/v4/letter/b/439d5e/32.png) [@borregod](https://community.plotly.com/u/borregod)\
**Post date:** [May 30, 2017, 6:34pm UTC](https://community.plotly.com/t/latex-typesetting-for-axis-title-not-working-with-matlab/4379/1 "2017-05-30T18:34:48Z")

</div>

I know this feature used to work. However, now when I include latex in the title I get a plot with no titles.

Any ideas?

I am using:  
Matlab R2017a (9.2.0.538062)  
64-bit (maci64)

and

Matlab R2016b (9.1.0.441655)  
64-bit(maci64)

I edited post to show a simple example.

```auto
trace1 = struct(...
    'x', [1, 2, 3, 4], ...
    'y', [1, 4, 9, 16], ...
    'name', 'x2', ...
    'type', 'scatter');
trace2 = struct(...
    'x', [1, 2, 3, 4], ...
    'y', [0.5, 2, 4.5, 8], ...
    'name', 'x1', ...
    'type', 'scatter');
data = {trace1, trace2};
layout = struct(...
    'title', 'Latex Example',...
    'xaxis', struct('title', '$\sqrt{(n_\text{c}(t|{T_\text{early}}))}$'), ...
    'yaxis', struct('title', 'No latex'));

p = plotlyfig;
p.data=data;
p.layout=layout;
saveplotlyfig(p,'latex_example.pdf');

```

 ![](https://us1.discourse-cdn.com/flex024/uploads/plot/original/2X/5/5b4152cc5d2bc9e41263d4ea9a3df0fd9bee8674.png)

---

<div class="post-metadata">

**Author:** ![bart](https://avatars.discourse-cdn.com/v4/letter/b/f19dbf/32.png) [@bart](https://community.plotly.com/u/bart)\
**Post date:** [June 1, 2017, 12:56pm UTC](https://community.plotly.com/t/latex-typesetting-for-axis-title-not-working-with-matlab/4379/2 "2017-06-01T12:56:17Z")

</div>

I am having the same problem, using Plotly 1.0 and 2.0.

---

<div class="post-metadata">

**Author:** ![borregod](https://avatars.discourse-cdn.com/v4/letter/b/439d5e/32.png) [@borregod](https://community.plotly.com/u/borregod)\
**Post date:** [June 1, 2017, 1:20pm UTC](https://community.plotly.com/t/latex-typesetting-for-axis-title-not-working-with-matlab/4379/3 "2017-06-01T13:20:24Z")

</div>

What version of Matlab are you using?

Less than two weeks ago I was able to generate graphs with LaTeX in the axis title. I don’t know what changed.

```auto
$\text{Absorbed Dose}\;\left(\mu\,Gy\right)$

```

to yield the attached figure.

 ![](https://us1.discourse-cdn.com/flex024/uploads/plot/original/2X/7/7b66fb59feee4f4d157d7fe344f67a9f0eee25e7.png)

---

<div class="post-metadata">

**Author:** ![bart](https://avatars.discourse-cdn.com/v4/letter/b/f19dbf/32.png) [@bart](https://community.plotly.com/u/bart)\
**Post date:** [June 1, 2017, 1:22pm UTC](https://community.plotly.com/t/latex-typesetting-for-axis-title-not-working-with-matlab/4379/4 "2017-06-01T13:22:40Z")

</div>

I’m using python to generate the graphs, but I think it’s a problem with plotly in general. It also worked for me until a couple of weeks ago. The only solution I currently have is to take a screenshot of the graph rather than exporting it.

---

<div class="post-metadata">

**Author:** ![slabko](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/slabko/32/14793_2.png) [@slabko](https://community.plotly.com/u/slabko)\
**Post date:** [April 11, 2021, 8:49pm UTC](https://community.plotly.com/t/latex-typesetting-for-axis-title-not-working-with-matlab/4379/5 "2021-04-11T20:49:38Z")

</div>

I have a similar problem with plotly for python. As soon as I start using LaTeX in the title of y-axis the title disappears completely. At the same time x-axis title works just fine. I use Plotly version 4.14.3 (installed from conda)
