Page 1 of 1

Chart number of digits on y-axis

Posted: Tue Aug 21, 2018 4:18 am
by xprimexinverse

I often use the model object for scenario analysis and one chart that I usually create displays the shock variable.

For example, the chart below shows house prices as 10% deviation from baseline. However, notice that the y-axis is by default using a very high level of precision / number of digits. I was wondering, first, if this y-axis behavior is desirable (for other cases), and, second, if not, could the settings be changed such that this level of precision is turned down?

EViewsPlot.png (12.24 KiB) Viewed 4787 times

Technically, I think the following is going on. In the chart, all values are equal to the integer value of 10, but there's some difference shown in the chart due to the computer representation of numbers.

Of course, the simple solution is for me to change the y-axis. It would just be nice if the default plotting worked as one would expect.

Not a big issue.


Re: Chart number of digits on y-axis

Posted: Tue Aug 21, 2018 6:24 am
by EViews Gareth
Not sure I understand what you are asking. Since the bars all have different heights, it would seem your data are all extremely close in value, but not identical. By forcing the Y-axis values to all be exact, the bars would all become the same height.

Re: Chart number of digits on y-axis

Posted: Tue Aug 21, 2018 9:40 am
by startz
If you are worried about computer precision, which is a reasonable thing to worry about, perhaps apply @round() before graphing.

Re: Chart number of digits on y-axis

Posted: Wed Aug 22, 2018 3:19 am
by xprimexinverse
Hi Gareth, startz,

Thanks for the replies.

I think what I wanted was a way to set the default number of decimal places on the y-axis when creating charts.

Actually, I can do this by going to Options then Graphics Defaults then Axes & Scaling then under Data axis set the number of decimal places to, say, 1 or 2 rather than use the Auto option. The screenshot below demonstrates this.

EViewsPlot2.png (21.98 KiB) Viewed 4749 times

The @round function is also an option - and depending on how I've written the program may be the better option. Either way, couple of options!

Btw... I don't think I'd ever really need more than 2 decimal places. An economist claiming more precision than two decimals would definitely be codding around! :lol: