How can I make an equal distance between the years of the x-axis on a df.plot()? - pandas

I want to make an equal distance between the years of the x-axis, however currently the distribution between 2007 and 2014 is very small and between 2014 and 2015 really big. How can I make the distribution equally? Thanks for your help!
My code is: reviews_english_date.plot(x="Datum Review Gast Jahr",y="Review Gast Count")
Picture of Plot
Dataset

Related

SSRS: Plotting only a specific product on a chart

I'm currently building a report which will show the weight of a specific product throughout the day on a chart. The problem I'm having is that the SQL code pulls the weights of all the products rather than only the one I want. As a result, when I plot the data it shows me the weights of all the products throughout the day. I was wondering if anyone knew how I should approach plotting the data.
The fields I am working with are named: "Product_description" and "Weight"
Thanks in advance!

Dynamic graph that changes with time? Is it possible with VBA?

I have some data that I was wondering I could graph with time?
Basically first "graph" would be at time 0 which for example would be X vs Y, then second "graph" would be at time 0.5 seconds which is again X vs Y etc..
Maybe this will help explain my case:
Time (s) X Y
0 1 1
0.5 2 2
1 3 3
1.5 4 4
2 5 5
2.5 6 6
So according to the table above the values I want to graph are X vs Y, but I have so many time points of X & Y. Is it possible with VBA to produce an animation of X vs Y that loops through all the time points I have?
I tried to google alternatives but didn't find what I want, maybe Im looking in the wrong place? Is it possible with VBA? If not is there any software that can do this for me? The graph doesnt have to update automatically, I dont mind pressing a button for it to jump to the next time interval (Without creating a new graph).
Take a look at Power BI Designer (and the Power BI service, of course). The Scatter chart in that tool can take a value for the play axis, so the data can be played as an animation.
You could also use Power View in Excel 2013. I created a Power View scatter chart in Excel 2013 and clipped the animation to YouTube.
A sample file with a Power View and several series with a play axis can be accessed on my OneDrive

Excel Macro to extrapolate depending on current time

I am trying to write an Excel macro to extrapolate data when necessary. I will elaborate with the following example:
During the year, I receive data at the end of each month, fill it in the table below, to generate a line chart in Excel.
Jan. Feb. Mar. Apr. May June July Aug. Sept. Oktob. Nov. Dec.
100 150 300 230 80 0 170
The resulting chart is:
I also receive the data once at the end of each week. If for example, it is the first week of July, and i enter the data into cell below July (50 instead 170), I want Excel to plot it at the specific position and to perform a linear extrapolation until July. Such as the outcome is:
Main question:
How can I use current data as a condition?
How can I insert a plot at a quarter, if the x-axis contains months as labels?
As mentioned in my comment, the way to get the effect of plotting every 1/4 step of the X-axis in you forecast is to have the data series plotting actual (non-forecast) values every 4th step of the X-axis. This way, the forecast plotting every step looks like it's using smaller steps. To further the effect you may want to have labels on the X-axis only for every 4th step.

How to visualize (make plot) of regression output against categorical input variable? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 6 years ago.
Improve this question
I am doing linear regression with multiple variables. In my data I have n = 143 features and m = 13000 training examples. Some of my features are continuous (ordinal) variables (area, year, number of rooms). But I also have categorical variables (district, color, type). For now I visualized some of my feautures against predicted price. For example here is the plot of area against predicted price:
Since area is continuous ordinal variable I had no troubles visualizing the data. But now I wanted to somehow visualize dependency of my categorical variables (such as district) on predicted price.
For categorical variables I used one-hot (dummy) encoding.
For example that kind of data:
turned to this format:
If I were using ordinal encoding for districts this way:
DistrictA - 1
DistrictB - 2
DistrictC - 3
DistrictD - 4
DistrictE - 5
I would plot this values against predicted price pretty easy by putting 1-5 to X axis and price to Y axis.
But I used dummy coding and now I do not know how can I show (visualize) dependency between price and categorical variable 'District' represented as series of zeros and ones.
How can I make a plot showing a regression line of districts against predicted price in case of using dummy coding?
If you just want to know how much the different districts influence your prediction you can take a look at the trained coefficients directly. A high theta indicates that that district increases the price.
If you want to plot this, one possible way is to make a scatter plot with the x coordinate depending on which district is set.
Something like this (untested):
plot.scatter(0, predict(data["DistrictA"==1]))
plot.scatter(1, predict(data["DistrictB"==1]))
And so on.
(Possibly you need to provide an x vector of the same size as the filtered data vector.)
It looks even better if you can add a slight random perturbation to the x coordinate.

Core Plot Graph Label steps

I'm using Core Plot to draw graphs in my app.
I just encountered a problem:
I have dates on the X-Axis and I use a custom labeling policy.
If I only have a few records everything works fine
If I have many records all the labels are near and not useful :-(
So the question is: How can I decide which values display and which not to always have 10 labels, separated one from the other.
Divide the number of points by the number of labels you want and round up. For example, if you have 25 data points and want roughly 10 labels, label every third data point. You'll end up with 9 evenly spaced labels.