How to re-scale the Axises when exporting "Values" from binscatter ??
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Sergii Snegir
am 27 Feb. 2021
Bearbeitet: Sergii Snegir
am 1 Mär. 2021
I am using the h= binscatter(x,y,N) with N=250 to plot my data (figure 1 below). After I created it I extract counts=h.Values to plot the contour(counts) - (figure 2 below).. Thus, I have a question. How to rescale my Axises in contour plot (figure 2) to have the same values as on Figure 1????
Many thanks
Figure 1:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/533714/image.png)
Figure 2 ([M,h]=contourf(counts,5);):
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/533719/image.png)
0 Kommentare
Akzeptierte Antwort
Matteo Pellegri
am 27 Feb. 2021
I'm not sure I understand the question. Have you tried this?
xlim([x1 x2])
ylim([y1 y2])
5 Kommentare
Matteo Pellegri
am 27 Feb. 2021
I understand now.
You can directly change it using
set(gca,'xtick',xmin:.1:xmax)
Alternatively you can create NxN matrices using meshgrid with the values you need and then plot using contourf
[X,Y] = meshgrid(linspace(xmin,xmax,250),linspace(ymin,ymax,250))
figure()
h = binscatter(x,y,N)
figure()
d=contourf(X,Y,h.Values)
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Contour Plots finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!