08-13-2011 01:17 PM
Hello everyone
I have a XY graph with multiple plots (sometimes more than 300). There are two kinds of plots: A and B. "A" will be red, "B" will be blue. Using property nodes, first I send all the plots to the graph and after that I use a for loop to set the colors of each one using a array with colors. Settings like line style, width, etc. are adjusted by the for loop as well. Everything is working like a charm and the plots appear very fast in the graph, but takes a couple seconds (5 or 6) to adjust all the settings for all plots.
"Plot.Color" and "Plot.Fill/PtColor" must be kept in the for loop because they always change. But, PointStyle, LineStyle, LineWidth and Inerpolation are always the same.
Is there a way to say the graph set as default the settings for PointStyle, LineStyle and LineWidth, regardless of number of plots? I am trying to make my code faster.
Thanks
Dan07.
08-13-2011 01:38 PM
Dan07,
Try using two loops. In the first loop set the style parameters once, then do not change those parameters again. If the code segment you posted is inside some other loop, move the first loop outside that loop. In the second loop just change the color parameters and repeat as often as necessary. Also, consider the Defer Front Panel Updates property. Set it to defer before starting the color loop and the set it back to normal afterwards.
Lynn
08-13-2011 01:53 PM