How to bubble chart aligned bottom and stick to each other - charts

I would like to ask if there is a way to achieve the layout and arrangement of the circles on the image.
I would like create a chart of series of circles that are link together and all aligned in the bottom.

The distance between two circles with radii r1 and r2 is:
You can use this to position your circles on the x-axis. For an example see: http://bl.ocks.org/7a9d6c4725367aaed5db .

Related

Calculating area on N points

Im trying to calculate numerically an area of different shapes where the only thing I know about them is the (x,y) of each corner.
For example the shapes are:
P.s. The points inside the shape are for other calculation, I only need the area of the most outer shape.
Thank you.
Create polygon, and use polyarea function.
Given x,y location of corners than:
Area=polyarea(x,y)

matlab smooth vertical and horizontal rectangle

Could someone help me to find what morphological operations should I use in order to smoothen the vertical and horizontal rectangle on this image
More precisely what I would want is that the white rectangles become continuous. The final application of that would be to detect vertical and horizontal lines in the image, indeed this image is a map where white element represent obstacle and where i would want to detect the walls.
So the result i would want should be something like that:

Place MATLAB legend such that it does not overlap on the plot

I am generating multiple plots of different datasets in succession using MATLAB. I would like the legend positions to be such that they don't overlap on the plotted lines and it would be ideal if this placement could be done automatically.
I am aware of setting the 'Location' to 'best' to achieve this but the placement of the legend tends to be awkward when 'best' is used (below). Also, I would like the legend to be inside the plot. I also came across a way to make the legend transparent (here) so that it does not render the plotted data invisible, but explicitly placing the legend elsewhere is what I am looking for.
Is there a way to place the legend at the extremes of the image ('NorthWest', 'SouthWest' etc) automatically such that it does not overlap on the plotted data (apart from the methods suggested above)?
So, you have tried using Location instead of Position? For example:
x =1:100;
y = x.^2;
lgd = legend('y = x.^2');
set(lgd,'Location','best')
and you are getting odd results correct? A quick way of solving this would be to still use Location, with best, and extract the coordinates:
lgd.Position
You should get something like this:
ans =
0.7734 0.3037 0.1082 0.0200
which maps to:
[left bottom width height]
You will need to focus on left and bottom. These two values, left and bottom, specify the distance from the lower left corner of the figure to the lower left corner of the legend, and they are analogous to the grid frame you are using.
Then, depending on the size of the frame (I would suggest you use axis([XMIN XMAX YMIN YMAX]) for this, if possible), you can pinpoint the position of the legend within the grid. What you can do next, is check if and which of your graphs in the plot cross paths with the legend (maybe define a relative distance function based on some distance threshold) and if they do, then randomly reposition the legend (i.e. change the values of left and bottom) and repeat until your conditions are met.
If this still troubles you I can write a short snippet. Finally, know that you can always opt for placing the legend on the outside:
set(lgd,'Location','BestOutside')

Pie chart with 2 portion set label with center position

I have problem regarding setting the uilabel in the middle edge in pie chart circle.
In my Pie chart there are 2 portion.
Both portion change dynamically.
How can i get center position in both portion so i can set my label in the center edge of the particular section.
Thank You
Regards,
Keyur Bhalodiya
use carteasian equation.
(x,y) = (rcos#,rsin#).
R is the radius of the piechart. # is the angle at which you need to find a point. In your case middle of your pie slices.

Using Core Plot, how can I draw a bar chart in all four quadrants of the plot space?

Using the Core Plot framework and its CPGraphHostingView, I have drawn a bar chart in the first quadrant of an X / Y plot.
I want to plot the bar chart in the second, third, and fourth quadrant of this plot. How can I do that?
Not sure what you are trying to do here, but if what you want is four independent bar charts, you are going to need one CPGraphHostingView for each one of them, since a CPGraphHostingView holds only one CPXYGraph.