how to add labels to points on a chart in mpandroidchart(java language) - mpandroidchart

I have an app which makes line chart with points, could i set labels on each points? totally I have just 6 points always.
here i d like to call it smth like p1

Related

How to move y axis label further from side of “paper”

I have a data set “mydatainR”
With that I created a barplot and when I download the barplot, part of the y axis is cut off because it’s “off of the paper”
I want to give myself more room to work with, or make my entire bar plot smaller. Thx

Get unitVector X Y Z values

i want to create lines on a surface using bunch of points, those lines must be in 5deg incremental
(In Catia using VBA)
here are the steps
Step:1 - first i will create lines using normal to surface option
Step:2 - then i measure the angle between normaltosurface line and xyPlane if the angle is near to 5deg mutiples number for ex if angle is 81.23deg
Step:3 - then i should create a line using point-direction option which is 80deg and if angle more than 82.5 and less than 87.5 then i should create a line using point-direction option which is 85deg to XYPlane
i need to get the X Y Z direction components (unit vectors in catia) which makes the angle between point-direction line and xyplane 5deg multiples like 80,85,90,95,100deg
the surface in the image is not actual surface
x y z components are unit vectors of line that i need to create
i know the angle, for that angle i need to find out the X Y Z unit vector values using VECTOR ROTATION IN 3D SPACE FORMULA
here is the image of that formula
here we know the value of theta using that we need to calculate X Y Z unit vector values
i need to this in VBA
I don't want to sound rude but are you looking for help with your code or are you giving assignment in hoping someone will give you solution for free ?
Anyway to get the direction vectors you can use something like this
Dim TempVariant As Variant
Dim aOrigin(2) As Variant
Dim aDirection(2) As Variant
Dim NewLine As HybridShapeLineNormal
Set NewLine = ShapeFactory.AddNewLineNormal(RefSurface, PointReference, 0, 1, VectorOrient)
Set TempVariant = NewLine
Call TempVariant.GetOrigin(aOrigin) 'get starting point x y z
Call TempVariant.GetDirection(aDirection) 'get vectors x y z
EDIT
If you want to deal with 3D rotation you can take a look at this excel.
It took me a while myself (about week) and I found this excel somewhere years ago which helped me ... therefore I'm unable to give credits for this.
Excel Euler angles

How to draw lines based on intervals in matplotlib?

I have these three lists
odds = [1,3,5,7,9]
evens = [2,4,6,8,10]
all_nums = [2,1,4,3,6,5,8,7,10,9]
I need to first draw a line showing the values in all_nums, and then draw the other two lines that connect the values in odds and evens.
For example, after I first draw the line of all_nums, I got
And my final expected graph should be
I am not sure how to draw the red and green lines as they are produced based on an "interval 2" on the x-axis with respect to the blue line.
I have created a repl.it with my current code.
Note, my real project is more complicated than this example, in which the first line looks like
And I need to connect all the valley points and all the peak points, so I cannot simply apply tricks like changing odds = [1,3,5,7,9] to odds = [1,2,3,4,5,6,7,8,9,10] when drawing, as I wish the curve can also be smooth in the connection between points.
Thank you for your help!
I did something like this for the even and odd lines. odd looks 1:1 and even looks like y-2.
odds = [1,3,5,7,9]
evens = [2,4,6,8,10]
all_nums = [2,1,4,3,6,5,8,7,10,9]
even_sep=[]
odd_sep=[]
plt.plot(range(len(all_nums)), all_nums, label='odds and evens')
for draw_num_iter in range(len(all_nums)):
draw_num = all_nums[draw_num_iter]
plt.annotate(draw_num, xy=(draw_num_iter, draw_num), size=20)
for i in range(len(evens)):
even_sep.append(evens[i]-2)
plt.plot(even_sep,evens,'ro-')
for i in range(len(odds)):
odd_sep.append(odds[i])
plt.plot(odd_sep,odds,'g')
plt.legend(loc='best')
plt.show()

Customizing tick marks and labels on x-axis (Excel VBA)

I'm drawing a graph in Microsoft Excel and I'm just wondering if this is possible, and if it is, how to achieve it. I've attached an illustration below:
This is what I have >
regular
This is what I'm trying to do > (I did this in Paint to illustrate)
edited in paint
Can the y-axis to cross over the x-axis at 30, but the tick marks starts at 100 onwards? I also don't want any labeling or tick marks below 30.
Thank you.
You need to hide the default axis and build your own. In my example, I want the axis to start at 30 and end at 730, but have tick marks and labels at 100, 200, 300, etc.
I set up a data range with X values in one column of 100, 200, 300, ... 700, and Y values of zero in the next column.
Chart 1 is the original chart without anything added or removed. Chart 2 has the added series, shown as orange plus-sign markers. Chart 3 has data labels below these added points, showing the default Y values of zero (orange text). In Chart 4 I have formatted the labels so that they show the X values instead of the Y values. In Chart 5 I have changed the X axis scale so it starts at 30 and ends at 730. I have also hidden the axis labels, not by removing them, but my using a custom number format of " ", which preserves the margin below the axis to leave room for my custom data labels. Finally in Chart 6 I have formatted the plus sign markers to match the axis line and the data labels to match the other chart text. I have also formatted the Y axis with major tick marks that cross the axis.
First two are basic chart formatting - plenty of examples to be found via Google for those.
For the third one you can use a custom format for your axis labels. See for example:
http://www.officetooltips.com/excel_2016/tips/conditional_formatting_of_chart_axes.html
Your format could look something like this:
[White][<=30]General;[Black][>30]General
In VBA:
With ActiveSheet.ChartObjects(1).Chart.Axes(xlCategory)
.TickLabels.NumberFormat = "[White][<=30]General;[Black][>30]General"
End With

Reportlab LinePlot - how do I add a lineLegend...or label my lines?

I have a lineplot with 2 lines on it...they're two separate channels from the same data set. Would love to just label each one - the "labels" options are all about giving a number for each point on your plot, and that is simply not helpful.
Would love to know how to do any (really, all, but I just need to do one to be happy) of these:
plot each against its own y axis and be able to sensibly label that axis with units (and color the numbers to correspond to the data it correlates to)
put a legend on it. I can't figure out how to use lineLegend
just put any kind of (singular) label in the vicinity of the lines.