Hatchfill function not working

9 vues (au cours des 30 derniers jours)
Minas Emiris
Minas Emiris le 28 Avr 2020
Modifié(e) : DGM le 9 Août 2022
Hi all,
I just downloaded hatchfill to hatch the area under a histogram, as shown in: <LINK>. However, when running the script, I get the following error message:
Index exceeds the number of array elements (0).
Error in hatchfill (line 96)
hax = get(A(1),'parent');
Error in Hatching_Histograms (line 58)
hh1 = hatchfill(hPatch1, 'single', -45, 3);
Undefined function 'applyhatch_pluscolor' for input arguments of type 'matlab.ui.Figure'.
Error in Hatching_Histograms (line 80)
applyhatch_pluscolor(fH, '\-x.', 0, [1 0 1 0], jet(4));
And I am not sure how to fix it. I am attatching the function hatchfill and the code from the aforementioned link, which I have named 'Hatching_Histograms.m'.

Réponses (1)

DGM
DGM le 9 Août 2022
Modifié(e) : DGM le 9 Août 2022
Both hatchfill() and applyhatch_pluscolor have been unmaintained for a decade now and predate the current graphics system. If you want to use either, you will have to go through and rewrite them to be compatible. There are more recent alternatives, though I'm not familiar with them all. See this answer and the linked threads as a starting point.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by