my vertical x axis labels run into my plotted data. Is there a way to compress the graph so I have a little extra room at the bottom - core-plot

I am plotting my x axis labels vertically, and using the following line to provide a little space under the axis
axisSet.xAxis.axisConstraints = [CPTConstraints constraintWithLowerOffset:40.0];
But now the vertical length of the label bumps into the first value on the y axis. Is there a way to compress the graph a little so the first value on the y axis begins a little higher? Thanks.

Adjust the axis' labelAlignment and/or labelOffset to reposition the labels.

Related

iOS Core Plot "Function transformation" - Y axis only origin

I cannot find how to do this for a while now, my graph is drawn ok every time but I want to move up my graph, like when you have f(x) + n. So, what I want to do actually is change Y origin, so I can draw my (x,0) points. I do not want to draw my points on X axis, I do not see the line that good. I want that my zero Y point actually starts at point three, but not to transform the graph at the same time. Here is picture of what I want to do (see the green line and Y point):
The plot space yRange controls the range of data visible. The image in the question looks like it has a location of negative one (-1) and length of 18. You can use the axisConstraints to keep the x-axis along the bottom of the plot area. If you don't want to use constraints, set the orthogonalPosition to the location of the yRange.

Core Plot Tick Marks on Both Sides of Axis?

Is it possible to position tick marks in the center of an axis?
I don't have enough reps to post images, but here's the general idea...
--|--|--|--|--|--|--|--|--|--|--
Use the tickDirection property of the axis. The default (CPTSignNone) centers the tick marks on the axis as shown in your drawing.

ios Core plot - scatter plot circles overlap with x, y axes

I am currently plotting certain data using Scatter Plot of Core Plot. The size of the circles depends on the frequency of occurrence of the particular value. On plotting, I find that some of the circles are overlapping and crossing the x and y axes.
Is there any method to check if a circle (i.e, plot point) crosses the axes and automatically resize the circle so that it does not cross the axes?
Edit - The axes are fixed. So I cannot change the axes.
Edit - I would like to know which methods to use to determine if a circle crosses/touches the x or y axis. Currently the circle overlaps if the size of circle is 12 and its y coordinate is 1.1. I am unable to understand how the size is being mapped to the circle on the plot. Thanks.
No. The easiest way around this problem is to figure out how big the largest circle will be and adjust the plot ranges on the the plot space to leave at least that much space between the extreme data points (smallest and largest) and the axes or other edges of the plot space. The plot space has methods to convert back and forth between data coordinates and pixels in the coordinate space of the plot area layer.
The point conversion methods are:
(data to plot area)
-(CGPoint)plotAreaViewPointForPlotPoint:(NSDecimal *)plotPoint
numberOfCoordinates:(NSUInteger)count;
-(CGPoint)plotAreaViewPointForDoublePrecisionPlotPoint:(double *)plotPoint
numberOfCoordinates:(NSUInteger)count;
(plot area to data)
-(void)plotPoint:(NSDecimal *)plotPoint numberOfCoordinates:(NSUInteger)count
forPlotAreaViewPoint:(CGPoint)point;
-(void)doublePrecisionPlotPoint:(double *)plotPoint
numberOfCoordinates:(NSUInteger)count
forPlotAreaViewPoint:(CGPoint)point;
Depending on your application, you might be able to expand the plot range by a simple factor using -expandRangeByFactor:. You can find the factor for the xRange by dividing the width of the plot area plus the circle diameter by the width of the plot area. Do a similar calculation for the yRange using the height of the plot area.
Perhaps you could check to see if half of the diameter is greater than both the x and y value of the plot. If it is greater, then reduce the diameter to equal twice the smaller of x and y.

Margin for scatter series in Shinobi Charts on iOS

I'm using a scatter series in Shinobi Charts but points with maximum and minimum x and y values are being truncated because they're at the edge of the plot area?
How can I add a small margin to the plot area so I can clearly see the scatter points and none are truncated. I realise that I can set the range of each axis myself but that gets into nasty math to work out what a 5px margin would be over the lowest/highest values etc.
There are 2 properties on SChartAxis which can help you: rangePaddingLow and rangePaddingHigh. These values are absolute values, and in the scale of the axis.
For example, if you have an axis which has an automatic range of (0,100), then the following would update the range to (-5, 105):
axis.rangePaddingLow = #5;
axis.rangePaddingHight = #5;
As the axis scale updates, these padding values will be maintained.

Put a line on zero value of y axis

Helo,
Is it possible to put a line on zero value of y axis ?
Because i have negatives values so i changed orthogonal value of my axis to the lowest one on my datasource.
Thanks
Make second x-axis and position it at zero. You can leave off the labels and tick marks to just get the axis line. See the axis demo in the Plot Gallery app for an example of how to add additional axes to a Core Plot graph.

Resources