首次使用图形功能(绘图,图像c等)时,八度会挂起, [英] Octave hangs when you first use graphic functions (plot, imagesc, etc.),

查看:108
本文介绍了首次使用图形功能(绘图,图像c等)时,八度会挂起,的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我第一次使用绘图功能(例如,plot(1,1))时,Octave挂起了几分钟.对相同功能的第二次调用及其后的调用非常快速地执行.下次启动Octave时,将重复相同的行为.我将qt graphics_toolkit和gnuplot graphics_toolkit都使用了Octave 4.2.1.操作系统是Windows 7和10.我使用了标准的Octave安装程序.

When I first use the plotting functions (for example, plot(1,1)), Octave hangs for a few minutes. The second and subsequent calls for the same functions are performed quite quickly. The same behavior is repeated the next time you start Octave. I used Octave 4.2.1 with both qt graphics_toolkit and gnuplot graphics_toolkit. Operating system was Windows 7 and 10. I used standart Octave Installer.

如何解决这个问题?

推荐答案

此问题非常普遍.参见例如-无法使用Octave 4.0.0图形工具包功能

This problem is quite common. See for example - Cannot use Octave 4.0.0 graphics toolkit functions or Plot doesn't work in Octave 4.0.0 But I did not find any solutions for this problem. So I made my own investigation.

我运行了著名的实用程序 process-explorer 当Octave挂断时,我看到Octave打开了Windows字体文件夹(c:\ Windows \ Fonts)中的所有文件.我的计算机上此文件夹的大小约为400 MB!我搜索谷歌,发现,八度可以使用字体的缓存.有用于创建字体缓存的特殊实用程序和脚本文件(请参见对bug的评论) .因此,解决此问题的方法非常简单:

I ran the well-known utility process-explorer when Octave was hanging up, and I saw that Octave opens all the files in the Windows fonts folder (c:\Windows\Fonts). The size of this folder on my computer is about 400 MByte! I search google and found, that Octave can use font's cache. There is special utility and script file for creating font's cache (see comment to bug). So solution for this problem is quite simple:

  1. 转到八度文件夹(我的计算机上为c:\ Octave \ Octave-4.2.1 \)
  2. 运行脚本-fc_update.bat
  3. 启动八度,并检查第一次调用绘图函数是否没有挂起或冻结.

此脚本有两个连续开始的日志:

There is a log of two sequential starts of this script:

c:\ Octave \ Octave-4.2.1> fc_update.bat
正在更新fc缓存(可能需要一段时间)..."
C:/WINDOWS/字体:缓存,新的缓存内容:1012个字体,0个目录
C:/WINDOWS/字体:无法写入缓存
C:/Users/Sergey/.local/share/fonts:正在跳过,没有这样的目录
C:/Users/Sergey/.fonts:正在跳过,没有这样的目录
C:/Users/Sergey/AppData/Local/fontconfig/cache:清理缓存目录
C:/Users/Sergey/.cache/fontconfig:不清除不存在的缓存目录
C:/Users/Sergey/.fontconfig:清理缓存目录
c:\ Octave \ Octave-4.2.1 \ bin \ fc-cache.exe:失败
完毕."

c:\Octave\Octave-4.2.1>fc_update.bat
"Updating fc-cache (may take a while) ..."
C:/WINDOWS/fonts: caching, new cache contents: 1012 fonts, 0 dirs
C:/WINDOWS/fonts: failed to write cache
C:/Users/Sergey/.local/share/fonts: skipping, no such directory
C:/Users/Sergey/.fonts: skipping, no such directory
C:/Users/Sergey/AppData/Local/fontconfig/cache: cleaning cache directory
C:/Users/Sergey/.cache/fontconfig: not cleaning non-existent cache directory
C:/Users/Sergey/.fontconfig: cleaning cache directory
c:\Octave\Octave-4.2.1\bin\fc-cache.exe: failed
"Done."

c:\ Octave \ Octave-4.2.1> fc_update.bat
正在更新fc缓存(可能需要一段时间)..."
C:/WINDOWS/字体:正在跳过,现有的缓存有效:1012个字体,0个目录
C:/Users/Sergey/.local/share/fonts:正在跳过,没有这样的目录
C:/Users/Sergey/.fonts:正在跳过,没有这样的目录
C:/Users/Sergey/AppData/Local/fontconfig/cache:清理缓存目录
C:/Users/Sergey/.cache/fontconfig:不清除不存在的缓存目录
C:/Users/Sergey/.fontconfig:清理缓存目录
c:\ Octave \ Octave-4.2.1 \ bin \ fc-cache.exe:成功
完毕."

c:\Octave\Octave-4.2.1>fc_update.bat
"Updating fc-cache (may take a while) ..."
C:/WINDOWS/fonts: skipping, existing cache is valid: 1012 fonts, 0 dirs
C:/Users/Sergey/.local/share/fonts: skipping, no such directory
C:/Users/Sergey/.fonts: skipping, no such directory
C:/Users/Sergey/AppData/Local/fontconfig/cache: cleaning cache directory
C:/Users/Sergey/.cache/fontconfig: not cleaning non-existent cache directory
C:/Users/Sergey/.fontconfig: cleaning cache directory
c:\Octave\Octave-4.2.1\bin\fc-cache.exe: succeeded
"Done."

我认为您在安装Octave或向系统中添加新字体时需要运行此脚本.我不明白为什么这些信息没有以清晰易懂的方式包含在Octave文档中.

I think you need to run this script when installing Octave or adding new fonts to the system. I do not understand why this information is not contained in the Octave documentation in a clear and accessible way.

这篇关于首次使用图形功能(绘图,图像c等)时,八度会挂起,的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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