问题
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):
回答1:
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
.
来源:https://stackoverflow.com/questions/35606362/ios-core-plot-function-transformation-y-axis-only-origin