⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 xlabel.java

📁 JAVA 数学程序库 提供常规的数值计算程序包
💻 JAVA
字号:
package jmathlib.toolbox.jmathlib.graphics;

import jmathlib.core.tokens.*;
import jmathlib.core.functions.ExternalFunction;

/**Add text to the x-axis of the current axes*/
public class xlabel extends ExternalFunction
{

	public OperandToken evaluate(Token[] operands)
	{

		//ErrorLogger.debugLine("xlabel evaluate");

		if (getNArgIn(operands) != 1)
			throwMathLibException("xlabel: number of arguments != 1");
            
	    if (!(operands[0] instanceof CharToken)) 
        	throwMathLibException("xlabel: argument must be a string");

        String xLabel = ((CharToken)operands[0]).toString();

		getGraphicsManager().getCurrentFigure().getCurrentAxes().setXLabel(xLabel);
		getGraphicsManager().getCurrentFigure().repaint();

		return null;
	}
}

/*
@GROUP
graphics
@SYNTAX
xlabel(label)
@DOC
Sets the label on the x axis of a graph
@EXAMPLES
<programlisting>
xlabel("x axis")
</programlisting>
@NOTES
.
@SEE
ylabel, zlabel, title
*/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -