Category "matplotlib"

why plotting a (112,112,2) in matplotlib using imshow() is not possible?

why is it that we can not plot a matrix that has the shape (112,112,2) but doing it for shapes such as (112,112,3)is ok ? TypeError: Invalid shape (112, 112, 2)

plotting white stuff over a plot in python

I've got some trouble with plotting white spans over a plot. I've created and plotted a given function y(x) and defined some "forbidden" regions, corresponding

Formating a frequency dataframe to a table and a histogram

If I have a frequency table like below: ret < -1(%) -1 < ret < -0.5(%) -0.5 < ret < 0(%) 0 < ret < 0.5(%) 0.5 < ret <

How to remove gaps between adjacent matplotlib patches

I am trying to plot a collection of finite element data with colored patches used to represent the value in each element. Unfortunately, when I plot the patches

Place ipywidget Dropdown on screen in matplotlib.pyplot axes ax1

When I run this code, the Dropdown is nowhere to be found. How do I make it appear in ax1? (I think I would like to avoid Tkinter.) #!/usr/bin/env python3 #Pla

How to draw a continuous contour plot with discrete coordinate data (DataFrame form)?

The row data has 3 columns and cannot shape a uniform grid based on 'x'&'z', so I am not able to plot the contour as the existed question: Create Contour Pl

plotting error bar on x-axis on a timeseries python

I have data representing mean concentrations over 5 months, some means are over a 24 h period and some are weekly means. I want to plot everything as a scatterp

Datetime Objects on X-axis with matplotlib

I'm plotting some data using matplotlib with DateTime objects on the x-axis, but can't seem to figure out why my DateTime values aren't spaced out on the x-axis

How to plot nodes of different shapes and facecolor of bbox in the same graph using networkx and matplotlib in Python?

I want to plot a simple graph using networkx. There are two nodes with labels Python and Programming in each. The code and graph are as follows: import networkx

view limit minimum 0.0 is less than 1 with matplotlib

I know there are similar questions to mine below, but mine is minimal and does not have anything to do with pandas and also solution pd.to_datetime did not work

Matplotlib: Transformation of coordinates

I've been struggling with this issue for a while now. I simply want to transform my data in display world, perform some operations, and then translate back to t

Set Colorbar Range in matplotlib

I have the following code: import matplotlib.pyplot as plt cdict = { 'red' : ( (0.0, 0.25, .25), (0.02, .59, .59), (1., 1., 1.)), 'green': ( (0.0, 0.0,

Plot Python surface with non-square data

I ran a series of simulations and want to create a response surface of the performance based off my two parameters, tol and eta. The issue I'm having is actuall

How to make fixed ticks for graph using matplotlib [duplicate]

I am trying to make a graph with fixed ticks, regardless to the points values. For example, I want the ticks to be 0-6, and the points values

pcolormesh plot with data from csv file

I have some time series data in the following format from csv file: Time 1 5 10 18 21 22 29 30 35 2019/11/01 09:00 5

Plotting the frequency of occurrences per date

I'm new to pandas and plotly. And I have a large csv file with two columns, a date column and a column that contains a string of text (event). Each event is a n

Changing the time scale of a matplotlib graph in a real-time fashion

I'm making a real-time application that graphs sensor data in a real-time fashion. The data is saved to a .csv file and graphed using matplotlib in the followin

Setting coordinates for sphere

I have a code that produces a sphere. I want to change the coordinates in which the sphere spawns import numpy as np import matplotlib.pyplot as plt from mpl_to

How to add a geomdl NURBS curve to an existing axis?

I'm trying to work with NURBS using geomdl. I already have an matplotib axis, where several elements are plotted using: plot() scatter() imshow() (for Backgr

Making a plot that has an x-axis that has neg. values representing hours prior to the start of the event, then pos. values representing hours after

I'm not sure if my question makes sense, so apologies on that. Basically, I am plotting some data that is ~100 hours long. On the x-axis, I want to make it so t