alandefreitas / matplotplusplus

Matplot++: A C++ Graphics Library for Data Visualization 📊🗾
https://alandefreitas.github.io/matplotplusplus/
MIT License
4.34k stars 334 forks source link

Contourf + quiet mode = segfault; additionally, areas filled improperly #318

Open mkXla2135 opened 1 year ago

mkXla2135 commented 1 year ago

Bug category

Describe the bug

In the code below, five examples (replace input0(); with input1(); ... input4(); in main() to load the data for the other examples) demonstrate issues I had with the filed contour plots contourf. I presume that those issues might be related (or maybe they are not). Apart from that, I'd like to thank you for this excellent library - I was stunned when I stumbled upon the project :) Not having to export examples to a Matlab code to merely check them out there is tremendous help.

Example 0 (input0):
Images for example 0 ![img0F](https://user-images.githubusercontent.com/56190101/212282066-78705d1d-984b-4aa4-85bb-ac28808b2b4c.png) ![img0M](https://user-images.githubusercontent.com/56190101/212282106-8c715981-8c64-478e-9c6c-48153b12e2b1.png)
Example 1 (input1):
Images for example 1 ![img1](https://user-images.githubusercontent.com/56190101/212285887-89ee470b-217f-4644-a205-a3bcbbbd9fc8.png) ![img1M](https://user-images.githubusercontent.com/56190101/212285908-8b0696eb-bba7-43ec-bebe-603cdf72a751.png)
Example 2 (input2):
Images for example 2 ![img2](https://user-images.githubusercontent.com/56190101/212287326-b753ca34-f27a-4cf8-8661-7b7e44be13a3.png) ![img2M](https://user-images.githubusercontent.com/56190101/212287345-6ff51137-1f48-4bc3-826c-99fc7a67a443.png)
Example 3 (input3):
Images for example 3 ![img3](https://user-images.githubusercontent.com/56190101/212289362-492b0162-430d-4e7e-a9ef-f37e4e753687.png) ![img3M](https://user-images.githubusercontent.com/56190101/212289432-43b7e7e9-7f7e-4d18-a625-5a93e99ad634.png)
Example 4 (input4):
Image for example 4 ![img4](https://user-images.githubusercontent.com/56190101/212289951-738887b5-6dd8-4d6d-b1cc-48c14e7a0130.png)
Additional notes

Steps to Reproduce

Source code and data: ```cpp #include #include std::vector< std::vector > X,Y,Z; void input0(){ X={ {0, 0.666667, 1.33333, 2}, {0, 0.471405, 0.942809, 1.41421}, {0, 4.08216e-17, 8.16431e-17, 1.22465e-16}, {-0, -0.471405, -0.942809, -1.41421}, {-0, -0.666667, -1.33333, -2}, {-0, -0.666667, -1.33333, -2}, {-0, -0.471405, -0.942809, -1.41421}, {-0, -4.08216e-17, -8.16431e-17, -1.22465e-16}, {0, 0.471405, 0.942809, 1.41421}, {0, 0.666667, 1.33333, 2}, }; Y={ {0, 0, 0, 0}, {0, 0.471405, 0.942809, 1.41421}, {0, 0.666667, 1.33333, 2}, {0, 0.471405, 0.942809, 1.41421}, {0, 8.16431e-17, 1.63286e-16, 2.44929e-16}, {-0, -0, -0, -0}, {-0, -0.471405, -0.942809, -1.41421}, {-0, -0.666667, -1.33333, -2}, {-0, -0.471405, -0.942809, -1.41421}, {-0, -8.16431e-17, -1.63286e-16, -2.44929e-16}, }; Z={ {-0.806291, 0.109974, 0.00975164, 1.56284e-07}, {-0.806291, -0.413175, 0.0112942, 1.74055e-07}, {-0.806291, 0.602772, 0.0195515, 2.30858e-07}, {-0.806291, 1.52672, 0.028121, 2.89551e-07}, {-0.806291, 0.911565, 0.0299758, 3.09213e-07}, {-0.806291, 0.911565, 0.0299758, 3.09213e-07}, {-0.806291, 1.52672, 0.028121, 2.89551e-07}, {-0.806291, 0.602772, 0.0195515, 2.30858e-07}, {-0.806291, -0.413175, 0.0112942, 1.74055e-07}, {-0.806291, 0.109974, 0.00975164, 1.56284e-07}, }; } void input1(){ X={ {-2, -0.666667, 0.666667, 2}, {-2, -0.666667, 0.666667, 2}, {-2, -0.666667, 0.666667, 2}, {-2, -0.666667, 0.666667, 2}, {-2, -0.666667, 0.666667, 2}, {-2, -0.666667, 0.666667, 2}, {-2, -0.666667, 0.666667, 2}, {-2, -0.666667, 0.666667, 2}, {-2, -0.666667, 0.666667, 2}, {-2, -0.666667, 0.666667, 2}, {-2, -0.666667, 0.666667, 2}, }; Y={ {-2, -2, -2, -2}, {-1.6, -1.6, -1.6, -1.6}, {-1.2, -1.2, -1.2, -1.2}, {-0.8, -0.8, -0.8, -0.8}, {-0.4, -0.4, -0.4, -0.4}, {0, 0, 0, 0}, {0.4, 0.4, 0.4, 0.4}, {0.8, 0.8, 0.8, 0.8}, {1.2, 1.2, 1.2, 1.2}, {1.6, 1.6, 1.6, 1.6}, {2, 2, 2, 2}, }; Z={ {2.39185e-09, 0.00276597, 0.00313371, 2.49509e-09}, {1.14939e-06, -0.000477293, 0.0292385, 1.21027e-06}, {7.41466e-05, 0.0886575, -0.116372, 8.19955e-05}, {0.000842403, -0.163246, 0.857009, 0.00115847}, {0.0026183, 0.855871, 0.829974, 0.00590244}, {0.00354349, 1.16218, 1.1377, 0.0109249}, {0.0026183, 0.855871, 0.829974, 0.00590244}, {0.000842403, -0.163246, 0.857009, 0.00115847}, {7.41466e-05, 0.0886575, -0.116372, 8.19955e-05}, {1.14939e-06, -0.000477293, 0.0292385, 1.21027e-06}, {2.39185e-09, 0.00276597, 0.00313371, 2.49509e-09}, }; } void input2(){ X={ {-1.7, -1.13333, -0.566667, 0, 0.566667, 1.13333, 1.7}, {-1.7, -1.13333, -0.566667, 0, 0.566667, 1.13333, 1.7}, {-1.7, -1.13333, -0.566667, 0, 0.566667, 1.13333, 1.7}, {-1.7, -1.13333, -0.566667, 0, 0.566667, 1.13333, 1.7}, {-1.7, -1.13333, -0.566667, 0, 0.566667, 1.13333, 1.7}, {-1.7, -1.13333, -0.566667, 0, 0.566667, 1.13333, 1.7}, {-1.7, -1.13333, -0.566667, 0, 0.566667, 1.13333, 1.7}, {-1.7, -1.13333, -0.566667, 0, 0.566667, 1.13333, 1.7}, {-1.7, -1.13333, -0.566667, 0, 0.566667, 1.13333, 1.7}, {-1.7, -1.13333, -0.566667, 0, 0.566667, 1.13333, 1.7}, {-1.7, -1.13333, -0.566667, 0, 0.566667, 1.13333, 1.7}, }; Y={ {-1.7, -1.7, -1.7, -1.7, -1.7, -1.7, -1.7}, {-1.36, -1.36, -1.36, -1.36, -1.36, -1.36, -1.36}, {-1.02, -1.02, -1.02, -1.02, -1.02, -1.02, -1.02}, {-0.68, -0.68, -0.68, -0.68, -0.68, -0.68, -0.68}, {-0.34, -0.34, -0.34, -0.34, -0.34, -0.34, -0.34}, {0, 0, 0, 0, 0, 0, 0}, {0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34}, {0.68, 0.68, 0.68, 0.68, 0.68, 0.68, 0.68}, {1.02, 1.02, 1.02, 1.02, 1.02, 1.02, 1.02}, {1.36, 1.36, 1.36, 1.36, 1.36, 1.36, 1.36}, {1.7, 1.7, 1.7, 1.7, 1.7, 1.7, 1.7}, }; Z={ {2.47695e-05, 0.00347924, 0.0159238, 0.111652, 0.0425439, 0.00328751, 2.45727e-05}, {0.000702989, -0.000339059, -0.0441639, 0.400753, 0.042592, -0.00320279, 0.000646919}, {0.00421222, -0.00897225, -0.0292202, 1.01869, 0.400494, 0.100793, 0.00329369}, {0.00947364, -0.0427793, 0.262785, 1.1254, 1.25067, -0.131926, 0.00828156}, {0.0185485, -0.00292027, 1.21314, 1.0483, 0.332686, 0.473086, 0.054183}, {0.0252676, 0.757398, 1.30105, 0.840936, 1.16737, 1.09964, 0.11956}, {0.0185485, -0.00292027, 1.21314, 1.0483, 0.332686, 0.473086, 0.054183}, {0.00947364, -0.0427793, 0.262785, 1.1254, 1.25067, -0.131926, 0.00828156}, {0.00421222, -0.00897225, -0.0292202, 1.01869, 0.400494, 0.100793, 0.00329369}, {0.000702989, -0.000339059, -0.0441639, 0.400753, 0.042592, -0.00320279, 0.000646919}, {2.47695e-05, 0.00347924, 0.0159238, 0.111652, 0.0425439, 0.00328751, 2.45727e-05}, }; } void input3(){ X={ {0, 1.66667, 3.33333, 5, 6.66667, 8.33333, 10}, {0, 1.58509, 3.17019, 4.75528, 6.34038, 7.92547, 9.51057}, {0, 1.34836, 2.69672, 4.04508, 5.39345, 6.74181, 8.09017}, {0, 0.979642, 1.95928, 2.93893, 3.91857, 4.89821, 5.87785}, {0, 0.515028, 1.03006, 1.54508, 2.06011, 2.57514, 3.09017}, {0, 1.02054e-16, 2.04108e-16, 3.06162e-16, 4.08216e-16, 5.10269e-16, 6.12323e-16}, {-0, -0.515028, -1.03006, -1.54508, -2.06011, -2.57514, -3.09017}, {-0, -0.979642, -1.95928, -2.93893, -3.91857, -4.89821, -5.87785}, {-0, -1.34836, -2.69672, -4.04508, -5.39345, -6.74181, -8.09017}, {-0, -1.58509, -3.17019, -4.75528, -6.34038, -7.92547, -9.51057}, {-0, -1.66667, -3.33333, -5, -6.66667, -8.33333, -10}, {-0, -1.66667, -3.33333, -5, -6.66667, -8.33333, -10}, {-0, -1.58509, -3.17019, -4.75528, -6.34038, -7.92547, -9.51057}, {-0, -1.34836, -2.69672, -4.04508, -5.39345, -6.74181, -8.09017}, {-0, -0.979642, -1.95928, -2.93893, -3.91857, -4.89821, -5.87785}, {-0, -0.515028, -1.03006, -1.54508, -2.06011, -2.57514, -3.09017}, {-0, -1.02054e-16, -2.04108e-16, -3.06162e-16, -4.08216e-16, -5.10269e-16, -6.12323e-16}, {0, 0.515028, 1.03006, 1.54508, 2.06011, 2.57514, 3.09017}, {0, 0.979642, 1.95928, 2.93893, 3.91857, 4.89821, 5.87785}, {0, 1.34836, 2.69672, 4.04508, 5.39345, 6.74181, 8.09017}, {0, 1.58509, 3.17019, 4.75528, 6.34038, 7.92547, 9.51057}, {0, 1.66667, 3.33333, 5, 6.66667, 8.33333, 10}, }; Y={ {0, 0, 0, 0, 0, 0, 0}, {0, 0.515028, 1.03006, 1.54508, 2.06011, 2.57514, 3.09017}, {0, 0.979642, 1.95928, 2.93893, 3.91857, 4.89821, 5.87785}, {0, 1.34836, 2.69672, 4.04508, 5.39345, 6.74181, 8.09017}, {0, 1.58509, 3.17019, 4.75528, 6.34038, 7.92547, 9.51057}, {0, 1.66667, 3.33333, 5, 6.66667, 8.33333, 10}, {0, 1.58509, 3.17019, 4.75528, 6.34038, 7.92547, 9.51057}, {0, 1.34836, 2.69672, 4.04508, 5.39345, 6.74181, 8.09017}, {0, 0.979642, 1.95928, 2.93893, 3.91857, 4.89821, 5.87785}, {0, 0.515028, 1.03006, 1.54508, 2.06011, 2.57514, 3.09017}, {0, 2.04108e-16, 4.08216e-16, 6.12323e-16, 8.16431e-16, 1.02054e-15, 1.22465e-15}, {-0, -0, -0, -0, -0, -0, -0}, {-0, -0.515028, -1.03006, -1.54508, -2.06011, -2.57514, -3.09017}, {-0, -0.979642, -1.95928, -2.93893, -3.91857, -4.89821, -5.87785}, {-0, -1.34836, -2.69672, -4.04508, -5.39345, -6.74181, -8.09017}, {-0, -1.58509, -3.17019, -4.75528, -6.34038, -7.92547, -9.51057}, {-0, -1.66667, -3.33333, -5, -6.66667, -8.33333, -10}, {-0, -1.58509, -3.17019, -4.75528, -6.34038, -7.92547, -9.51057}, {-0, -1.34836, -2.69672, -4.04508, -5.39345, -6.74181, -8.09017}, {-0, -0.979642, -1.95928, -2.93893, -3.91857, -4.89821, -5.87785}, {-0, -0.515028, -1.03006, -1.54508, -2.06011, -2.57514, -3.09017}, {-0, -2.04108e-16, -4.08216e-16, -6.12323e-16, -8.16431e-16, -1.02054e-15, -1.22465e-15}, }; Z={ {-0.806291, 9.5359e-05, 1.72896e-25, 2.75652e-62, 1.4149e-114, 3.34493e-182, 4.24539e-265}, {-0.806291, 9.71048e-05, 1.74691e-25, 2.77522e-62, 1.42198e-114, 3.35818e-182, 4.25929e-265}, {-0.806291, 0.000103195, 1.8006e-25, 2.83019e-62, 1.44269e-114, 3.39683e-182, 4.29978e-265}, {-0.806291, 0.000115283, 1.88834e-25, 2.91769e-62, 1.47537e-114, 3.45753e-182, 4.36324e-265}, {-0.806291, 0.00013386, 2.00433e-25, 3.03048e-62, 1.51711e-114, 3.53475e-182, 4.44375e-265}, {-0.806291, 0.000156898, 2.13719e-25, 3.15761e-62, 1.56387e-114, 3.62099e-182, 4.53353e-265}, {-0.806291, 0.000180277, 2.2713e-25, 3.28557e-62, 1.61087e-114, 3.70758e-182, 4.6236e-265}, {-0.806291, 0.000199744, 2.39057e-25, 3.40054e-62, 1.65322e-114, 3.7857e-182, 4.7049e-265}, {-0.806291, 0.000212931, 2.48237e-25, 3.49073e-62, 1.68665e-114, 3.84752e-182, 4.76933e-265}, {-0.806291, 0.000219911, 2.53935e-25, 3.54788e-62, 1.70797e-114, 3.88706e-182, 4.81061e-265}, {-0.806291, 0.000221996, 2.55856e-25, 3.56741e-62, 1.71529e-114, 3.90066e-182, 4.82481e-265}, {-0.806291, 0.000221996, 2.55856e-25, 3.56741e-62, 1.71529e-114, 3.90066e-182, 4.82481e-265}, {-0.806291, 0.000219911, 2.53935e-25, 3.54788e-62, 1.70797e-114, 3.88706e-182, 4.81061e-265}, {-0.806291, 0.000212931, 2.48237e-25, 3.49073e-62, 1.68665e-114, 3.84752e-182, 4.76933e-265}, {-0.806291, 0.000199744, 2.39057e-25, 3.40054e-62, 1.65322e-114, 3.7857e-182, 4.7049e-265}, {-0.806291, 0.000180277, 2.2713e-25, 3.28557e-62, 1.61087e-114, 3.70758e-182, 4.6236e-265}, {-0.806291, 0.000156898, 2.13719e-25, 3.15761e-62, 1.56387e-114, 3.62099e-182, 4.53353e-265}, {-0.806291, 0.00013386, 2.00433e-25, 3.03048e-62, 1.51711e-114, 3.53475e-182, 4.44375e-265}, {-0.806291, 0.000115283, 1.88834e-25, 2.91769e-62, 1.47537e-114, 3.45753e-182, 4.36324e-265}, {-0.806291, 0.000103195, 1.8006e-25, 2.83019e-62, 1.44269e-114, 3.39683e-182, 4.29978e-265}, {-0.806291, 9.71048e-05, 1.74691e-25, 2.77522e-62, 1.42198e-114, 3.35818e-182, 4.25929e-265}, {-0.806291, 9.5359e-05, 1.72896e-25, 2.75652e-62, 1.4149e-114, 3.34493e-182, 4.24539e-265}, }; } void input4(){ X={ {0, 1.66667, 3.33333, 5, 6.66667, 8.33333, 10}, {0, 1.58509, 3.17019, 4.75528, 6.34038, 7.92547, 9.51057}, {0, 1.34836, 2.69672, 4.04508, 5.39345, 6.74181, 8.09017}, {0, 0.979642, 1.95928, 2.93893, 3.91857, 4.89821, 5.87785}, {0, 0.515028, 1.03006, 1.54508, 2.06011, 2.57514, 3.09017}, {0, 1.02054e-16, 2.04108e-16, 3.06162e-16, 4.08216e-16, 5.10269e-16, 6.12323e-16}, {-0, -0.515028, -1.03006, -1.54508, -2.06011, -2.57514, -3.09017}, {-0, -0.979642, -1.95928, -2.93893, -3.91857, -4.89821, -5.87785}, {-0, -1.34836, -2.69672, -4.04508, -5.39345, -6.74181, -8.09017}, {-0, -1.58509, -3.17019, -4.75528, -6.34038, -7.92547, -9.51057}, {-0, -1.66667, -3.33333, -5, -6.66667, -8.33333, -10}, {-0, -1.66667, -3.33333, -5, -6.66667, -8.33333, -10}, {-0, -1.58509, -3.17019, -4.75528, -6.34038, -7.92547, -9.51057}, {-0, -1.34836, -2.69672, -4.04508, -5.39345, -6.74181, -8.09017}, {-0, -0.979642, -1.95928, -2.93893, -3.91857, -4.89821, -5.87785}, {-0, -0.515028, -1.03006, -1.54508, -2.06011, -2.57514, -3.09017}, {-0, -1.02054e-16, -2.04108e-16, -3.06162e-16, -4.08216e-16, -5.10269e-16, -6.12323e-16}, {0, 0.515028, 1.03006, 1.54508, 2.06011, 2.57514, 3.09017}, {0, 0.979642, 1.95928, 2.93893, 3.91857, 4.89821, 5.87785}, {0, 1.34836, 2.69672, 4.04508, 5.39345, 6.74181, 8.09017}, {0, 1.58509, 3.17019, 4.75528, 6.34038, 7.92547, 9.51057}, {0, 1.66667, 3.33333, 5, 6.66667, 8.33333, 10}, {0, 1.58509, 3.17019, 4.75528, 6.34038, 7.92547, 9.51057}, }; Y={ {0, 0, 0, 0, 0, 0, 0}, {0, 0.515028, 1.03006, 1.54508, 2.06011, 2.57514, 3.09017}, {0, 0.979642, 1.95928, 2.93893, 3.91857, 4.89821, 5.87785}, {0, 1.34836, 2.69672, 4.04508, 5.39345, 6.74181, 8.09017}, {0, 1.58509, 3.17019, 4.75528, 6.34038, 7.92547, 9.51057}, {0, 1.66667, 3.33333, 5, 6.66667, 8.33333, 10}, {0, 1.58509, 3.17019, 4.75528, 6.34038, 7.92547, 9.51057}, {0, 1.34836, 2.69672, 4.04508, 5.39345, 6.74181, 8.09017}, {0, 0.979642, 1.95928, 2.93893, 3.91857, 4.89821, 5.87785}, {0, 0.515028, 1.03006, 1.54508, 2.06011, 2.57514, 3.09017}, {0, 2.04108e-16, 4.08216e-16, 6.12323e-16, 8.16431e-16, 1.02054e-15, 1.22465e-15}, {-0, -0, -0, -0, -0, -0, -0}, {-0, -0.515028, -1.03006, -1.54508, -2.06011, -2.57514, -3.09017}, {-0, -0.979642, -1.95928, -2.93893, -3.91857, -4.89821, -5.87785}, {-0, -1.34836, -2.69672, -4.04508, -5.39345, -6.74181, -8.09017}, {-0, -1.58509, -3.17019, -4.75528, -6.34038, -7.92547, -9.51057}, {-0, -1.66667, -3.33333, -5, -6.66667, -8.33333, -10}, {-0, -1.58509, -3.17019, -4.75528, -6.34038, -7.92547, -9.51057}, {-0, -1.34836, -2.69672, -4.04508, -5.39345, -6.74181, -8.09017}, {-0, -0.979642, -1.95928, -2.93893, -3.91857, -4.89821, -5.87785}, {-0, -0.515028, -1.03006, -1.54508, -2.06011, -2.57514, -3.09017}, {-0, -2.04108e-16, -4.08216e-16, -6.12323e-16, -8.16431e-16, -1.02054e-15, -1.22465e-15}, {0, 0.515028, 1.03006, 1.54508, 2.06011, 2.57514, 3.09017}, }; Z={ {-0.806291, 9.5359e-05, 1.72896e-25, 2.75652e-62, 1.4149e-114, 3.34493e-182, 4.24539e-265}, {-0.806291, 9.71048e-05, 1.74691e-25, 2.77522e-62, 1.42198e-114, 3.35818e-182, 4.25929e-265}, {-0.806291, 0.000103195, 1.8006e-25, 2.83019e-62, 1.44269e-114, 3.39683e-182, 4.29978e-265}, {-0.806291, 0.000115283, 1.88834e-25, 2.91769e-62, 1.47537e-114, 3.45753e-182, 4.36324e-265}, {-0.806291, 0.00013386, 2.00433e-25, 3.03048e-62, 1.51711e-114, 3.53475e-182, 4.44375e-265}, {-0.806291, 0.000156898, 2.13719e-25, 3.15761e-62, 1.56387e-114, 3.62099e-182, 4.53353e-265}, {-0.806291, 0.000180277, 2.2713e-25, 3.28557e-62, 1.61087e-114, 3.70758e-182, 4.6236e-265}, {-0.806291, 0.000199744, 2.39057e-25, 3.40054e-62, 1.65322e-114, 3.7857e-182, 4.7049e-265}, {-0.806291, 0.000212931, 2.48237e-25, 3.49073e-62, 1.68665e-114, 3.84752e-182, 4.76933e-265}, {-0.806291, 0.000219911, 2.53935e-25, 3.54788e-62, 1.70797e-114, 3.88706e-182, 4.81061e-265}, {-0.806291, 0.000221996, 2.55856e-25, 3.56741e-62, 1.71529e-114, 3.90066e-182, 4.82481e-265}, {-0.806291, 0.000221996, 2.55856e-25, 3.56741e-62, 1.71529e-114, 3.90066e-182, 4.82481e-265}, {-0.806291, 0.000219911, 2.53935e-25, 3.54788e-62, 1.70797e-114, 3.88706e-182, 4.81061e-265}, {-0.806291, 0.000212931, 2.48237e-25, 3.49073e-62, 1.68665e-114, 3.84752e-182, 4.76933e-265}, {-0.806291, 0.000199744, 2.39057e-25, 3.40054e-62, 1.65322e-114, 3.7857e-182, 4.7049e-265}, {-0.806291, 0.000180277, 2.2713e-25, 3.28557e-62, 1.61087e-114, 3.70758e-182, 4.6236e-265}, {-0.806291, 0.000156898, 2.13719e-25, 3.15761e-62, 1.56387e-114, 3.62099e-182, 4.53353e-265}, {-0.806291, 0.00013386, 2.00433e-25, 3.03048e-62, 1.51711e-114, 3.53475e-182, 4.44375e-265}, {-0.806291, 0.000115283, 1.88834e-25, 2.91769e-62, 1.47537e-114, 3.45753e-182, 4.36324e-265}, {-0.806291, 0.000103195, 1.8006e-25, 2.83019e-62, 1.44269e-114, 3.39683e-182, 4.29978e-265}, {-0.806291, 9.71048e-05, 1.74691e-25, 2.77522e-62, 1.42198e-114, 3.35818e-182, 4.25929e-265}, {-0.806291, 9.5359e-05, 1.72896e-25, 2.75652e-62, 1.4149e-114, 3.34493e-182, 4.24539e-265}, {-0.806291, 9.71048e-05, 1.74691e-25, 2.77522e-62, 1.42198e-114, 3.35818e-182, 4.25929e-265}, }; } int main() { using namespace matplot; input0(); auto f = figure(true); auto ax = f->current_axes(); ax->contourf(X,Y,Z); f->draw(); //contourf(X,Y,Z); show(); return 0; } ```

Building:

g++ -g -o out prog.cpp  -lmatplot  && ./out 

Output

Segmentation fault (core dumped)
GNU gdb (Ubuntu 12.1-3ubuntu2) 12.1 output ```bash gdb out ``` ``` [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". [Detaching after vfork from child process 11148] [Detaching after vfork from child process 11150] [Detaching after vfork from child process 11151] Program received signal SIGSEGV, Segmentation fault. 0x00007ffff75b33d1 in matplot::contours::is_lower_level(unsigned long, unsigned long, unsigned long) () from /usr/local/lib/libmatplot.so (gdb) backtrace #0 0x00007ffff75b33d1 in matplot::contours::is_lower_level(unsigned long, unsigned long, unsigned long) () from /usr/local/lib/libmatplot.so #1 0x00007ffff75bee45 in matplot::contours::plot_string[abi:cxx11]() () from /usr/local/lib/libmatplot.so #2 0x00007ffff74ade2f in matplot::axes_type::run_plot_objects_command() () from /usr/local/lib/libmatplot.so #3 0x00007ffff74e4c59 in matplot::figure_type::send_gnuplot_draw_commands() () from /usr/local/lib/libmatplot.so #4 0x00007ffff74e5315 in matplot::figure_type::draw() () from /usr/local/lib/libmatplot.so #5 0x0000555555557b18 in main () at prog.cpp:14 (gdb) ```

valgrind output (if that's of any help):

valgrind --leak-check=full --show-leak-kinds=all -s ./out

Output: https://pastebin.com/TeQxuWv0

Platform

Environment Details: