# Problem with displayed coordinates in LogLinearPlot

I have a very weird problem that I don't usually get. I try to plot a set of equations using LogLinearPlot and the Get coordinates right-click menuitem is working just fine. However, when I change the parameter, I right click in the image to get the coordinate, however displayed coordinate value is inconsistent with the axis. I point at around 100 to 1000 but it gives me -0.02631. This problem does not always appear and it depends on the parameters I use (ash, csh, etc.).

I'm sorry for dumping my code. It is given because I don't know how to make it simpler.

<< "PlotLegends"

bsh[ash_, Gs_, s0_] := ash/Gs*s0/100;
w[af_, nf_, mf_, ws_, \[Psi]_] := ws/(
(Log[Exp[1] + (\[Psi]/af)^nf])^mf);
e[ash_, csh_, w_, Gs_, s0_] := ash*(
((((w/100)^csh)/(bsh[ash, Gs, s0]^csh)) + 1)^(1/csh));
s[af_, nf_, mf_, ws_, \[Psi]_, ash_, csh_, Gs_, s0_] := (
w[af, nf, mf, ws, \[Psi]]*
Gs/e[ash, csh, w[af, nf, mf, ws, \[Psi]], Gs, s0]);

Gs = 2.61; ws = 44.664; ll = 64; s0 = 98.373;
af = 1049; nf = 3.83; mf = 1.6; ash = 0.878; csh = 36.52;

LogLinearPlot[{
s[af, nf, mf, ws, \[Psi], 0.9, csh, Gs, s0],
s[af, nf, mf, ws, \[Psi], 2*ash, csh, Gs, s0],
s[af, nf, mf, ws, \[Psi], ash, csh, Gs, s0],
s[af, nf, mf, ws, \[Psi], 0.5*ash, csh, Gs, s0],
s[af, nf, mf, ws, \[Psi], 0.25, csh, Gs, s0]},
{\[Psi], 0.01, 1000000},
ImageSize ->400, AxesStyle -> Thick, PlotRange -> {0, 100},
LabelStyle -> {Bold, 14}, AxesLabel -> {"\[Psi]", "S"},
PlotLegend -> {"4ash", "2ash", "ash", "0.5ash", "0.25ash"},
LegendPosition -> {1.1, -0.4}, LegendTextSpace -> 1,
PlotStyle -> {Red, Thick, Dashed, Dotted, DotDashed}]

• Could you add how you made the plot ? Mar 23 '13 at 10:27
• Ok. I just add it. [psi] is a esc y esc symbol. I dont know why it change into [psi] Mar 23 '13 at 10:47
• My idea is that the PlotLegends package messes up the coordinates. Removing the legend-related options fixes it. Can you use the version 9 built in PlotLegends option instead of the (now obsolete) package? Mar 23 '13 at 10:58
• Ahh, I see, you are on v8. Then I guess you have to construct your own legend from scratch. Mar 23 '13 at 10:59
• Ah I see....glad to know what is the cause. Thx Mar 23 '13 at 11:00

In version 9 one can use the builtin PlotLegends option, but pre-9 it seems like the "PlotLegends" package messes up coordinate display. In this case, fall back to create your own legend. For that, define styles and labels outside of the plot so that your legend can use them too.

styles = {Red, Thick, Dashed, Dotted, DotDashed};
labels = {"4ash", "2ash", "ash", "0.5ash", "0.25ash"};
legend = Panel@Grid@MapThread[{Graphics[{#1, Line@{{0, 0}, {1, 0}}}, ImageSize -> 30,
AspectRatio -> .3], #2} &, {styles, labels}];
Row@{
LogLinearPlot[Evaluate[{
s[af, nf, mf, ws, \[Psi], 0.9, csh, Gs, s0],
s[af, nf, mf, ws, \[Psi], 2*ash, csh, Gs, s0],
s[af, nf, mf, ws, \[Psi], ash, csh, Gs, s0],
s[af, nf, mf, ws, \[Psi], 0.5*ash, csh, Gs, s0],
s[af, nf, mf, ws, \[Psi], 0.25, csh, Gs, s0]} /. par],
{\[Psi], 0.01, 1000000},
ImageSize -> 400, AxesStyle -> Thick, LabelStyle -> {Bold, 14},
AxesLabel -> {"\[Psi]", "S"}, PlotRange -> {0, 100}, PlotStyle -> styles],
legend
}