1
$\begingroup$

I'm trying to plot the type-II superconductors power law for different values of its parameters. I'm currently using the next code. But I want specific values for n, not an iteration, for example, n=1,3,5,15,25,50. Also I want to plot as: J/J0 vs E/E0, but can't manage to do it. I know it's kinda silly, but I can't find a way of doing it, having a little trouble with ":=" and "=" for plotting functions. Thanks in advance!

E0 = 4*10^-4;
  J0 = 1*10^3; 
  Elec[n_] := E0 (J/J0)^n

 Plot[Evaluate@Table[Elec[n], {n, 1, 25, 4}], {J, 0, J0}, 
 PlotRange -> All, 
 PlotLegends -> {"n=1", "n=5", "n=9", "n=13", "n=17", "n=21"}, 
 PlotStyle -> {Thick}, Frame -> True, GridLines -> Automatic]

An example of the graph i'm looking: enter image description here

$\endgroup$
2
  • 2
    $\begingroup$ Instead of {n, 1, 25, 4}, you can write a list over which to iterate {n, {1, 3, 5, 15, 25, 50}} $\endgroup$ – MarcoB May 25 '20 at 0:58
  • $\begingroup$ Thank you! Did not thought of that solution haha. $\endgroup$ – Santiago G. May 25 '20 at 2:15
1
$\begingroup$

Here is something closer to your desired result (using your definitions):

ParametricPlot[
  Evaluate@Table[{J/J0, Elec[n]/E0}, {n, {1, 5, 9, 13, 17, 21}}],
  {J, 0, J0},

  (*AspectRatio to reproduce the ratio in your plot, and in Plot *)
  AspectRatio -> 1/GoldenRatio,

  (* adjust plot range, and prevent dots from being clipped*)
  PlotRange -> All, PlotRangePadding -> 0, PlotRangeClipping -> False,
  PlotLegends -> {"n = 1", "n = 5", "n = 9", "n = 13", "n = 17", "n = 21"},
  PlotStyle -> Thick, Frame -> True, GridLines -> Automatic,
  (*MaxRecursion -> 0 turns off the adaptive sampling features, *)
  (*giving equally spaced mesh points*)
  MaxRecursion -> 0,

  (*Mesh -> All shows all the points used in the plotting*)
  Mesh -> All, MeshStyle -> PointSize[0.015]
  FrameLabel -> (Style[#, 14, Black] & /@ 
          {"J/\!\(\*SubscriptBox[\(J\), \(0\)]\)", 
           "E/\!\(\*SubscriptBox[\(E\), \(0\)]\)"})
]

formatted parametric plot

$\endgroup$
2
  • $\begingroup$ wow! Thanks a lot! Looks great. Also thanks for commenting the code. $\endgroup$ – Santiago G. May 26 '20 at 16:48
  • $\begingroup$ @Santiago You are very welcome! $\endgroup$ – MarcoB May 26 '20 at 17:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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