IPhone : Scale scatter plot to Y-axis based on Circle radius using core plot

on Wednesday, April 1, 2015

I have a scatter-plot where I plot circles. It draws fine and I scale it depending on aspect ratio from the users device. The circles can vary in size incredibly, so I want to scale the plotspace accordingly. The problem is that when I use



[graph.defaultPlotSpace scaleToFitPlots:graph.allPlots];


the scaling is done with respect to the y-axis. I get perfect circles, since I work with aspect ratio, but since this is a portrait orientation, and the scaling is done with respect to y-axis, the circles get cut off in the x-axis. Since the x-axis is shorter in regard of aspect ratio I'd like to scale with respect to it instead. Is that possible?


What I'm trying to achieve is to "zoom out" or "scale" my plotSpace so all my circles fit in the plotSpace, which I can't seem to figure out without breaking aspect ratio and thus getting stretches circles.


It looks like this: enter image description here


And I want it to look like this: enter image description here


0 comments:

Post a Comment