File Exchange Pick of the Week

September 24th, 2007

TeX interpreter in x tick and y tick labels

Writing a file that solves a problem that gets called into our tech support team is a very good way of becoming Pick Of The Week. This week a MATLAB user wanted to know how to use the TeX interpreter on x and y ticks. This is not supported, but if you download this file, you will be able to.

6 Responses to “TeX interpreter in x tick and y tick labels”

  1. Roy Goodman replied on :

    As much as I want to use Matlab’s built-in TeX interpreters, they tend to increase the file size (in postscript) to an astounding level, which then causes some scientific journals and the arxiv.org preprint server to reject the files as too big. A workaround is to put plain text in my figures, and ten modify the .eps files with the LaTeX package psfragThis gives much smaller .eps files, but is very inconvenient. Obviously I’d like to do everything in Matlab, but at this point, that doesn’t seem like it’s feasible.

  2. Doug replied on :

    I went to the LaTeX guru here at The MathWorks. He had this to say:

    “When MATLAB saves a LaTeX-interpreted string to an .eps file, it embeds Postscript definition files for each Computer Modern font needed to display the string. MATLAB does this because it does not know which Postscript fonts may be defined on a destination machine that may load the .eps file later.

    In Example 4 from Doug’s video, MATLAB embeds font definitions for CMR10, CMR7, CMR10, CMR7, CMSY7, in that order, into the .eps file. I think it is unnecessary for MATLAB to embed CMR10 and CMR7 twice — this may be a bug. Also, in some future release, we may want to find a way to integrate with psfrag-like apps more efficiently.”

  3. Roy Goodman replied on :

    Doug,
    Thanks for seeking out an answer for me. This issue has been bugging me for a long time.
    Roy

  4. cong replied on :

    Thank you so much!!
    This is what I really want!!!

  5. Ariel Balter replied on :

    Is there a way to control the font used in LaTeX strings?

  6. Doug replied on :

    @ariel,

    http://www.mathworks.com/access/helpdesk/help/techdoc/ref/text_props.html#String

    The /fontname command is what you want.

    Doug

Leave a Reply

Wrap code fragments inside <pre> tags, like this:

<pre class="code">
a = magic(3);
sum(a)
</pre>

If you have a "<" character in your code, either follow it with a space or replace it with "&lt;" (including the semicolon).


Bob, Brett & Jiro share their favorite user-contributed submissions from the File Exchange.

  • Zach: Hi Doug and Les, I didn’t have a lot of time to mess with this, but I did find a work-around. I plotted...
  • hamed: k
  • Les: @Zach This isn’t exactly what you are looking for but at least it puts all three parameters on the same...
  • Zach: Thanks for your suggestions Doug. I’ll give that a shot and see what happens. I’ve seen many of...
  • Doug: @Zach, I would say to use plotYYY, because that is close to what you want, but using depth as Y makes sense....
  • Doug: @Teja, I think this will work: http://www.mathworks .com/access/helpdesk /help/techdoc/ref...
  • Gify: merry christmas :) nice christmas tree! Regards, Janet Gify
  • Teja: Dear Doug Is there anyway to plot a surface from nonuniform data without meshgrid and griddata? Basically i...
  • Zach: I’m working with geophysical data, so I’d like to produce a depth profile. The y-axis would be...
  • Doug: @Ashok First, please do not use variable names that are MATLAB commands (std and mean). Second, p(j) should be...

These postings are the author's and don't necessarily represent the opinions of The MathWorks.