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"));
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.
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.
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.
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.
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
where \u03B8
is \theta
, \u2081
is subscript one, and \u1d48
is subscript d. For the rest of charaters, see this link.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With