I want to plot multiple line graph but I want two to be on a log x scale and two to be on the normal x scale. Please help.

1 view (last 30 days)
Here is my code:
x = 1:999999:1000000; y = [2.079E+06,2.079E+06];
Quad8_x=[6001
16501
24001
29349
];
Tria6_x=[12001
33001
48001
58697
];
Inventor_x=[708
8723
42375
598818
];
Quad8_y=[6.735E+05
8.060E+05
8.474E+05
8.665E+05
];
Tria6_y=[6.754E+05
8.088E+05
8.505E+05
8.699E+05
];
Inventor_y=[9.874E+05
1.041E+06
1.213E+06
1.735E+06
];
figure
semilogx(x,y,':k');
hold on
plot(Quad8_x,Quad8_y,'k-o'); %this needs to be on normal scale
hold on
plot(Tria6_x,Tria6_y,'b-.*');%this needs to be on normal scale
hold on
semilogx(Inventor_x,Inventor_y, 'r--x');
hold off
xlabel('Log of no. of elements','FontSize',14)
ylabel('Maximum Stress [Pa]','FontSize',14)
legend('Analytical Solution','Quad8','Tria6','Inventor','Location','southwest')

Answers (0)

Categories

Find more on Graphics Object Identification in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!