如何防止 MATLAB GUI 中的 LATEX-labels 变得模糊? [英] How to prevent LATEX-labels in MATLAB GUI to become blurry?

查看:19
本文介绍了如何防止 MATLAB GUI 中的 LATEX-labels 变得模糊?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我当前的 MATLAB GUI 项目中,我有两个轴对象.第一个由解决方法 (见图片问题演示)

解决方案

在绘制 3D 绘图前后检查图形属性

get(gcf, 'renderer')

我的猜测是绘制 3D 函数会将渲染器从默认(画家")更改为另一个(可能是 OpenGL).Matlab 的 Latex 渲染似乎不能很好地与 zbuffer 或 OpenGL 配合使用(这些生成位图而不是线条图).

如果画家无法正确渲染您的 3D 图形,您可能会卡住,但您可以尝试通过手动将渲染器设置回画家来强制它

set(gcf, 'renderer', 'painters')

Within my current MATLAB GUI project, i have two axes objects. The first is used by the workaround "uibutton" (I don't use GUIDE) in order to display a LaTeX-formula (as far as I know, only axes labels are capable to use LaTeX whereas normal static text fields aren't...). The other axes object is used to actually plot a 3D-function.

The program has the following steps:

  1. the first axes creats the LATEX-formula (e.g. f(x)=).
  2. User enters a function in the edit field after the LaTeX-formula (e.g. f(x)=a+b).
  3. User presses a "plot"-button.
  4. 3D-function is plotted in the second axes object.

Problem:

As soon as the 3D-function is plotted, the nicely rendered LaTeX-formular becomes crisp. Is there any way to prevent this from happening?

http://i42.tinypic.com/348pq2u.png (See picture for problem demonstration)

解决方案

Check your figure properties before and after you draw the 3D plot

get(gcf, 'renderer')

My guess is that plotting the 3D function changes the renderer from the default ("painters") to another (likely OpenGL). Matlab's Latex rendering does not seem to play well with zbuffer or OpenGL (these produce bitmaps rather than line art).

You may be stuck if painters can't render your 3D graphics properly, but you can try to force it by setting the renderer manually back to painters

set(gcf, 'renderer', 'painters')

这篇关于如何防止 MATLAB GUI 中的 LATEX-labels 变得模糊?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆