I plot data using plotyy, then after adding several other data series to the plot, i need to readjust the axis limits to have them all in range, but when I do, the limits only occupy a small portion of the plot as seen in the image
1 view (last 30 days)
The image below shows the problem that I am getting. When i submit the code to change the axis limit for x, there is no issue with the graph, but when i send the code to adjust the left y axis, it shrinks the size as shown below. The data is in the range, but it does not get spread out amongst the full plot area. Any ideas?
Heres the code I use to adjust the axis:
%Plot both axis's
[hax, h(1,i), h(2,i)] = plotyy(X_Data(:,i), Y1_Data(:,i), X_Data(:,i), Y2_Data(:,i));
%Set line color and marker
set(h(1,i), 'marker', 'o');
set(h(1,i), 'color', ColorSet(i,:));
set(h(2,i), 'marker', 'x');
set(h(2,i), 'color', ColorSet((ColorVariation - i),:));
%Set axis limits
xlim(hax(1), [xmin xmax])
xlim(hax(2), [xmin xmax])
ylim(hax(1), [y1min y1max])
After running this initial data, I add additional plots to the same one to have for example 5 lines corresponding to the left y axis and the right y axis. But I need to be able to adjust the limits to see the data accordingly. Thanks!