How do we plot the graph with non available values in x axis.
6 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
I am having an array
2-10
3--
4-20
5--
6-30
7--
8-40
When i plot the graph by using the command
set(gca,'Xdir','reverse','xtick',(8:2:2),'xlim',[2 8]);
plot(set,'-ys')
I am getting the graph with square in 8,6,4,2,as it has values.how to get the square in intermediate places 7,5,3 which has no values.
0 Commenti
Risposte (1)
dpb
il 31 Ott 2018
Modificato: dpb
il 31 Ott 2018
There's no way the code posted will do what you say; it has fatal syntax error both lines--in the first the 'XTick' vector must be specified as (2:2:8) as it is required for tick values to be increasing when set irregardless of the sense of the direction named parameter; it does the reversal internally. As written (8:2:2) it's a silent error but turns the ticks off because with a positive increment but the end value less than start, it returns an empty array.
plot(set,'-ys')
fails because there's no argument to the set function.
As to the original question, you'll have to interpolate or otherwise find and plot values for the other X locations to place a square there or it would be possible with some additional effort to use text or annotation to add the markers where wanted independently of the plotted data.
0 Commenti
Vedere anche
Categorie
Scopri di più su Line 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!