I am plotting multiple plots on the same axes by using plot()
and hold(Ax, 'on')
function. However, I have noticed that if I use set(Ax, 'XData', ..., 'YData', ...)
for plotting instead of plot()
then the hold(Ax, 'on')
functionality does not work. In other words I am not able to plot all the curves together on same axes if I use set()
function. Any idea why is that, or if there is a way by which I can use set()
and yet use the hold on
functionality? Thanks!
相关问题
- Extract matrix elements using a vector of column i
- Plotting multiple columns with ggplot2 [duplicate]
- How do you get R's null and residual deviance
- R markov chain package, is possible to set the coo
- How to display an image represented by three matri
相关文章
- C#中 public virtual string Category { get; }这么写会报错:
- How to plot smoother curves in R
- How to add clipboard support to Matplotlib figures
- Adding a legend to a matplotlib boxplot with multi
- How do I append metadata to an image in Matlab?
- How can I write-protect the Matlab language?
- `std::sin` is wrong in the last bit
- Escape sequence to display apostrophe in MATLAB
Based on this answer, you can try something like the following example:
The
set
command updates the properties of the object referenced by the handle. If you don't want to modify your one curve over and over, but add curves, you have to copy the initial line object, usingcopyobj
. Once you do that, you can generate an infinite amount of additional lines for which you can then set the properties (including new'XData'
,'YData'
as you please.However, you will need an initial line object to copy and modify.
Also, depending on how you set up your plot, consider replacing
gca
by your axis handle so that the reference is correct.