Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the purpose of the scale argument in functions such as setYLabelsColor()?

In the achartengine library, the class XYMultipleSeriesRenderer which has two functions:

public void setXLabelsColor(int color)

public void setYLabelsColor(int scale, int color)

setXLabelsColor() intuitively makes sense since one only needs to pass in the color, but for the longest time I could not figure out what the 'scale' argument is for setYLabelsColor did. The docs says, it is "renderer scale", but it is not apparently clear what values scale could be. After messing around with the inputs, I finally got the function to work with a 'scale' value of 0. This does not make intuitive sense to me. I thought that a scale value of 1 would mean the chart keeps its scale. Why does a value of 0 work, whereas a default scale value of 1 doesn't?

like image 317
Eric Ren Avatar asked Apr 20 '13 04:04

Eric Ren


People also ask

What could be the purpose of the arguments inside a function?

In mathematics, an argument of a function is a value provided to obtain the function's result. It is also called an independent variable. , is called a unary function.

What is function argument in python?

The terms parameter and argument can be used for the same thing: information that are passed into a function. From a function's perspective: A parameter is the variable listed inside the parentheses in the function definition. An argument is the value that are sent to the function when it is called.

How do you pass arguments to a function in Python?

Here are simple rules to define a function in Python. Function blocks begin with the keyword def followed by the function name and parentheses ( ( ) ). Any input parameters or arguments should be placed within these parentheses. You can also define parameters inside these parentheses.

How can you get the type of arguments passed to a function?

There are two ways to pass arguments to a function: by reference or by value. Modifying an argument that's passed by reference is reflected globally, but modifying an argument that's passed by value is reflected only inside the function.


2 Answers

Take a look at below image. There are two lines in there, scaled in a separate way, the "Air temperature" on the left having scale = 0 and the "Sunshine hours" on the right having scale = 1. pic
(source: achartengine.org)

like image 169
Dan D. Avatar answered Oct 21 '22 04:10

Dan D.


I believe that scale is meant to refer to which series that you are editing. In a multipleXYseriesrenderer, the scale number refers to the "nth" series you entered. For example, if you only have 1 series, then editing scale "0" will edit only that series. This is what my understanding is, although I cannot say for certain. IT seems that the documentation could certainly use some cleaning up.

like image 29
mattitiyahoo Avatar answered Oct 21 '22 04:10

mattitiyahoo