Dynamically hide part of plot

V

vanczos

New member
I can't seem to find a way to dynamically hide parts of a plot. I essentially want to create a discontinuous line plot that only shows data points if they meet a condition. As far as I can tell, SetHiding() applies broadly to the entire plot, so is there any way to paint data points only if they meet a condition?

i.e. if I have a = {0, 0, 4, 5, 6, 0, 1, 3, 0, 2, 6}, I only want to display a[2] through a[4] and a[6] through a[7] based on criteria from a separate array b.

Thank you!

EDIT: After some more thought, perhaps people accomplish the look of "separate" lines by making the plot color the same as the background color? I guess I assumed the time dividers would conflict but I didn't consider the order things are painted.
 
Last edited:
V

vanczos

New member
In case anyone has the same problem, I hid the points by setting their color to the background color (which can be done dynamically on a point-by-point basis, which was my problem in the first place). The rgb color code (22, 22, 22) is the default background of ToS.

Code:
plot_name.AssignValueColor(if show_condition_is_true then color.red else CreateColor(22,22,22));
 

Similar threads

Top