# Visualisasi dengan Matplotlib & Seaborn (Data Science & ML) > Figures, axes, subplots, line plots, scatter plots, histogram, heatmaps, styling, kustomisasi - 20 pertanyaan wawancara - Mid-Level - [Pertanyaan Wawancara: Data Science & ML](https://sharpskill.dev/id/technologies/data-science/pertanyaan-wawancara.md) ## 1. Apa perbedaan utama antara antarmuka pyplot dan antarmuka berorientasi objek di Matplotlib? **Jawaban** Antarmuka pyplot (plt.plot, plt.title) adalah API gaya MATLAB yang secara implisit mengelola figures dan axes saat ini, nyaman untuk plot sederhana yang cepat. Antarmuka berorientasi objek (fig, ax = plt.subplots()) memberikan kontrol eksplisit atas setiap elemen (Figure, Axes) dan direkomendasikan untuk plot kompleks, multiple subplots, atau script produksi, karena membuat kode lebih mudah dibaca dan dipelihara. ## 2. Metode mana yang harus digunakan untuk membuat figure dengan grid 2 baris dan 3 kolom subplots? **Jawaban** Fungsi plt.subplots(2, 3) membuat figure yang berisi grid 2 baris dan 3 kolom subplots. Mengembalikan tuple (fig, axes) di mana axes adalah array NumPy 2D dengan shape (2, 3) yang memungkinkan akses ke setiap subplot melalui axes[row, col]. Pendekatan ini adalah cara paling ringkas dan idiomatis untuk membuat grid subplots reguler di Matplotlib. ## 3. Bagaimana menampilkan heatmap korelasi dari Pandas DataFrame dengan Seaborn? **Jawaban** Untuk menampilkan heatmap korelasi, hitung dulu matriks korelasi dengan df.corr(), lalu teruskan hasilnya ke sns.heatmap(). Opsi annot=True menampilkan nilai korelasi di setiap cell, membuatnya lebih mudah dibaca. Kombinasi ini adalah pola standar untuk memvisualisasikan korelasi antar variabel numerik dalam analisis data eksplorasi. ## 17 pertanyaan lagi tersedia - Apa peran parameter 'bins' dalam plt.hist()? - Bagaimana berbagi sumbu Y antara beberapa subplots dalam baris yang sama? Daftar gratis: https://sharpskill.dev/id/login ## Topik wawancara Data Science & ML lainnya - [Dasar-dasar Python](https://sharpskill.dev/id/technologies/data-science/pertanyaan-wawancara/python-basics.md): 25 pertanyaan, Junior - [Pemrograman Berorientasi Objek Python](https://sharpskill.dev/id/technologies/data-science/pertanyaan-wawancara/python-oop.md): 20 pertanyaan, Junior - [Struktur Data Python](https://sharpskill.dev/id/technologies/data-science/pertanyaan-wawancara/python-data-structures.md): 20 pertanyaan, Junior - [Dasar-Dasar Git](https://sharpskill.dev/id/technologies/data-science/pertanyaan-wawancara/git-fundamentals.md): 18 pertanyaan, Junior - [Dasar-dasar SQL](https://sharpskill.dev/id/technologies/data-science/pertanyaan-wawancara/sql-basics.md): 20 pertanyaan, Junior - [Dasar-Dasar NumPy](https://sharpskill.dev/id/technologies/data-science/pertanyaan-wawancara/numpy-fundamentals.md): 22 pertanyaan, Junior - [Dasar-dasar Pandas](https://sharpskill.dev/id/technologies/data-science/pertanyaan-wawancara/pandas-basics.md): 22 pertanyaan, Junior - [Jupyter & Google Colab](https://sharpskill.dev/id/technologies/data-science/pertanyaan-wawancara/jupyter-colab.md): 16 pertanyaan, Junior - [SQL Joins & Kueri Lanjutan](https://sharpskill.dev/id/technologies/data-science/pertanyaan-wawancara/sql-joins-advanced.md): 22 pertanyaan, Mid-Level - [Pandas Lanjutan](https://sharpskill.dev/id/technologies/data-science/pertanyaan-wawancara/pandas-advanced.md): 24 pertanyaan, Mid-Level - [Visualisasi Interaktif dengan Plotly](https://sharpskill.dev/id/technologies/data-science/pertanyaan-wawancara/plotly-interactive.md): 18 pertanyaan, Mid-Level - [Statistik Deskriptif](https://sharpskill.dev/id/technologies/data-science/pertanyaan-wawancara/statistics-descriptive.md): 20 pertanyaan, Mid-Level - [Statistik Inferensial](https://sharpskill.dev/id/technologies/data-science/pertanyaan-wawancara/statistics-inferential.md): 24 pertanyaan, Mid-Level - [Web Scraping](https://sharpskill.dev/id/technologies/data-science/pertanyaan-wawancara/web-scraping.md): 18 pertanyaan, Mid-Level - [BigQuery & Cloud Data](https://sharpskill.dev/id/technologies/data-science/pertanyaan-wawancara/bigquery-cloud.md): 18 pertanyaan, Mid-Level - [Feature Engineering](https://sharpskill.dev/id/technologies/data-science/pertanyaan-wawancara/feature-engineering.md): 22 pertanyaan, Mid-Level - [ML Terbimbing: Regresi](https://sharpskill.dev/id/technologies/data-science/pertanyaan-wawancara/ml-supervised-regression.md): 24 pertanyaan, Mid-Level - [ML Terbimbing: Klasifikasi](https://sharpskill.dev/id/technologies/data-science/pertanyaan-wawancara/ml-supervised-classification.md): 24 pertanyaan, Mid-Level - [Pohon Keputusan & Ensemble](https://sharpskill.dev/id/technologies/data-science/pertanyaan-wawancara/ml-trees-ensembles.md): 24 pertanyaan, Mid-Level - [ML Tanpa Pengawasan](https://sharpskill.dev/id/technologies/data-science/pertanyaan-wawancara/ml-unsupervised.md): 22 pertanyaan, Mid-Level - [Pipeline ML & Validasi](https://sharpskill.dev/id/technologies/data-science/pertanyaan-wawancara/ml-pipelines-validation.md): 22 pertanyaan, Mid-Level - [Deret Waktu & Peramalan](https://sharpskill.dev/id/technologies/data-science/pertanyaan-wawancara/time-series-forecasting.md): 22 pertanyaan, Mid-Level - [Dasar-Dasar Deep Learning](https://sharpskill.dev/id/technologies/data-science/pertanyaan-wawancara/deep-learning-fundamentals.md): 24 pertanyaan, Senior - [TensorFlow & Keras](https://sharpskill.dev/id/technologies/data-science/pertanyaan-wawancara/tensorflow-keras.md): 22 pertanyaan, Senior - [CNN dan klasifikasi gambar](https://sharpskill.dev/id/technologies/data-science/pertanyaan-wawancara/cnn-image-classification.md): 24 pertanyaan, Senior - [RNN & Sekuens](https://sharpskill.dev/id/technologies/data-science/pertanyaan-wawancara/rnn-sequences.md): 22 pertanyaan, Senior - [Transformers & Attention](https://sharpskill.dev/id/technologies/data-science/pertanyaan-wawancara/transformers-attention.md): 24 pertanyaan, Senior - [NLP & Hugging Face](https://sharpskill.dev/id/technologies/data-science/pertanyaan-wawancara/nlp-huggingface.md): 24 pertanyaan, Senior - [GenAI & LangChain](https://sharpskill.dev/id/technologies/data-science/pertanyaan-wawancara/genai-langchain.md): 24 pertanyaan, Senior - [MLOps dan Deployment](https://sharpskill.dev/id/technologies/data-science/pertanyaan-wawancara/mlops-deployment.md): 24 pertanyaan, Senior --- Source: SharpSkill (https://sharpskill.dev), tech interview preparation for your real stack. HTML version of this page: https://sharpskill.dev/id/technologies/data-science/pertanyaan-wawancara/matplotlib-seaborn