@@ -33,6 +33,7 @@ defmodule Matplotex.Figure.Lead do
3333 |> module . set_region_title ( )
3434 |> module . set_region_legend ( )
3535 |> module . set_region_content ( )
36+ |> focus_to_origin ( )
3637 end
3738
3839 def set_regions_radial ( figure ) , do: figure
@@ -195,11 +196,12 @@ defmodule Matplotex.Figure.Lead do
195196 }
196197 }
197198 end
199+ def focus_to_origin ( figure ) , do: figure
198200 defp plotable_radius ( width , height , padding ) when height < width do
199- ( height - height * padding ) / 2
201+ ( height - height * padding * 2 ) / 2
200202 end
201203 defp plotable_radius ( width , height , padding ) when width < height do
202- ( width - width * padding ) / 2
204+ ( width - width * padding * 2 ) / 2
203205 end
204206 # def focus_to_origin(
205207 # %Figure{
@@ -242,32 +244,32 @@ defmodule Matplotex.Figure.Lead do
242244 # }
243245 # end
244246
245- defp center_and_radius ( width , height , { leftx , _rightx , bottomy , _topy } ) when height < width do
246- radius = height / 2
247+ # defp center_and_radius(width, height, {leftx, _rightx, bottomy, _topy}) when height < width do
248+ # radius = height / 2
247249
248- centerx = leftx + radius
249- centery = bottomy + radius
250- { { centerx , centery } , radius }
251- end
250+ # centerx = leftx + radius
251+ # centery = bottomy + radius
252+ # {{centerx, centery}, radius}
253+ # end
252254
253- defp center_and_radius ( width , _height , { leftx , _rightx , _bottomy , topy } ) do
254- radius = width / 2
255+ # defp center_and_radius(width, _height, {leftx, _rightx, _bottomy, topy}) do
256+ # radius = width / 2
255257
256- centerx = leftx + radius
257- centery = topy - radius
258- { { centerx , centery } , radius }
259- end
258+ # centerx = leftx + radius
259+ # centery = topy - radius
260+ # {{centerx, centery}, radius}
261+ # end
260262
261- defp label_offset ( nil , _font_size ) , do: 0
262- defp label_offset ( "" , _font_size ) , do: 0
263+ # defp label_offset(nil, _font_size), do: 0
264+ # defp label_offset("", _font_size), do: 0
263265
264- defp label_offset ( ticks , font_size ) when is_list ( ticks ) do
265- font_size * @ pt_to_inch + @ padding
266- end
266+ # defp label_offset(ticks, font_size) when is_list(ticks) do
267+ # font_size * @pt_to_inch + @padding
268+ # end
267269
268- defp label_offset ( _label , font_size ) do
269- font_size * @ pt_to_inch + @ padding
270- end
270+ # defp label_offset(_label, font_size) do
271+ # font_size * @pt_to_inch + @padding
272+ # end
271273
272274 defp tick_length ( tick ) when is_integer ( tick ) do
273275 tick |> Integer . to_string ( ) |> String . length ( )
0 commit comments