I’m looking to create a program that will randomly generate lines (that are inequalities) and that will show the area that satisfies the constraints. I don’t mind which libraries are used so feel free to use sympy, numpy etc I will show my current code but this just fills the area between 2 lines and doesn’t use inequalities at all.
Tag: matplotlib
How can I format multiple thousands of date-dependant data points in a readable graph with Matplotlib?
I have two corresponding lists, one of the dates and another of its respective price. The lists are 30,000 data points long. I’m using this code to generate the graph below: I’m supposed to have the dates separated in a readable format using the code above but it doesn’t seem to work. I’m also not sure if it’s possible to
Plot a custom colormap next to iterative scatterplot
I have a set of coordinates that are arranged per year, and I scatterplot them. I create a custom colormap that reflects those years, but the issue is I can’t manage to plot the colorbar of that colormap, and replace the ticks by the values of a numpy array of datetime64. I have no idea how to do it since
how to calculate correlation coefficient for a scatter-plot in scipy
i am trying to calculate the correlation coefficient for a scatterplot with scipy, the thing is, i have a kind of complex dataset in an ndarray, and the basic syntax does not work for me… here is my full code: Answer pearsonr works fine on your data You were passing two floats (namely values at the row i) as the
How to find the numeric value of the intersection point between an axvline and axline in matplotlib?
I have the code below and I needed to find the numerical value of the intersection point between the axline and the axvline, I have no idea how to solve this in a simple way, does anyone know how to solve it? Infinite thanks in advance! :) Plot Result Answer First, you need to find the equation of the oblique
Create Voronoi art with rounded region edges
I’m trying to create some artistic “plots” like the ones below: The color of the regions do not really matter, what I’m trying to achieve is the variable “thickness” of the edges along the Voronoi regions (espescially, how they look like a bigger rounded blob where they meet in corners, and thinner at their middle point). I’ve tried by “painting
Combining various image channels after gaussian filtering produces white image
I am trying to implement a gaussian filter for an image with dimensions (256, 320, 4). I first generated a gaussian Kernel for the same and then individually perform the convolution on each of the 4 channel, i.e on all the 256*320 greyscale images. After performing this I wish to combine the image into a coloured image. However, when I
Change order of numbers in x tick labels matplotlib
I have averaged a year’s worth of hourly data to one day. As such I have an array representing the hour of day, and another with the data. I want to plot this, however I want to plot it from 12pm to 11am, rather than from midnight to midnight. Matplotlib doesn’t seem to let me change the x axis to
How can I make Matplotlib show all tick labels?
I am trying to plot some time series’ and I struggle with the tick labels. my df looks like this: The code to plot it looks like this: The plot however looks like this https://i.stack.imgur.com/tKqP6.png How can I make it thath it shows all years as x ticks? Thank you in advance Answer Try this: The output is: I used
Subplots won’t display together + griddata() returning “nan” values
I have a 9×9 matrix in which I know 8 values, at the positions contained in array points, with corresponding values in array values. I want to interpolate the unknown values and paste the result on a 200×200 image. I’m a beginner at python and I’m struggling with the following: My subplots won’t display together. Subplot(121) and subplot(122) should create