I am using:
http://code.google.com/apis/chart/image/
I want to describe that the X is "Meal number" and Y is "calories"
chs=440x220
chxt=y,x
cht=lc
chco=3072F3
chd=t:931.4,23.5,572.4,0,0,0,0
chds=0,2500
chxr=0,0,2500|1,1,7,1
chdl=Energi
chdlp=b
chls=2
chma=5,5,5,25
chm=o,000000,0,-1,5
You can try and see here:
http://code.google.com/apis/chart/image/docs/chart_playground.html
I already have labels for X and Y. The X axis 1,2,3,4... and the Y axis 0,250,500...
I want to add at the top or bottom on the Y axis: Calories
And on the X axis: Meal number
I found this:
http://www.lornajane.net/posts/2011/adding-multiple-axis-labels-to-a-google-chart
But i dont know how to do it on a Line chart
The chxl parameter allows you to specify the label and chxp enables you to position the labels, e.g.:
http://chart.apis.google.com/chart
?chxl=0:|Calories||1:|Hours
&chxp=0,100|1,50
&chxt=y,x
&chbh=a
&chs=300x225
&cht=bvg
&chco=A2C180,3D7930
&chd=t:10,50,60,80,40,60,30|50,60,100,40,20,40,30
&chtt=Vertical+bar+chart
More detail (including how to apply styles to axis labels):
http://code.google.com/apis/chart/image/docs/gallery/bar_charts.html#axis_labels
Related
Say I have this spreadsheet, where the column I'm trying to create is column E.
A B C D E
z z z
x x z z
y y
y x x
How would I go about this in google sheets? I've seen some answers to similar questions about combining INDEX and MATCH but I can't figure it out.
Also needs to work on a sheet with over 100k rows so I can't just drag it.
Please try the following formula:
=ArrayFormula(REGEXREPLACE(ARRAYFORMULA(TRANSPOSE(TRIM(SPLIT(
CONCATENATE(IF(LEN(B3:F9),"★"&B3:F9,)&REPT(" "&"♣︎",COLUMN(B3:F3)=COLUMN(F3))),"♣︎")))),".*★(.+)$","$1"))
In addition to the solution posted by marikamitsos, you could also try
=ArrayFormula(substitute(regexextract(trim(transpose(query(transpose(substitute(B3:E," ", "_")),,9^99))), "[^\s]*$"), "_", " "))
Google Vision API documentation states that vertices of detected characters will always be in the same order:
// The bounding box for the symbol.
// The vertices are in the order of top-left, top-right, bottom-right,
// bottom-left. When a rotation of the bounding box is detected the rotation
// is represented as around the top-left corner as defined when the text is
// read in the 'natural' orientation.
// For example:
// * when the text is horizontal it might look like:
// 0----1
// | |
// 3----2
// * when it's rotated 180 degrees around the top-left corner it becomes:
// 2----3
// | |
// 1----0
// and the vertice order will still be (0, 1, 2, 3).
However sometimes I can see a different order of vertices. Here is an example of two characters from the same image, which have the same orientation:
[x:778 y:316 x:793 y:316 x:793 y:323 x:778 y:323 ]
0----1
| |
3----2
and
[x:857 y:295 x:857 y:287 x:874 y:287 x:874 y:295 ]
1----2
| |
0----3
Why order of vertices is not the same? and not as in documentation?
It seems like a bug in Vision API.
The solution is to detect image orientation and then reorder vertices in the correct order.
Unfortunately Vision API doesn't provide image orientation in it's output, so I had to write code to detect it.
Horizontal/vertical orientation can be detected by comparing character height and width. Height is usually larger than width.
Next step is to detect direction of text. For example in case of vertical image orientation, text may go from up to down or from down to up.
Most of characters in output seem to appear in the natural way. So by looking at stats we can detect text direction. So for example:
line 1 has Y coord 1000
line 2 has Y coord 900
line 3 has Y coord 950
line 4 has Y coord 800
We can see that image is rotated upside down.
You must to reorder vertices of four poins(clockwise inverted from A to D):
A-B-C-D that:
A: min X, min Y
B: max X, min Y
C: max X, max Y
D: min X, max Y
And save to your rectangle object.
Update: You can order vertices by distance from O(0,0) for A-B-C-D order above.
I currently have an agent in a map, whose position is known as myPos=(myX,myY), but whose orientation myOri=(oriX,oriY) is unknown. I also see a landmark at position lm=(lmX,lmY) and I have both Cartesian and polar coordinates from my point of view to the landmark, as relLM=(relX,relY) and polLM=(r,theta), respectively.
My goal is to find how my orientation vector is related with the X and Y axis, as XX=(xX, xY) and YY=(yX, yY). Assume for the following examples that X grows to the right and Y grows upwards, and that an agent with 0 rotation follows the X axis (so an agent looking right has XX=(1,0) and YY=(0,1). This follows from the intuition where 0 angle rotation is on the X axis, PI/2 rotation is on the Y, PI is on -X, 3PI/2 is on -Y and 2PI is X.
Example) If myOri=(1,1) (agent is facing top right), then XX=(1, -1) (since the X axis is top right to him) and YY=(1, 1) (the Y axis is top left). In the picture below, X and Y are shown in red and green. My agent is in blue and the landmark in pink. Hence, our initial data are myPos=(0,-2), lm=(0,-1), relLM=(~0.7,~0.7).
By knowing myPos and lmPos, as well as relLM, this should be possible. However, I'm having trouble finding the appropriate vectors. What is the correct algorithm?
bool someFunction(Landmark *lm, Vector2f myPos, Vector2f *xx, Vector2f *yy){
// Vector from agent to landmark
Vector2f agentToLandmark(lm->position.x - myPos.x,
lm->position.y - myPos.y);
// Vector from agent to landmark, regarding agent's orientation
Vector2f agentFacingLandmark = lm->relPosition.toCartesian();
// Set the XX and YY values
// how?
}
My problem is actually in 3D, but using 2D makes the problem easier to explain.
Finding myOri
Since relLM is lm relative to myOri, lm + relLM must be in myPos + µ * myOri. Thus lm + relLM - myPos = myOri * µ. Since µ > 0 must be given in this case, and myOri only needs to indicate a direction, it's sufficient to choose an arbitrary µ > 0.
Finding xx and yy
I think your definition of xx is simply a vector representing the x-axis from the POV of the agent. And same for yy and the y-axis. This can easily be achieved. The angle between myOri and the x-axis is equal to the angle between the x-axis and xx, thus simply mirror myOri at the x-axis and you got xx. So xx = (myOri.x , myOri.y * (-1)). The angle between myOri and the y-axis is equal to the angle between myOri and yy, so yy = myOri.
Note that this is only a guess on what you mean.
Might be that I've misunderstood something. Just notify me if that's the case.
I have data which I have to plot
X = [0,1,2,3,4,5]
Y = [6,7,8,9,10,11,12,13,14,15]
X belongs to class1, so I would want them to be plotted green in color and Y belongs to class2, so I would want them to be plotted blue in color.
What I did was,
import pylab as pl
pl.plot(X,'go')
pl.plot(Y,'bo')
pl.show()
But this is plotting X against Y. All I want to display in my graph is just the points X and Y in green and blue colors respectively.
How can I accomplish this?
It doesn't plot X against Y, if only because X and Y are not the same length. Let's say x is the variable (horizontal axis) and y the result (vertical axis). Normally you write pl.plot(x,y), where x and y are lists of the same length. If you give only one list, it assumes you only gave y and matplotlib will make an x-axis for you, something like this:
import pylab as pl
y1 = [0,1,2,3,4,5]
y2 = [6,7,8,9,10,11,12,13,14,15]
x1 = range(len(y1))
x2 = range(len(y2))
pl.plot(x1, y1,'go')
pl.plot(x2, y2,'bo')
pl.show()
So I think in your case you should define the x-axis.
How can I show all text values of Y axis in the bar chart shown in the image
Chart1.ChartAreas[0].AxisX.Interval = 1;