Plotting Vertical Lines - line

I want to plot tomorrow's key times with vertical lines and want them plotted in advance of the time, not once the time comes.
I have used indicators that plot session times but they only plot the line after the time hits. I want them plotted before the actual time hits. I want tomorrow's key times to be visible today.

Related

Dataframe to Plotly graph with slider without reloading dataframe

I am plotting a 2D scatter plot from a dataframe in a dash app.
X axis is my index (price points)
Then I have a number of columns corresponding to Y values for different dates (columns 2020, 2021 etc).
And I’d like to add a slider to only show Y values from a specific year.
The trick is, I don’t want to reload the dataframe each time as it takes a long time to generate and I can’t set it as a global variable because will be used by several people at the time.
Is there a way to keep all of that in memory ? Or to avoid reloading the dataframe ?

How to update an image without adding new colorbar every time

I am displaying an image with matplotlib. However, every time I update this image, a new colorbar is added to the right and my image is shrunk.
1st time running the code
2nd time running the code
3rd time running the code
4th time running the code
if slice1 is a 2D array
plt.figure("slice 1")
plt.imshow(slice1)
plt.colorbar()
plt.clim(0, 1000)
plt.set_cmap('gray')
plt.show()
I would like to have the colorbar and image stay at the same place every time I run these lines.

Plot different Times Series Data in one Chart with shared x-Axes Pandas

I want to plot 5 different data frames in 1 plot. Containing the same measurement but done at different times. The plot should share the x-Axis for all measurement.
First thing i did was to calculate the time between the measurement points. It differs between 5-10 ms but sometimes also big gaps of 200 ms.
Then i calculated the running sum over this column. Then i set this column as the index (dtype "timedelta64[ns]")
Now i want to plot those 5 times.series in one plot which share the x-Axis (as time in ms)
But i don´t now how because they have almost no common index together. The plot should have one common x-Axis from 0-3 seconds containing the 5 measurements.
Thank you!
2 Example DataFrames:
example for measuremt01
example for measuremt02

Optimal display for overlapping series in a line chart

In a context of a line chart displaying time data in regular intervals where multiple series might overlap what would be the optimal way to:
A) hint the user that the chart has overlapping series?
B) give the user the capability to visualize all those series? Like spanning the series somehow?
For overlapping series in a line chart, I would keep the traditional line chart but put a label at the end of the graph with a color legend. The legend and label will help the user get information quickly.
Another version of a line chart for overlapping series can be a line area chat.
If you are not stuck on only line charts, I would suggest a bar chart. Below are some examples that you can use.
Example 1:
Example 2:
Example 3:
There are couple ways to indicate that there are overlapping series on a chart. You can increase the marker radius of one of them. The number of legend elements tells you how many series there is, too. Finally, you can distribute series on a different yAxis, with different top and height properties. Also, in styled mode, when you hover on legend item, other series opacity changes.
API Reference:
http://api.highcharts.com/highcharts/plotOptions.line.marker.radius
Examples:
http://jsfiddle.net/whsgpdyw/ - changing marker radius
http://jsfiddle.net/fuq6j4sg/ - each series on a different yAxis

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.