Plot a diode I/V characteristic

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Plot a diode I/V characteristic

anger
Hi!

I'm trying to plot a I(V) curve of a diode.
The problem is that the scale of V below 0 is much smaller than the scale
above 0 (the picture illustrate it)
https://i.ytimg.com/vi/_vKeaPHXF9U/maxresdefault.jpg
Can I split the scales above and below zero?
I'm using Octave 4.2.2 on Lubuntu.

Thanks,
anger



--
Sent from: http://octave.1599824.n4.nabble.com/Octave-General-f1599825.html


Reply | Threaded
Open this post in threaded view
|

Re: Plot a diode I/V characteristic

Doug Stewart-4


On Sun, Dec 9, 2018 at 4:20 PM anger <[hidden email]> wrote:
Hi!

I'm trying to plot a I(V) curve of a diode.
The problem is that the scale of V below 0 is much smaller than the scale
above 0 (the picture illustrate it)
https://i.ytimg.com/vi/_vKeaPHXF9U/maxresdefault.jpg
Can I split the scales above and below zero?
I'm using Octave 4.2.2 on Lubuntu.

Thanks,
anger


I tried , and I don't think that it can be done on octave. :-(
Doug


Reply | Threaded
Open this post in threaded view
|

Re: Plot a diode I/V characteristic

Maynard Wright
On Monday, December 10, 2018 5:47:19 AM PST Doug Stewart wrote:

> On Sun, Dec 9, 2018 at 4:20 PM anger <[hidden email]> wrote:
> > Hi!
> >
> > I'm trying to plot a I(V) curve of a diode.
> > The problem is that the scale of V below 0 is much smaller than the scale
> > above 0 (the picture illustrate it)
> > https://i.ytimg.com/vi/_vKeaPHXF9U/maxresdefault.jpg
> > Can I split the scales above and below zero?
> > I'm using Octave 4.2.2 on Lubuntu.
> >
> > Thanks,
> > anger
>
> I tried , and I don't think that it can be done on octave. :-(
> Doug
> <https://linuxcounter.net/user/206392.html>

How about scaling up the values that are below zero before plotting?   It
might give you problems with using Octave's labels, but it would expand the
portion of the curve that interests you.

Maynard






Reply | Threaded
Open this post in threaded view
|

Re: Plot a diode I/V characteristic

Pantxo
Maynard Wright wrote
> On Monday, December 10, 2018 5:47:19 AM PST Doug Stewart wrote:
>> On Sun, Dec 9, 2018 at 4:20 PM anger &lt;

> jphenriques@

> &gt; wrote:
>> > Hi!
>> >
>> > I'm trying to plot a I(V) curve of a diode.
>> > The problem is that the scale of V below 0 is much smaller than the
>> scale
>> > above 0 (the picture illustrate it)
>> > https://i.ytimg.com/vi/_vKeaPHXF9U/maxresdefault.jpg
>> > Can I split the scales above and below zero?
>> > I'm using Octave 4.2.2 on Lubuntu.
>> >
>> > Thanks,
>> > anger
>>
>> I tried , and I don't think that it can be done on octave. :-(
>> Doug
>> &lt;https://linuxcounter.net/user/206392.html&gt;
>
> How about scaling up the values that are below zero before plotting?   It
> might give you problems with using Octave's labels, but it would expand
> the
> portion of the curve that interests you.
>
> Maynard

Yes, this looks like a good solution, but you won't be able to indicate the
different scales in x/ylabels as in your original plot.

You could also make use of two axes:

hax1 = axes ("position", [.5 .5 .4 .4]); hold on
plot (0:1000, 0:1000)

hax2 = axes ("position", [.1 .1 .4 .4], "xaxislocation", "top",
"yaxislocation", "right"); hold on
plot (0:-1:-10, 0:-1:-10)

% Remove ambiguous/overlapping tick labels at the origin
xl = get (hax1, "xticklabel");
xl{1} = "";
set (hax1, "xticklabel", xl)
xl = get (hax2, "xticklabel");
xl{end} = "";
set (hax2, "xticklabel", xl)
yl = get (hax1, "yticklabel");
yl{1} = "";
set (hax1, "yticklabel", yl)
yl = get (hax2, "yticklabel");
yl{end} = "";
set (hax2, "yticklabel", yl)

Pantxo



--
Sent from: http://octave.1599824.n4.nabble.com/Octave-General-f1599825.html


Reply | Threaded
Open this post in threaded view
|

Re: Plot a diode I/V characteristic

Pantxo
In reply to this post by Maynard Wright
Maynard Wright wrote
> On Monday, December 10, 2018 5:47:19 AM PST Doug Stewart wrote:
>> On Sun, Dec 9, 2018 at 4:20 PM anger &lt;

> jphenriques@

> &gt; wrote:
>> > Hi!
>> >
>> > I'm trying to plot a I(V) curve of a diode.
>> > The problem is that the scale of V below 0 is much smaller than the
>> scale
>> > above 0 (the picture illustrate it)
>> > https://i.ytimg.com/vi/_vKeaPHXF9U/maxresdefault.jpg
>> > Can I split the scales above and below zero?
>> > I'm using Octave 4.2.2 on Lubuntu.
>> >
>> > Thanks,
>> > anger
>>
>> I tried , and I don't think that it can be done on octave. :-(
>> Doug
>> &lt;https://linuxcounter.net/user/206392.html&gt;
>
> How about scaling up the values that are below zero before plotting?   It
> might give you problems with using Octave's labels, but it would expand
> the
> portion of the curve that interests you.
>
> Maynard

Yes, this looks like a good solution.

You could also make use of two separate axes:

hax1 = axes ("position", [.5 .5 .4 .4]); hold on
plot (0:1000, 0:1000)
hax2 = axes ("position", [.1 .1 .4 .4], "xaxislocation", "top",
"yaxislocation", "right"); hold on
plot (0:-1:-10, 0:-1:-10)
% Remove ambiguous/overlapping tick labels at the origin
xl = get (hax1, "xticklabel");
xl{1} = "";
set (hax1, "xticklabel", xl)
xl = get (hax2, "xticklabel");
xl{end} = "";
set (hax2, "xticklabel", xl)
yl = get (hax1, "yticklabel");
yl{1} = "";
set (hax1, "yticklabel", yl)
yl = get (hax2, "yticklabel");
yl{end} = "";
set (hax2, "yticklabel", yl)

Pantxo



--
Sent from: http://octave.1599824.n4.nabble.com/Octave-General-f1599825.html


Reply | Threaded
Open this post in threaded view
|

Re: Plot a diode I/V characteristic

Doug Stewart-4


On Mon, Dec 10, 2018 at 11:11 AM Pantxo <[hidden email]> wrote:
Maynard Wright wrote
> On Monday, December 10, 2018 5:47:19 AM PST Doug Stewart wrote:
>> On Sun, Dec 9, 2018 at 4:20 PM anger &lt;

> jphenriques@

> &gt; wrote:
>> > Hi!
>> >
>> > I'm trying to plot a I(V) curve of a diode.
>> > The problem is that the scale of V below 0 is much smaller than the
>> scale
>> > above 0 (the picture illustrate it)
>> > https://i.ytimg.com/vi/_vKeaPHXF9U/maxresdefault.jpg
>> > Can I split the scales above and below zero?
>> > I'm using Octave 4.2.2 on Lubuntu.
>> >
>> > Thanks,
>> > anger
>>
>> I tried , and I don't think that it can be done on octave. :-(
>> Doug
>> &lt;https://linuxcounter.net/user/206392.html&gt;
>
> How about scaling up the values that are below zero before plotting?   It
> might give you problems with using Octave's labels, but it would expand
> the
> portion of the curve that interests you.
>
> Maynard

Yes, this looks like a good solution.

You could also make use of two separate axes:

hax1 = axes ("position", [.5 .5 .4 .4]); hold on
plot (0:1000, 0:1000)
hax2 = axes ("position", [.1 .1 .4 .4], "xaxislocation", "top",
"yaxislocation", "right"); hold on
plot (0:-1:-10, 0:-1:-10)
% Remove ambiguous/overlapping tick labels at the origin
xl = get (hax1, "xticklabel");
xl{1} = "";
set (hax1, "xticklabel", xl)
xl = get (hax2, "xticklabel");
xl{end} = "";
set (hax2, "xticklabel", xl)
yl = get (hax1, "yticklabel");
yl{1} = "";
set (hax1, "yticklabel", yl)
yl = get (hax2, "yticklabel");
yl{end} = "";
set (hax2, "yticklabel", yl)

Pantxo



--
Sent from: http://octave.1599824.n4.nabble.com/Octave-General-f1599825.html



Using what Pantxo said, here is an M file for you to start with. :-)



--
DASCertificate for 206392




diodecurves.m (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Plot a diode I/V characteristic

Francesco Potortì
In reply to this post by anger
>I'm trying to plot a I(V) curve of a diode.
>The problem is that the scale of V below 0 is much smaller than the scale
>above 0 (the picture illustrate it)
>https://i.ytimg.com/vi/_vKeaPHXF9U/maxresdefault.jpg
>Can I split the scales above and below zero?

Since the function is exponential, the obvious thing is using a
logarithmic scale on the vertical axis.  Only reason I see to do what
you ask is for didactic reasons.

You should magnify the negative values of the function by 10 and then
change the vertical labels to be magnified by 10 as well.  This function
may help: https://octave.sourceforge.io/plot/function/tics.html

--
Francesco Potortì (ricercatore)        Voice:  +39.050.621.3058
ISTI - Area della ricerca CNR          Mobile: +39.348.8283.107
via G. Moruzzi 1, I-56124 Pisa         Skype:  wnlabisti
(entrance 20, 1st floor, room C71)     Web:    http://fly.isti.cnr.it



Reply | Threaded
Open this post in threaded view
|

Re: Plot a diode I/V characteristic

Doug Stewart-4
In reply to this post by Doug Stewart-4


On Mon, Dec 10, 2018 at 1:30 PM Doug Stewart <[hidden email]> wrote:


On Mon, Dec 10, 2018 at 11:11 AM Pantxo <[hidden email]> wrote:
Maynard Wright wrote
> On Monday, December 10, 2018 5:47:19 AM PST Doug Stewart wrote:
>> On Sun, Dec 9, 2018 at 4:20 PM anger &lt;

> jphenriques@

> &gt; wrote:
>> > Hi!
>> >
>> > I'm trying to plot a I(V) curve of a diode.
>> > The problem is that the scale of V below 0 is much smaller than the
>> scale
>> > above 0 (the picture illustrate it)
>> > https://i.ytimg.com/vi/_vKeaPHXF9U/maxresdefault.jpg
>> > Can I split the scales above and below zero?
>> > I'm using Octave 4.2.2 on Lubuntu.
>> >
>> > Thanks,
>> > anger
>>
>> I tried , and I don't think that it can be done on octave. :-(
>> Doug
>> &lt;https://linuxcounter.net/user/206392.html&gt;
>
> How about scaling up the values that are below zero before plotting?   It
> might give you problems with using Octave's labels, but it would expand
> the
> portion of the curve that interests you.
>
> Maynard

Yes, this looks like a good solution.

You could also make use of two separate axes:

hax1 = axes ("position", [.5 .5 .4 .4]); hold on
plot (0:1000, 0:1000)
hax2 = axes ("position", [.1 .1 .4 .4], "xaxislocation", "top",
"yaxislocation", "right"); hold on
plot (0:-1:-10, 0:-1:-10)
% Remove ambiguous/overlapping tick labels at the origin
xl = get (hax1, "xticklabel");
xl{1} = "";
set (hax1, "xticklabel", xl)
xl = get (hax2, "xticklabel");
xl{end} = "";
set (hax2, "xticklabel", xl)
yl = get (hax1, "yticklabel");
yl{1} = "";
set (hax1, "yticklabel", yl)
yl = get (hax2, "yticklabel");
yl{end} = "";
set (hax2, "yticklabel", yl)

Pantxo



--
Sent from: http://octave.1599824.n4.nabble.com/Octave-General-f1599825.html



Using what Pantxo said, here is an M file for you to start with. :-)



--
DASCertificate for 206392


I added some annotation to the plot.
I hope this is helpful.

--
DASCertificate for 206392




diodecurves.m (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Plot a diode I/V characteristic

anger
Thanks to everyone who replied. This solves my problem.

All the best,
anger



--
Sent from: http://octave.1599824.n4.nabble.com/Octave-General-f1599825.html


Reply | Threaded
Open this post in threaded view
|

Re: Plot a diode I/V characteristic

Doug Stewart-4


On Tue, Jan 22, 2019 at 4:08 PM anger <[hidden email]> wrote:
Thanks to everyone who replied. This solves my problem.

All the best,
anger



You are welcome.
Would you share with us your version and results. This would help any one else that is trying this kind of plotting.

 
--
Sent from: http://octave.1599824.n4.nabble.com/Octave-General-f1599825.html




--
DASCertificate for 206392