Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to show math symbols like theta

I'm trying to find a way to show math symbols such as \theta, \phi, \dot{\theta}, ..., etc. I couldn't find a way to show these letters in my plot. Does qcustomplot support math symbols? I've tried the following line but very few letters show up but the rest doesn't.

ui->customPlot1->graph(0)->setName(QString("\u0024"));

like image 884
CroCo Avatar asked Apr 17 '16 03:04

CroCo


People also ask

What does this symbol θ mean?

Theta (θ) is a letter from the Greek alphabet. In Mathematics and Physics it is customary to designate variables with letters. The symbol θ usually represents the angular position of a vector.

How do you read θ in math?

The Greek letter θ (theta) is used in math as a variable to represent a measured angle. For example, the symbol theta appears in the three main trigonometric functions: sine, cosine, and tangent as the input variable.

What is θ called in math?

Theta (uppercase Θ, lowercase θ) is the eighth letter of the Greek alphabet, derived from the Phoenician letter Teth. In the system of Greek numerals it has a value of 9.


2 Answers

What you are looking for is:

ui->customPlot1->graph(0)->setName(QString::fromUtf8("\u03B8"));

This for example will give you the small letter theta. Use UTF-8 Encoding Table and Unicode Characters to get your desired letters code.

like image 134
A. Sarid Avatar answered Nov 03 '22 08:11

A. Sarid


In my Qt GUI in Windows 7, the following line worked

 title->setText(QString::fromWCharArray(L"\u03B8\u2081(t) vs \u03B8\u2081\u1d48(t)"));

The result is

enter image description here

where \u03B8 is \theta, \u2081 is subscript one, and \u1d48 is subscript d. For the rest of charaters, see this link.

like image 38
CroCo Avatar answered Nov 03 '22 10:11

CroCo