MATLAB: Change the Yaxis to dashed line dashedyaxis Hello, I am trying to plot 1 figure with 2 Yaxis. I want one of the Yaxis is dashed. How can I do this? Thanks! Best Answer Try this:% Plot something.h = plot(sind(1:1000));ax = gca % Get handle to current axes object.xl = xlim(); % Find out x location of the y axis.% Cover up existing axis with a white line.line([xl(1), xl(1)], ylim, 'color', 'w', 'LineWidth', 2);% Draw a dashed line on top of the white line.line([xl(1), xl(1)], ylim, 'color', 'k', 'LineStyle', '--'); Related SolutionsMATLAB: Dashed line imrect of imline Something like this would help you make a dashed line using imline .h = imline();h1 = get(h,'Children');set(h1(3),'LineStyle','--');set(h1(4),'LineStyle','--'); MATLAB: Voronoi Diagram in Dashed Lines Try to grab only handles of voronoi linesset(h(2:end),'linestyle','--') Related QuestionDeletting X and Y axes ticksChanging grid lines to a solid line instead of dashed
Best Answer