plotting an open circle (open interval) in plot
56 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
i am plotting a function f =@(x) x.^2 but i want to put open circles at x = 0 and x = 4 because they are undefined at those points. How do i put the open circles?
I am using fplot(f, [0,2])
Risposte (1)
Image Analyst
il 27 Mag 2020
Try this:
% Create data.
x = linspace(0, 4, 1000);
y = x .^ 2;
% Plot the quadratic curve.
plot(x, y, 'b-', 'LineWidth', 2); % Plot line.
hold on; % Don't let circles blow away the line.
plot([x(1), x(end)], [y(1), y(end)], 'ro', 'MarkerSize', 15, 'LineWidth', 2);
grid on;
xlabel('X', 'FontSize', 15);
ylabel('Y', 'FontSize', 15);
Adjust MarkerSize and LineWidth as desired.
0 Commenti
Vedere anche
Categorie
Scopri di più su 2-D and 3-D Plots in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!