Morris graphs. Have custom yValues - morris.js

In Line Graphs, is possible to set the ymin and ymax values and automatically generate the ranges divided equally.
But I would like to set my own ranges.
example ():
0-5
5-15
15-100
100-10000
Is this posible?

Related

how fix the y-axis's rate in plot

I am using a line to estimate the slope of my graphs. the data points are in the same size. But look at these two pictures. the first one seems to have a larger slope but its not true. the second one has larger slope. but since the y-axis has different rate, the first one looks to have a larger slope. is there any way to fix the rate of y-axis, then I can see with my eye which one has bigger slop?
code:
x = np.array(list(range(0,df.shape[0]))) # = array([0, 1, 2, ..., 3598, 3599, 3600])
df1[skill]=pd.to_numeric(df1[skill])
fit = np.polyfit(x, df1[skill], 1)
fit_fn = np.poly1d(fit)
df['fit_fn(x)']=fit_fn(x)
df[['Hodrick-Prescott filter',skill,'fit_fn(x)']].plot(title=skill + date)
Two ways:
One, use matplotlib.pyplot.axis to get the axis limits of the first figure and set the second figure to have the same axis limits (using the same function) (could also use get_ylim and set_ylim, which are specific to the y-axis but require directly referencing the Axes object)
Two, plot both in a subplots figure and set the argument sharey to True (my preferred, depending on the desired use)

Is there a way to convert bubble chart size?

I have created a bubble chart using the fusion charts api in asp.net. The question/issue I have is leaning more on scaling the chart itself, rather than the particular library I used to generate it.
The chart I have is designed like this:
X = roi
y = lift
circle size = revenue
The code below sets the max/min values of the x axis:
roiMax += 30 'pad the max and min roi values so the bubble wont cut off
roiMin -= 30
I used the new roi min/max values and set them as the minimum/maximum x axis values. It seems to work in most cases. However, if the points displayed are all near each other, then the bubbles become squished together.
If I comment out the portion where I set the x/y max min value of the chart, it looks to scale more properly. However, there are bubbles that cut off if it reaches the edge of the chart. So I want to try to set min/max values for x and y so I can show the full bubble. However, to do that I need to use the circle size to grab the length so I can determine the proper chart limits. Is there a way to convert the size into units of x or the units of y for me to find the proper limit?

Forcing exact boundaries in matplotlib's histogram

If I feed a collection of values to matplotlib's histogram, I get a min and max boundary that has been rounded to a nice number.
E.g. if I feed values between -1 and 18.4, my histogram axis will run from -10 to 50.
Is there a way to force the axis to be a perfect fit for the data, without padding?
Use the range attribute to adjust the range in which the histogram buckets are created, and use xlim to control the exact range displayed on the x-axis.
from pylab import hist, xlim
hist(np.random.random(100) * 100, range=(5,90))
xlim(5,90)

dual y axis plotting causes data points looks messy at left corner of chart

i am using MPAndroid charting toolkit for data visualization. chart plotting smooth in MPAndroid but problem arise when i try plot dual y axis(left& right). As right axis appear data points on spread over the x axis completely. all data points appearing on the left of chart. How can i spread the data points ?
mChart = (LineChart) findViewById(R.id.Chart);
mChart.setGridBackgroundColor(Color.parseColor("#F4F4F4"));
mChart.setDrawGridBackground(false);
mChart.setTouchEnabled(true);
mChart.setHighlightEnabled(false);
mChart.setDragEnabled(false);
mChart.setScaleEnabled(true);
mChart.setPinchZoom(true);
mChart.setDescription("");
mChart.getAxisLeft().setAxisMaxValue(YMaxValue);
mChart.getAxisLeft().setAxisMinValue(YMinValue);
mChart.getAxisLeft().setStartAtZero(false);
mChart.getAxisRight().setEnabled(false);
if(General.InnerClass.Y2AxisValues.size()>0)
{
mChart.getAxisRight().setEnabled(true);
mChart.getAxisRight().setSpaceBottom(12.25f);
mChart.getAxisRight().setAxisMaxValue(Y2MaxValue);
mChart.getAxisRight().setAxisMinValue(Y2MinValue);
mChart.getAxisRight().setStartAtZero(false);
mChart.getXAxis().setAvoidFirstLastClipping(true);
}
mChart.setData(data);
progbar.setVisibility(View.GONE);
mChart.invalidate();
Before
After
The data points are exactly where they should be. The only thing that has changed is the range of values that is displayed on each axis.
--> this range is now significationly lower because only one set of data is represented by each axis, before, one axis had to scale large enough to display both datasets.
I suggest you read the documentation of the YAxis and simply increase the range of values that should be displayed on the axis.
while plotting y2 axis providing the x values is the problem. values for the x axis should be provide for single time. providing twice add the values to x axis exiting values get doubled.
thnx #philipp

Make the X and Y axis scales equal on an Excel chart

I'd like the X and Y axes of my Excel charts to have the same scale on the screen, because I'm plotting geographical data. A 1km by 1km square should look like a square, not like a rectangle, i.e. no squishing of the map in one or the other direction. In Matlab, the command that would do this is axis equal.
How do I do this using VBA?
Am I overlooking an even simpler solution directly in Excel?
In addition to guitarthrower's answer you will need to do the following:
Select the 'Plot Area' of the chart and then manually set the height and width of the plot area.
Sheets("Chart1").PlotArea.Select
Selection.Height = 500
Selection.Width = 500
Just setting the axis min and max values will still allow the chart to be 'squished'.
When you select the plot area and write Selection.Width = something, the Width value you are setting also includes the width of the axis labels/text. This may not be what you want.
Instead, you can set the INSIDE Width/Height value using
Selection.InsideHeight = 250
Selection.InsideWidth = 250
Another method similar to Stewbob's is to set the limits to some ratio of each other (my plots are 4 times as wide as they are tall) and then use the height to set the width.
ActiveChart.PlotArea.Select
Selection.Width = Selection.Height * 4