# Convert code V4.1 into code V11?

Posted 9 months ago
1078 Views
|
2 Replies
|
2 Total Likes
|
 Hi all,I'm struggling with rewriting of some old code from mathematica V4.1....I'm using V11. I have problems with follwoing (old) commands: ShowLegend MultipleListPlot LegendPosition That's the code which I try to bring it into V11. << GraphicsLegend << GraphicsMultipleListPlot a1 = 1.5; a2 = 3; a3 = 6; X = 1000; \[Lambda] = 0.01; R = Range[-10.01, 10.01, 0.1]; I1[R_] := (BesselJ[1, 2*Pi*a1*(R/(\[Lambda]*X))]/(2*Pi*a1*(R/(\[Lambda]*X))))^2; I2[R_] := (BesselJ[1, 2*Pi*a2*(R/(\[Lambda]*X))]/(2*Pi*a2*(R/(\[Lambda]*X))))^2; I3[R_] := (BesselJ[1, 2*Pi*a3*(R/(\[Lambda]*X))]/(2*Pi*a3*(R/(\[Lambda]*X))))^2; ShowLegend[ MultipleListPlot[Transpose[{R, I1[R]}], Transpose[{R, I2[R]}], Transpose[{R, I3[R]}], PlotJoined -> True, DisplayFunction -> Identity, PlotStyle -> {Hue[1], Hue[0.5], Hue[0.25]}, AxesLabel -> {"R", "I"}, PlotRange -> {{-15, 10}, {0, 0.3}}], {{{Hue[1], "I1[R]"}, {Hue[0.5], "I2[R]"}, {Hue[0.25], "I3[R]"}}, LegendPosition -> {1.1, -0}}]; I would be grateful for your support!
2 Replies
Sort By:
Posted 9 months ago
 You need to look in the documentation for similar functionality. The Legend package, for example, was obsoleted in 5.2, and that functionality was folded into the main system in v 9. Check the Guide pagehttp://reference.wolfram.com/language/guide/Legends.htmlThe same guide page is in the desktop Documentation center. I hesitate to provide a direct replacement, since the functionality has been expanded, and you may prefer some of the new functionality, rather than just recreating the old.The same thing applies for MultipleListPlot.You can just use ListPlot[{plot1, plot2}], where, in your case, plot1 is Transpose[{R, I1[R]}], etc.In general, there are very few add-on packages in the current Mathematica. Not all the obsolete code may be in the desktop Documentation center, but most of it seems to be in the on-line version. In most cases, it is pretty obvious which new functions replace the old.Hope this helps.