 set LinearAxis AxisPosition.left and LogarithmicAxis AxisPosition.bottom plot uncorrecttly

Oystein Bjorke il y a 5 ans
This discussion was imported from CodePlex

ProCodeMyth wrote at 2012-04-18 10:28:

Hi Objo,

Have been looking around at the source code and your project looks very interesting.

i want plot a x (Logarithmic)-y(Linear) plot ,below is my code

var model = new PlotModel("LogPlotTest");
model.Axes.Add(new LinearAxis(AxisPosition.left, "Depth") {  MinorGridlineStyle = LineStyle.Solid);
model.Axes.Add(new LogarithmicAxis(AxisPosition.bottom, "Rs") {MinorGridlineStyle = LineStyle.Solid});
var data = new LineSeries();
for (double j = 0.1; j < 500;j=j+0.5 )
{
double t = Math.Log10(Math.Pow(j,2));
}
this.DataContext = model;

if i set new LinearAxis(AxisPosition.bottem) and LogarithmicAxis(AxisPosition.left),

it can plot perfect as i want to do;

but if i set

model.Axes.Add(new LinearAxis(AxisPosition.left, "Depth") { MinorGridlineStyle = LineStyle.Solid);
model.Axes.Add(new LogarithmicAxis(AxisPosition.bottom, "Rs") {MinorGridlineStyle = LineStyle.Solid});

i get wrong plot effect?

thanks

objo wrote at 2012-04-18 20:03:

I am not sure if I understand the problem - are your coordinates switched? The bottom/top axis will be used for the x coordinate, and the left/right axis will be used for the y coordinate of your data points.

ps. your series can also be expressed as a

```FunctionSeries(x=>Math.Log10(Math.Pow(x,2)),0.1,500,0.5)
```

procodemyth wrote at 2012-04-19 02:22: