72,810 questions
Advice
0
votes
2
replies
78
views
Python mandelbrot set iteration slider
I've got a class project to do, it's supposed to display the mandelbrot set with a customizable colour map and a max_iter slider. I've got the colour map radio buttons working, but I can't manage the ...
0
votes
0
answers
49
views
Matplotlib figsize has no visible effect in Spyder plots pane
I am using Matplotlib in Spyder and I am trying to change the figure size with figsize, but it does not seem to make any visible difference no matter what values I use.
For example, even if I change:
...
3
votes
2
answers
90
views
How to visualize a dense, gappy time series with spikes in Python?
I have a sensor time series with these properties:
~250,000 data points at high sampling rate over ~12 hours
~11 continuous segments separated by 30-40 minute gaps (sensor goes offline periodically)
...
0
votes
1
answer
93
views
How can I make this plot using Seaborn or matplotlib?
How can I make this plot using Seaborn or matplotlib? A key requirement is that the plot code be less than about 10 lines (this code is meant to go in a book and should not require a PhD in matplotlib)...
1
vote
2
answers
78
views
Missing minus signs in symlog scale
I have the following plot, using a symmetric log scale:
from matplotlib import pyplot as plt
from matplotlib import ticker
(_, ax) = plt.subplots()
ax.plot([-100, -1, -0.5, 0, 0.5, 1, 100], marker='o')...
Advice
0
votes
3
replies
55
views
How to make a 3D plot from a 3D numpy array
I would like to make a 3D surface plot (ideally like the one seen here https://matplotlib.org/stable/gallery/mplot3d/contour3d_3.html) from a 3D array.
How do I take one 3D array and create the three ...
1
vote
0
answers
83
views
python trying to plot a DFA with networkx and matplotlib
Hi I was trying to implement a plot function for a DFA class, using networkx in python.
def plot(self):
G = nx.MultiDiGraph()
nodes = self.collect_nodes()
for n in nodes:
...
3
votes
1
answer
118
views
Pandas IndexError: DataFrame indexer is not allowed for .iloc
I'm trying to plot actual vs predicted values using matplotlib.
Here is my code:
import pandas as pd
import matplotlib.pyplot as plt
from sklearn.model_selection import train_test_split
from sklearn....
2
votes
2
answers
140
views
Pandas aggregate() creates weird DataFrame
I've been scratching my head over this way too long now, but can't find any answers online, and I hope someone can shed some light on this.
I'm working with Pandas and a csv file, from which I need to ...
Advice
1
vote
1
replies
63
views
How can I insert a custom symbol between y‑axis tick labels in Matplotlib?
I have a plot with categorical labels on the y‑axis, similar to this:
I would like to display a symbol (e.g., +) between every pair of y‑axis tick labels, such as between eight and eight u two.
Is it ...
Tooling
0
votes
2
replies
31
views
cmap gradient in legend patch
I am running matplotlib in Python.
I have a histogram showing data from 36 different channels, each colored by a cmap gradient. I want to be able to put a gradient in my legend, possibly through a ...
5
votes
2
answers
128
views
Fixing plotting artifacts when using plt.xscale('symlog')
How to fix these kinks in the norm_pan and norm_tau curves? I tried using a quite high resolution and logarithmic spacing when defining t, but this did not fix the problem.
import numpy as np
import ...
Tooling
0
votes
2
replies
68
views
Is there a way to fill areas of a plot based on a condition?
I'd like to do something like pyplot.fill_between but I want to shade areas where a plot goes above a threshold (0.5) in the x-axis.
For example, here's a plot I produced using pyplot.fill_between and ...
Advice
0
votes
2
replies
79
views
I'm struggling with changing the way Matplotlib labels the steps on the x axis
I have a while loop that is running 5000 times a second. Each time it runs it recalculates a whole ton of variables and then adds the value of a couple of those varibles to their own lists. After a ...
Advice
0
votes
5
replies
99
views
End Simulation on surface collision
I'm making an orbit decay simulation and I don't know how can I make the simulation stop/break when the object collides with the surface. It keeps simulating inside the planet's surface and doesn't ...