1
\$\begingroup\$

I am facing a strange issue. My waveform color changes when I add a .STEP command in my circuit.

NOTE: I am aware of the following problem, but my problem is little different.

LTspice: How can I show multiple probes with waveforms using stepping parameters in different colors?

The following is the simple circuit. I am just checking the input signal on the waveform:

Edited: 15-July-2022
(NOTE: Maybe my question is not so clear, my doubt is not in the color of Vout signal, the doubt is that when STEP command is added, the color of Vin signal on plot/waveform is changed and unfortunately I can't control it, means I can't change the color it's always red in my case)

Simple Circuit

After this I used the STEP command for the capacitor. The output waveform is not even added into the plot pane but the color on my input waveform is changed. It should be green.

Simple Circuit Color Changed

And again:

enter image description here

It is not a major issue, but I still wanted to understand if there is a way to fix this, or if I am doing something wrong.

\$\endgroup\$
6
  • 1
    \$\begingroup\$ That’s normal. You can change the color in the plot. \$\endgroup\$
    – winny
    Commented Jul 15, 2022 at 8:22
  • \$\begingroup\$ @winny this is the problem, I can't change, as you can see in the last two images, Vin is in green color but on plot it is of red color, I tried to change but it didn't change. \$\endgroup\$ Commented Jul 15, 2022 at 8:49
  • 1
    \$\begingroup\$ @xpress_embedo What did you expect? When people use .step they expect some sort of differentiation between the traces, and colours are the simplest choice. If you want them all to be the same colour then you have two choices: either plot two waveforms in the same plot pane, or plot each step ,individually, as V(vout)@1, V(vout)@2, ..., and manually change their colours. Why do you want them in the same colour? \$\endgroup\$ Commented Jul 15, 2022 at 12:45
  • \$\begingroup\$ @aconcernedcitizen maybe I am not very clear, first of all everything is fine, I am just curious why I can't change the color of the Vin signal, as you can see in the last two images, the selected color is green but the waveform shown is in red color. And really thanks for this V(vout)@1 I am not aware of this, I tried this also, but still I can't change the color of the waveform individually. I want to mention this once again, color is not a problem, just out of curiosity I am asking if this is possible or not? \$\endgroup\$ Commented Jul 15, 2022 at 13:47
  • 4
    \$\begingroup\$ @xpress_embedo When using .step, multiple waveforms are drawn. Each one uses a different color to distinguish them from the others. Since Vin doesn't change, the later waveforms are drawn on top of the earlier ones, essentially replacing them with different color ones. \$\endgroup\$
    – Hearth
    Commented Jul 15, 2022 at 14:22

1 Answer 1

3
\$\begingroup\$

I think I see the problem now. You plotted V(vin), which is not affected by the .step command, yet you see a green label and a red trace. Well, all the waveforms are affected, since the result of a .step is a simulation of the entire schematic, then the next .step is another simulation, and so on. That means that even waveforms that, in appearance, should not be affected, are. Such is the case with V(vin): it is run for all the three runs, which means it gets the same change in colours as the rest.

But here is the catch: since the wavefrom doesn't change, all the three runs result in the same displayed waveform, and since the colours change, too, it means that the last .step colour will overlap the others. In this case, your colous are green, blue, and red (you can change these in the menu, under Tools > Color Preferences, the Waveform tab), so the last one, red, is above the blue, which is above the green.

Unfortunately, using the @ to select the .step waveforms doesn't cure this, so a beter choice is to RClick inside the waveform area, then use View > Select Steps to sort them out. That will use the correct colour.

\$\endgroup\$
2
  • 1
    \$\begingroup\$ I actually didn't know this was possible! Good to know. \$\endgroup\$
    – Hearth
    Commented Jul 15, 2022 at 14:31
  • \$\begingroup\$ Thanks to all of you. Now this is clear to me that how step command works and it effects of the color. Many Thanks, I am accepting this answer to close the topic. \$\endgroup\$ Commented Jul 15, 2022 at 14:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.