Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use R language to output Greek character superscript and mathematical formula when drawing

2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly explains "how to use R language to realize the output of Greek character superscript and mathematical formula". The content of the explanation in this article is simple and clear, and it is easy to learn and understand. let's study and learn how to use R language to realize the output of Greek character superscript and mathematical formula.

Greek alphabet

To use Greek characters, superscripts, subscripts, and mathematical formulas, you need to use a function: _ expression (), which is used as follows:

Plot (cars) title (main = _ expression (Sigma)) superscript and subscript

The subscript in _ expression () is [], the superscript is ^, the space is ~, and the hyphen is *. The sample code is as follows:

Plot (cars) title (main = _ expression (Sigma [1] ~ Sigma ^ 2)) paste

To achieve the above effect, we can actually use paste () and _ expression () to combine. Without the above tedious process, we can achieve exactly the same output as above, and it is convenient and fast:

Plot (cars) title (main = _ expression (paste (Sigma [1], 'and', Sigma ^ 2)) A complex example

Goal:

Code:

_ expression (paste ((frac (1, m) + frac (1, n)) ^-1, ABCD [paste (m,',', n)]) Advanced

When we want to batch produce a large number of titles with different variable values, what to do if we encounter the mixed output of variables and formulas?

Can refer to the previous article: r language drawing formula and variable object mixed splicing method

Mathematical formula

For the final mathematical formula, you only need to make the corresponding symbolic connection in _ expression ().

For specific requirements, please refer to Mathematical Annotation in R

In view of its instability, the details are moved here.

(the following table can also be obtained by searching plotmath directly in R help. )

SyntaxMeaningx + yx plus yx-yx minus yx*yjuxtapose x and yx/yx forwardslash yx% ±% yx plus or minus yx% /% yx divided by yx% *% yx times yx%.% yx cdot YX [I] x subscript ix ^ 2x superscript 2paste (x, y, z) juxtapose x, y, and zsqrt (x) square root of xsqrt (x, y) yth root of xx = = yx equals yx! = yx is not equal to yx

< yx is less than yx yx is greater than yx >

= yx is greater than or equal to yellowxnot xx% ~% yx is approximately equal to yx% = ~% yx and y are congruentx% =% yx is defined as yx% prop% yx is proportional to yx% ~% yx is distributed as yplain (x) draw x in normal fontbold (x) draw x in bold fontitalic (x) draw x in italic fontbolditalic (x) draw x in bolditalic fontsymbol (x) draw x in symbol fontlist (x, y, z) comma-separated list... Ellipsis (height varies) cdotsellipsis (vertically centred) ldotsellipsis (at baseline) x subset% yx is a proper subset of yx% subseteq% yx is a subset of yx% notsubset% yx is not a subset of yx% supset% yx is a proper superset of yx% supseteq% yx is a superset of yx% in% yx is an element of yx% notin% yx is not an element of yhat (x) x with a circumflextilde (x) x with a tildedot (x) x with a dotring (x) x with a ringbar (xy) xy with barwidehat (xy) Xy with a wide circumflexwidetilde (xy) xy with a wide tildex% yx double-arrow yx%->% yx right-arrow yx% yx implies yx% 0) limit of f (x) as x tends to 0min (g (x) X > 0) minimum of g (x) for x greater than 0inf (S) infimum of Ssup (S) supremum of Sx ^ y + znormal operator precise ^ (y + z) visible grouping of operandsx ^ {y + z} invisible grouping of operandsgroup ("(", list (a, b), "]") specify left and right delimitersbgroup ("(", atop (x), ")) use scalable delimitersgroup (lceil, x, rceil) special delimitersgroup (lfloor, x, rfloor) special delimiters thank you for reading The above is the content of "how to use R language to output Greek character superscript and mathematical formula". After the study of this article, I believe you have a deeper understanding of how to use R language to realize the output of Greek character superscript and mathematical formula, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report