[Chart] Equal scale on both axes

Tim Docker tim at dockerz.net
Sat Oct 26 07:43:06 BST 2013


Unfortunately I don't think the situation has really changed since you
asked before. The current structure of the layout code assumes the axes
have independent types with independent algorithms for scaling.

My advised approach would still be the same - create a new layout type with
a single axis type and an appropriate algorithm for scaling both axes
together. It will take a bit of effort, I think to reorganise the existing
code to get reuse.

Tim
On 24 Oct 2013 09:53, "Bjorn Buckwalter" <bjorn at buckwalter.se> wrote:

> For the record this feature is high on my wish list too. Do you have any
> ideas of where to start if one wanted to implement it?
>
> I'll admit that I asked about this 2011-01 as well[1] but never took it
> anywhere. I'm hoping the answer/right approach may be more obvious now with
> the recent rework.
>
> [1]: https://groups.google.com/forum/#!topic/haskell-charts/o_GMvJxndS4
>
> Thanks,
> Bjorn
>
>
> On Wed, Oct 23, 2013 at 9:45 PM, Tim Docker <tim at dockerz.net> wrote:
>
>> Hi,
>>
>> Welcome to the list.
>>
>> There is currently no way to lock the aspect ratio in this way.
>>
>> Setting the chart size sets the outputs size of the canvas. This includes
>> not just the plot area, but also the title, axis labels, legend, etc.
>>
>> I think you will have to this manually, by choosing the aspect ratio of
>> the output image by setting its size, and then manually setting the range
>> for each axis to give you the desired aspect ratio in plot coordinates.
>>
>> Cheers,
>>
>> Tim
>> On 23 Oct 2013 01:24, "Triwanto Simanjuntak" <
>> simanjuntak.triwanto at gmail.com> wrote:
>>
>>> I just subscribed this mailing list, so hello to all of you.
>>>
>>> Previously I asked the following question,
>>>
>>> [I'm a newbiee Haskell user and after have been toying with available
>>> plotting packages, I found that haskell-chart is the most reliable. So
>>> thanks for all the hard work!
>>>
>>> I have a small problem. Making the axes to be in logarithmic scale was
>>> easily done but I still can't manage to make both axes have equal scale.
>>> I'd be very happy to hear any suggestion on how to achieve it or where to
>>> look for solution.]
>>>
>>>
>>> and  then Tim replied,
>>>
>>> [By both axes, do you mean both Y axes, or the X and Y axes?]
>>>
>>>
>>> To clarify my question:
>>> I meant the latter one, X and Y axes of  a single plot to have equal
>>> scale (aspect ratio), [as for comparison for python-matplotlib, see
>>> http://goo.gl/gP7Sr4]
>>>
>>> Does simply invoking the chart's size to have equal lengths (square
>>> shape),
>>> e.g. renderableToPDFFile chartFoo 320 320 "chartFoo.pdf"
>>> the resulted chart will have equal aspect ratio?
>>> or the declared chart size is basically the size of the canvas
>>> ?
>>>
>>> Thanks,
>>>
>>>
>>> Triwanto
>>>
>>>
>>>
>>> _______________________________________________
>>> Chart mailing list
>>> Chart at projects.haskell.org
>>> http://projects.haskell.org/cgi-bin/mailman/listinfo/chart
>>>
>>>
>> _______________________________________________
>> Chart mailing list
>> Chart at projects.haskell.org
>> http://projects.haskell.org/cgi-bin/mailman/listinfo/chart
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://projects.haskell.org/pipermail/chart/attachments/20131026/952d634c/attachment.htm>


More information about the Chart mailing list