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

Oystein Bjorke 10 jaar geleden 0
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));
                data.Points.Add(new DataPoint(j,t));
            }
model.Series.Add(data);
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?

please help me:

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:


very thanks your reply 

The default bottom/top axis must be the x coordinate and the default left/right axis must be the y coordinate for  datapoint(x,y)?

for my datapoint(x,y), i want to plot x in left/right axis and y in bottom/top axis, but the plot is not the some as x in bottom and y in left  ,then RotateTransform 90.