当前位置:网站首页>How matlab modifies default settings
How matlab modifies default settings
2022-07-03 06:22:00 【Favorite dish of chicken】
In today's github I downloaded a code from , After the run is over , Found it put my figure The default interpreter inside has been changed .
The original setting is :
interpreter = 'none'
But I open it figure Take a look at the properties window of , This attribute has been changed to
interpreter = 'Latex'
So in the process of drawing , Once there are Chinese characters in the text , The following warning will appear :
Warning : to update Text An error occurred when . String scalars or character vectors must have valid interpreter syntax
The solution is 2 individual :
- Every time I write
legend()perhapsxlabel()、ylabel()When it's time to addinterpreter = 'none' - Change the default settings back to the original
I decided to do it once and for all , Choose the second .
Start checking information online , eureka This article , This paper introduces how to put figure Change the background color of to white , The code is set(0,'defaultfigurecolor','w'). I am inspired by this article , Think you can find the handle of the default setting , Re pass set() Set handle parameters , Restore default settings . Say more , In the code 0 This handle represents the computer screen ( You can refer to here ).
The next step is to search the Internet MATLAB What is the default handle of , eureka This article .
The author said that it can be used get(0,'factory') To get the default attribute definition value . stay MATLAB After entering this line of command on the command line , There are many properties that can be set . But I looked for it , Not found interpreter Name , It seems that this line of code may not be used to do .
Now my mind moves , I wonder if I can factory Replace with default, Enter the code on the command line get(0,'default'), The output is as follows :
ans =
That contains the following fields struct:
defaultFigurePosition: [680 558 560 420]
defaultFigurePaperPositionMode: 'auto'
defaultFigurePaperType: 'A4'
defaultFigurePaperUnits: 'centimeters'
defaultFigurePaperSize: [21 29.7000]
defaultTextInterpreter: 'latex'
defaultLegendInterpreter: 'latex'
defaultAxesTickLabelInterpreter: 'latex'
Notice that the last three lines appear interpreter and latex Name , This is the default setting you are looking for .
Enter the following three lines of code on the command line to replace the interpreter with MATLAB The default setting of .
set(0,'defaultTextInterpreter','none');
set(0,'defaultLegendInterpreter','none');
set(0,'defaultAxesTickLabelInterpreter','none');
Input again get(0,'default') Check to see if the setup is successful , The output is as follows .
ans =
That contains the following fields struct:
defaultFigurePosition: [680 558 560 420]
defaultFigurePaperPositionMode: 'auto'
defaultFigurePaperType: 'A4'
defaultFigurePaperUnits: 'centimeters'
defaultFigurePaperSize: [21 29.7000]
defaultTextInterpreter: 'none'
defaultLegendInterpreter: 'none'
defaultAxesTickLabelInterpreter: 'none'
success ! This is figure No warning will be given when Chinese characters are used in Chinese painting .
Through this thing, I think , Still have to think more about how to solve the problem , After the problem is solved, it should be recorded in time , Prevent yourself from forgetting .
边栏推荐
猜你喜欢

Reinstalling the system displays "setup is applying system settings" stationary

SVN分支管理

技术管理进阶——你了解成长的全貌吗?

Push box games C #

Kubernetes notes (III) controller

剖析虚幻渲染体系(16)- 图形驱动的秘密

JMeter performance automation test

After the Chrome browser is updated, lodop printing cannot be called

第8章、MapReduce 生产经验

ruoyi接口权限校验
随机推荐
Interesting research on mouse pointer interaction
Synthetic keyword and NBAC mechanism
Cesium Click to obtain the longitude and latitude elevation coordinates (3D coordinates) of the model surface
认识弹性盒子flex
Project summary --01 (addition, deletion, modification and query of interfaces; use of multithreading)
Page text acquisition
Migrate data from Amazon aurora to tidb
Skywalking8.7 source code analysis (II): Custom agent, service loading, witness component version identification, transform workflow
Tabbar settings
How to scan when Canon c3120l is a network shared printer
Selenium ide installation recording and local project maintenance
Kubernetes notes (VII) kuberetes scheduling
Project summary --04
The most responsible command line beautification tutorial
从小数据量分库分表 MySQL 合并迁移数据到 TiDB
Oauth2.0 - using JWT to replace token and JWT content enhancement
项目总结--01(接口的增删改查;多线程的使用)
【LeetCode】Day93-两个数组的交集 II
Support vector machine for machine learning
Une exploration intéressante de l'interaction souris - pointeur