julia create symbol with greek capital letters? - julia

How can i create a symbol with greek capital letters,such as:
#vars θ uppercase("θ")
it expected to create two symbols : lowercase letter θ and uppercase letter Θ,
however the output is:
(θ,),which means the uppercase letter symbol wasn't created.

Easy enough: in your REPL enter \theta <tab> for lowercase theta, \Theta <tab> for uppercase. Similar for all other greek letters, for example: gamma

Related

Vector of numbers in angle parameter of element_text()

Is there any way to include a vector of numerics within the angle parameter of the element_text() function in R. It appears that in a new version of ggplot2, the angle parameter only accepts a single number.

How can I output the right micro symbol (not the greek character mu) in R?

The labels of my figures contain units like micromol m^-2 s^-1,so how can I output the right micro symbol?
I know that many people use the greek character mu, but mu is not the right symbol.
Thanks!

Orientation of the Vector

I have a line and a few points and I need to determine which points are under and which are beyond the line. I tried to find a line that is in 90degrees angle with my line and crosses the points but i couldnt figure out whether the vectors orientation is up or down. Can you help? Thank you
You can find line equation and substitute points in thin equation.
Easy case: Let's line is not vertical, so it might be described by equation
y = a * x + b
for every query point (px, py) calculate value
S = py - a * px - b
When S is positive, point is above the line, when negative - below.
If your line is defined by base point B and direction vector D, you can determine - what semi-plane (against the line) query point P belongs to - using cross product sign
Sign (D x (P-B))
Note that in this case term "below" depends also on sign of X-component of vector D

Iterative parametric plot with gnuplot

I want to use the iterative plot function plot for in gnuplot for a parametric plot.
set parametric
f(x) = x
plot for [i=1:2] t,f(i*t)
However, as I learned in this Question, the for iteration ends after a comma. So the iteration only applies to t and not to f(i*t). But since a parametric plot needs a pair of functions separated by a comma, how can I tell gnuplot to iteratively plot my parametric plot?
Did you actually try it? gnuplot distinguishes a comma between parametric coordinates and the end of a plot-element as it is called (which can contain a for-loop): this is simply done by counting the number of coordinates given.
E.g.,
set parametric
set size ratio -1
plot for [i=1:3] cos(t),i*sin(t) title "Ellipse ".i, \
for [i=1:3] i*cos(t),i*sin(t) title "Circle ".i
If you do
plot for [i=1:3] cos(t),i*sin(t),i*cos(t),i*sin(t)
then you keep the 3 ellipses (well, including the circle when i=1), and have one circle plotted for i=3 (the value i kept after the for loop) from the last pair of coordinates.

Is it possible to capture the coordinates of the last letter drawn with TEXT function?

How can I programmatically capture the X coordinate of letter "r" in "better" string in the example? I'd like to capture that coordinate in order to dynamically draw the arrow next to it. Can this be done in R? It can be done in SAS ...with some difficulty.
x<-c(1,3)
y<-c(3,3)
plot(y~x, type="c", ylim=c(-1,5), xlim=c(-3,3), col="red")
abline(h=0,v=0, lty=3)
text(0.3, -2.5, xpd=T, "Group 1 better", adj=0)
#manually draw the arrow
arrows(x0=1.3, x1=3, y0=-2.5, y1=-2.5, length=0.1, code=2,xpd=T)
The obvious approach is to count number of letters in the string and add that number to the X coordinate of the string. This approach will probably work well in most cases but may not work well in if the size/style,angle of the text changes. I am wondering if there is a an easy way to capture the last position of the string.
SAS does it by placing the arrow relative to the internal coordinates of the previous string.
I would also like to know how to capture the last coordinate of any other graphical element as well - if possible at all.
Thank you
Use strwidth to get the string width, and add an extra character's width for a bit of space:
> arrowlabel = "Group 1 better")
> sw = strwidth(arrowlabel)
> xpos = 0.3 + sw + sw/nchar(arrowlabel)
Then draw your arrow starting at x=xpos.

Resources