1
$\begingroup$

Right now my plot looks likeenter image description here

Code is:

ListLogPlot[{data1T, data2T, data3T}, PlotRange -> All, Mesh -> All, 
 Joined -> True, 
 PlotLegends -> 
  Placed[{"1st JFET", "2nd JFET", "3rd JFET"}, {0.7, 0.3}], 
 Frame -> {{False, True}, {True, False}}, 
 FrameLabel -> {{None, "ID (mA)"}, {"VGS (V)", None}}, 
 FrameTicks -> All, PlotLabel -> "ID vs VGS for all 3 2N5486 nJFETs"]

Where my data is

{data1T,data2T,data3T}={{{-0.00007, 9.93}, {-0.0576, 9.57}, {-0.286, 8.51}, {-0.492, 
   7.61}, {-0.684, 6.8}, {-0.819, 6.27}, {-1.021, 5.48}, {-1.294, 
   4.46}, {-1.454, 3.9}, {-1.597, 3.42}, {-1.852, 2.6}, {-2.118, 
   1.84}, {-2.34, 1.27}, {-2.506, 0.892}, {-2.644, 0.617}, {-2.884, 
   0.244}, {-3.217, 0.0154}, {-3.442, 0.0003}, {-3.618, 
   0.}}, {{-0.00005, 12.64}, {-0.1857, 11.75}, {-0.4357, 
   10.64}, {-0.7212, 9.46}, {-0.8856, 8.79}, {-1.067, 8.06}, {-1.312, 
   7.11}, {-1.45, 6.6}, {-1.658, 5.84}, {-1.883, 5.05}, {-2.188, 
   4.04}, {-2.403, 3.34}, {-2.645, 2.654}, {-2.87, 2.03}, {-3.172, 
   1.29}, {-3.444, 0.729}, {-3.618, 0.437}}, {{-0.00005, 
   9.77}, {-0.0895, 9.35}, {-0.09541, 9.33}, {-0.1989, 
   8.88}, {-0.3123, 8.38}, {-0.4691, 7.71}, {-0.6259, 7.06}, {-0.7617,
    6.53}, {-0.8837, 6.05}, {-1.044, 5.44}, {-1.263, 4.64}, {-1.424, 
   4.07}, {-1.613, 3.44}, {-1.887, 2.58}, {-2.185, 1.74}, {-2.273, 
   1.52}, {-2.495, 0.991}, {-2.689, 0.602}, {-3.02, 0.142}, {-3.4, 
   0.002}, {-3.62, 0.}}}

The important (problem) data points are near 0, so {-3.618, 0} for data1T and {-3.62, 0} for data3T. These points are clearly not plotted as no point on the green or blue line goes past -3.5

What is going on and how can I fix it? I have already set the PlotRange to All/Full (neither works)

$\endgroup$
0

1 Answer 1

3
$\begingroup$

Try making the substitution 0.0 → $MachineEpsilon

ListLogPlot[ {data1T, data2T, data3T} /. 0.0 -> $MachineEpsilon, PlotRange -> All, Mesh -> All, Joined -> True, PlotLegends -> Placed[{"1st JFET", "2nd JFET", "3rd JFET"}, {0.7, 0.3}], Frame -> {{False, True}, {True, False}}, FrameLabel -> {{None, "ID (mA)"}, {"VGS (V)", None}}, FrameTicks -> All, PlotLabel -> "ID vs VGS for all 3 2N5486 nJFETs"]

enter image description here

$\endgroup$
4
  • $\begingroup$ Thank you so much, for the sake of my own learning, could you explain what is happening here and how you knew to fix it and exactly what machineepsilon does? thanks $\endgroup$
    – meek0
    Commented May 14 at 3:22
  • 2
    $\begingroup$ You cannot plot 0. on a log scale since Log10[0] evaluates to -Infinity. However, Log10[$MachineEpsilon] evaluates to -15.653559774527022 $\endgroup$
    – Bob Hanlon
    Commented May 14 at 5:39
  • $\begingroup$ @BobHanlon thank you, I don't know how I missed this $\endgroup$
    – meek0
    Commented May 14 at 19:39
  • $\begingroup$ 30+ years of Mathematica and, eventually, a few things sink in. However, in my opinion, Wolfram should handle this a little more gracefully. $\endgroup$ Commented May 15 at 5:39

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.