I have created a circuit which contains a dc voltage source, a resistor and a diode all connected in series. The negative terminal of the source as well as the n terminal of the diode are grounded. I want to plot the voltage across the diode Vs the current through it. How can I do that?
It is very easy to draw the 2D plot. There are simple commands for this purpose.
You have to use the plot command and the your variable in the braces with this.
In one plot command mention the both variables which are voltage and current in your case.
In those variables you must store the same length of the values for two dimension plot.