I have to generate analysis of flight reports. In the chart I'm trying to draw, each point is corresponding to one flight with the Date in X-axis. So, It is possible to have several points for the same X.
Each point represent the aircraft speed at a specific moment in the flight. The pilot did good if the value (IAS in knots) is in the range 80-95. So, I want to show if the pilot is getting better by a running median on 8 values. But, sometime there are multiple flights on the same day so it creates "vertical lines" in the trendline.
I'm using Python on Databricks.
There is my dataset:
And there is the plot:
What is the best way to draw a smooth trend line dealing with Date as X-axis and the multiple points on same X ?
Thanks
I am very new to Python, but I am determined to learn how to use it. At the moment, I am working with .dat files that have a few columns only separated by spaces.
I was wondering if there is anyway that I can make a scatter plot with a specific column accompanied by each value's non-negative integer? (i.e. 0,1,2,3,4...).
Here is an example of the data I am working with:
Here is an example graph of what I would want to be the end result:
To better explain what I mean in the title...
Let's say I have line plot graph that shows adjusted close for a stock for 01.01.2016 until now, and then i have another bokeh chart that displays histogram of volumes for the exact same stock for exact same time period.
What I want is:
Zoom in on a particular time period in adj close graph
Have volume histogram graph adjust to the same time period.
and vice versa...
It seem to me that this example do something very similar to what you are you asking for.
The bit that link one chart to another is in figure definition, i.e in:
p2 = figure(x_range=p.x_range)
x_range=p.x_range link the x range of the current figure with x range of figure p.
I'm currently playing around with the fbprophet Python API that Facebook just released for time series forecasting.
My forecast dataframe looks like this:
forecast.head()
ds,cap,t,trend,seasonal_lower,seasonal_upper,trend_lower,trend_upper,yhat_lower,yhat_upper,yearly,yearly_lower,yearly_upper,seasonal,yhat
2008-08-01,21064.0,0.0,13534.8985798,295.074941086,3627.77638435,12515.7266808,14582.8551068,12328.7743552,18619.6705558,2330.03631841,611.380084432,3802.86997467,2014.50868144,15549.4072612
2008-09-01,21600.0,0.0101839684625,13431.7394718,1438.43275222,4947.87832578,12450.622301,14428.4657678,13422.5289632,19595.7519179,2545.44444698,1140.23960946,3979.38497822,3089.74759767,16521.4870695
2008-10-01,21966.0,0.0200394218134,13331.908077,1834.90809248,4653.4289911,12382.4033864,14294.8653737,13411.0205974,19818.8904872,2886.28927049,1512.9361508,4269.31963345,3230.24309437,16562.1511714
2008-11-01,14387.0,0.030223390276,13228.7489691,-3351.95070458,-496.310787437,12312.4002068,14162.0170017,8077.85318805,14293.8736792,-2139.69062288,-3514.21626125,-943.144422123,-1895.13014899,11333.6188201
2008-12-01,12377.0,0.0400788436268,13126.5256588,-5241.07039645,-2399.13703352,12246.8937196,14031.1107877,6254.36024438,12626.4645414,-4278.57816444,-5379.58985709,-3176.14935573,-3734.27501375,9392.25064509
This is fine for plotting the simple plot with capacity as a dotted line.
My problem, however, is that if I plot the components
model.plot_components(forecast).show()
see my components_plot
I still get the dotted line of capacity on top of the annual trend line (which is not relevant at all).
My work-around is to delete the column "cap" from the dataframe before plotting.
del forecast['cap']
Isn't there a less destructive way to proceed to plot the trends without the capacity?
I'm trying to plot EEG (electroencephalography) data (an array of nElectrodes by nTimepoints) in python. I want to create a plot representing each electrode on the y-axis and each time point on the x-axis, but I also want the amplitude response to be represented on the y-axis. Here's an example of what I want the graph to look like (sorry for the rubbish xkcd powerpointedness of the graph):
http://i.stack.imgur.com/9LPqF.png
I'm having difficulty working out how to do this, particularly getting my head around giving each 'electrode' the ability to overlap with other electrodes (making artefacts much easier to spot).
I would really appreciate any help, so thanks in advance!
Darren
So upon looking back at the suggestion from #sebix, the following link has a small section of plotting script at the end which seems to work well for what I want. Here's the link below:
http://matplotlib.org/1.2.1/examples/pylab_examples/mri_with_eeg.html
I've never used offsets or anything before so this is new territory for me! Thanks for the comments.