-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to use safe_figure if graphic includes Latex symbol? #15
Comments
Ok, I have found, Thanks, |
Hi Alex,
this figure producing stuff in matlab is just shitty and I've played
around with it a lot. Same for the tex/latex support. You can set the
interpreter to tex or latex and will do sometimes very different things,
which are not at all clear nor documented.
I've now completely dumped this approach and write out only data files
from matlab and later use tikz/pgfplots in latex. It's also a bit
complicated but way more stable and flexible (especially if you have
data that you want to show in different ways).
Elmar
PS: you can look into my Fourier project for the tikz/pgfplots stuff.
…On 08/02/17 10:14, Alexander Litvinenko wrote:
Ok, I have found,
In safe_figure.m it was
%set( h_text, 'interpreter', 'latex' );
set( h_text, 'interpreter', text_interpreter );
Now
set( h_text, 'interpreter', 'latex' );
%set( h_text, 'interpreter', text_interpreter );
Thanks,
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#15 (comment)>, or
mute the thread
<https://github.com/notifications/unsubscribe-auth/AAG0a3JbjnodIA18w9TP9cyOGJlpgroEks5raYdqgaJpZM4L6jDA>.
--
Dr. Elmar Zander, Inst. f. Wiss. Rechnen, TU Braunschweig
Mühlenpfordstr. 23, D-38106 Braunschweig
Tel. +49(531)391-3011, E-mail: e.zander@tu-bs.de
|
Thanks a lot, |
You just write out the data (which you can see in the .dat files which
are located in the 'tikz' subdirectory in my project) using some of the
standard matlab functions to write ascii data to a file.
For example:
x = linspace(0, 1); y = sin(x); T = table( {x, y}, 'VariableNames',
{'x', 'y'} ); writetable(T, 'sin.dat');
Then you can use pgfplots in your tex files to plot it, like
\usepackage{pgfplots} ... \begin{document} ... \begin{tikzpicture}
\begin{axis} \pgfplotstableread[col sep=comma]{sin.dat}\data \addplot
table[x=x,y=y] {\data}; \addlegendentry{Sine function}; \end{axis}
\end{tikzpicture}
That's it. Of course you can build a lot of other stuff around that,
like nicer formatting or making writing the data from matlab easier
(which I've done, of course), but basically that's all there is to
it.... And that's why currently I'm not developing the plotting
functions from matlab/sglib any further...
Elmar
…On 08.02.2017 15:52, Alexander Litvinenko wrote:
Thanks a lot,
But I cant find tikz/pgfplots stuff. Is it a part of sglib ?
sglib-testing? a separate project? where?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#15 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAG0a0BLe7n6YrMp364UAXGOJTg4mzzcks5radaogaJpZM4L6jDA>.
--
Dr. Elmar Zander, Inst. f. Wiss. Rechnen, TU Braunschweig
Mühlenpfordtstr. 23, D-38106 Braunschweig
Tel. +49(531)391-3011, E-mail: e.zander@tu-bs.de
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I do
plot(x,y75,':g','LineWidth',2);
ylabel('$\ell$','Interpreter','latex');
save_figure(gcf, 'FileName', 'figdir', '.', 'fontsize', 16)
then if I open FileName.eps, I see something like$\ell$ . So, Latex interpreter is switched off when I safe the figure into file.At the same time in Matlab Window latex symbols are displayed correct.
Probably I need to use something like
save_figure(gcf, 'FileName', 'figdir', '.', 'fontsize', 16, 'latex_param' ), but an example would be very helpful.
Thanks,
The text was updated successfully, but these errors were encountered: