2014b axis label errors when printing to postscript
古いコメントを表示
I am getting spaces in the axis label when I use a subscript. This behavior is new with 2014b, the same function for sure doesn't do this is 2013a. I was having troubles using greek letters as well, but found a work around. The issue with the Greek letters went away when setting the axis label font weight to normal, setting it to bold caused the issue (directly or indirectly, not sure). Any thoughts on why the print command is behaving differently? Currently using painters rederer, which is needed for impage quality and file size. I am also using MATLAB on Linux.
4 件のコメント
Bruno Pop-Stefanov
2014 年 10 月 23 日
Could you paste some reproduction code that we can try to see the behavior you are seeing? Can you also please explain what you were expecting and how what you are getting is different? Thank you.
Nick Powell
2014 年 10 月 27 日
Nick Powell
2014 年 10 月 27 日
編集済み: Nick Powell
2014 年 10 月 27 日
Aaron Sigut
2014 年 11 月 19 日
I have noticed the same thing (R2014b on ubuntu 12.04)--
plot(1:10,1:10,'bo');xlabel('\sigma \theta \rho','FontWeight','Bold')
will give correct output on the screen. However, print -depsc, print -dpdf, etc... will produce output with an x axis label of "< 3 ;" If you repeat this command, but leave out the Bold, it will print correctly. This was not an issue for R2014a. Also R2014b seems to have a bounding-box problem in its output as the plot is squeezed to the bottom of the page,sometime with portions cut off.
回答 (3 件)
This is under investigation by our developers.
We have found there is a gap, the size of which is dependent on the length of the first string, between strings in postscript and pdf output when painters is used. The problem does not occur when using opengl or printing to an image format or to a printer.
Invoke opengl when printing with -opengl flag.
7 件のコメント
Aaron Sigut
2014 年 11 月 20 日
Thanks. -opengl restores the greek letters, but, unfortunately, I find the output .eps or .pdf file to be of much lower quality (in fact, it almost looks like bold fonts were not used at all and the symbols and letters have a pixelated quality to them. The "evince" utility also now complains the pdf file is damaged, but still plots something). This is a larger issue, at least for me, as I am trying to create publication-quality plots, and I find bold axis labels, etc..., are really required.
Doug Hull
2014 年 11 月 20 日
This is the difference between raster and vector graphics. If you can send your use case through www.mathworks.com/support that would help us as we try to get the fix in for this.
Nick Powell
2015 年 2 月 3 日
編集済み: Nick Powell
2015 年 2 月 3 日
Nick Powell
2015 年 2 月 4 日
Victoria Walker
2015 年 4 月 17 日
I contacted support to ask about progress on this bug. I was told that they are still working on it and the temporary workaround is to use the LaTeX interpreter instead of the tex interpreter. This can be done by: set(0,'defaultTextInterpreter','latex'); and placed in your startup.m file to make it permanent. Don't forget that when using the LaTeX interpreter you have to place $$ around your tex (e.g., $\gamma$ rather than \gamma).
Initial Conditions
2016 年 6 月 15 日
Just wondering if there is any fix for this yet - it's driving me mad!
Victoria Walker
2018 年 6 月 22 日
I can confirm that the issue still exists in R2018b. The bug report (https://www.mathworks.com/support/bugreports/1165657) was marked solved in R2017b w/ the unacceptable workaround of using the OpenGL renderer.
Yair Altman
2015 年 2 月 25 日
1 投票
I've just committed a fix in export_fig for this Matlab bug - any Tex/LaTeX strings will now appear unbolded in the output, but at least they will be displayed correctly. So anyone who finds this bug annoying can either unbolden their labels, or use export_fig instead of print().
James Thunes
2015 年 1 月 6 日
0 投票
The problem appears to be due to the way that bold characters are handled. A quick example using R2014b:
plot(0:0.01:2*pi,sin(0:0.01:2*pi)); xlabel('\eta'); print('-dpdf','test')
The above code creates the correct pdf using the default export settings. When the font is changed to bold however, the "eta" is printed as "2"
Changing to a raster image format (eg png) does export the text correctly, but I agree with Aaron. Raster graphics are not good enough for publication.
カテゴリ
ヘルプ センター および File Exchange で Labels and Annotations についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!