Skip to content

Magenaut

  • Home
  • Topics
    • Notes
    • Tutorial
    • Bug fixing
    • Extension
    • Server
  • Q&A
  • Privacy Policy
  • About

matplotlib

Why does pyplot.contour() require Z to be a 2D array?

August 16, 2022 by Magenaut

The matplotlib.pyplot.contour() function takes 3 input arrays X, Y and Z.
The arrays X and Y specify the x- and y-coordinates of points, while Z specifies the corresponding value of the function of interest evaluated at the points.

Categories Python, Q&A Tags contour, matplotlib, numpy, python Leave a comment

How to remove the space between subplots in matplotlib.pyplot?

August 16, 2022 by Magenaut

I am working on a project in which I need to put together a plot grid of 10 rows and 3 columns. Although I have been able to make the plots and arrange the subplots, I was not able to produce a nice plot without white space such as this one below from gridspec documentatation.image w/o white space.

Categories Python, Q&A Tags matplotlib, numpy, python Leave a comment

Plot a histogram such that bar heights sum to 1 (probability)

August 16, 2022 by Magenaut

I’d like to plot a normalized histogram from a vector using matplotlib. I tried the following:

Categories Python, Q&A Tags histogram, matplotlib, python, seaborn Leave a comment

Python : 2d contour plot from 3 lists : x, y and rho?

August 16, 2022 by Magenaut

I have a simple problem in python and matplotlib.
I have 3 lists : x, y and rho with rho[i] a density at the point x[i], y[i].
All values of x and y are between -1. and 1. but they are not in a specific order.

Categories Python, Q&A Tags contour, matplotlib, python Leave a comment

matplotlib scatterplot with legend

August 16, 2022 by Magenaut

I am interested in plotting a legend in my scatterplot. My current code looks like this

Categories Python, Q&A Tags matplotlib, plot, python Leave a comment

How to use a (random) *.otf or *.ttf font in matplotlib?

August 16, 2022 by Magenaut

How can I use any type of font in my font library on my computer (e.g. *otf or *ttf) in all my matplotlib figures?

Categories Python, Q&A Tags fonts, matplotlib, python Leave a comment

How to set the default color cycle for all subplots with matplotlib?

August 16, 2022 by Magenaut

How can I set a default set of colors for plots made with matplotlib? I can set a particular color map like this

Categories Python, Q&A Tags colors, matplotlib, python Leave a comment

How can I remove the top and right axis in matplotlib?

August 16, 2022 by Magenaut

Instead of the default “boxed” axis style I want to have only the left and bottom axis, i.e.:

Categories Python, Q&A Tags matplotlib, python Leave a comment

Fill between two vertical lines in matplotlib

August 16, 2022 by Magenaut

I went through the examples in the matplotlib documentation, but it wasn’t clear to me how I can make a plot that fills the area between two specific vertical lines. For example, say I want to create a plot between x=0.2 and x=4 (for the full y range of the plot). Should I use fill_between, … Read more

Categories Python, Q&A Tags matplotlib, python Leave a comment

matplotlib (mplot3d) – how to increase the size of an axis (stretch) in a 3D Plot?

August 16, 2022 by Magenaut

I have this so far:

Categories Python, Q&A Tags matplotlib, python Leave a comment
Older posts
Newer posts
← Previous Page1 … Page21 Page22 Page23 … Page43 Next →
  1. michealSmith07 on Is there a way to dynamically refresh the less command?August 21, 2022

    That is a very nice post. I like this post.

  2. anonymous on Fix libwacom9 dependency issue when upgrade DebianJune 27, 2022

    saved my day!! Thanks for the help…

  3. sreedhar on Fix libwacom9 dependency issue when upgrade DebianMay 10, 2022

    Thanks its working

  4. saintnick on Fix libwacom9 dependency issue when upgrade DebianMay 10, 2022

    remove libwacom2 worked for me as well

  5. ranafoul on Fix libwacom9 dependency issue when upgrade DebianApril 22, 2022

    apt remove libwacom2 helped on kali 2022.01. gr8

.net ajax asp.net asp.net-core asp.net-mvc asp.net-mvc-3 asp.net-mvc-4 asp.net-web-api bash c# command-line css custom-post-types custom-taxonomy dataframe dictionary django entity-framework functions gridview html iis javascript jquery json linux list matplotlib numpy pandas php plugin-development plugins posts python python-2.7 python-3.x security shell shell-script sql string vb.net webforms wp-query

© 2026 Magenaut • Built with GeneratePress