I am trying to plot data from Alpha Vantage. when I do I get: as you can see, ‘date’ is not on there. this is causing me problems when I start using mplfinance and matplotlib. Can anyone help? ps: my excel sheet looks like this date 1. open … 2021-02-03 243 2021-02-02 245 Answer Glancing at what you have shown
Tag: matplotlib
How to resize x axis
I want to resize the x-axis range, but I don’t know how to do that. The range I want to resize is [under 20, under 40, under 60, under 80]. X represent age and Y represent survived rate Answer Put your data into age groups before plotting: If you want more polished labels:
How to draw colored rectangles around grouped clusters in dendogram?
I try to add colored rectangle to dendrogram results like as follow: this is my dendrogram codes: However, this is only add colorful line not a rectangle like in the above image. How can I create image like this? Thanks Answer You can loop through the generated path collections and draw a bounding box. Optionally, you could set the height
How to plot DENDROGRAM in GUI
I am using a GUI from QtDesigner to plot Dendrogram. My code is below, but I can not plot the Dendrogram, how can I fix it? Image of Dendrogram: Answer You have to import the dendrogram from scipy: And then pass it the axes through the ax argument:
Removing Lines from Contourf in Matplotlib
I am using the following code to contour plot some data using contourf in matplotlib. I have set the transparency of the colourbar to 0.6, but there are annoying lines between each colour interval that I cant get rid of. There doesnt seem to be a way to set linestyle in contourf, any ideas? Answer You can add the option
How to create a multi-colored curve in 3d?
I’m trying to plot a 3d curve that has different colors depending on one of its parameters. I tried this method similar to this question, but it doesn’t work. Can anyone point me in the right direction? Answer To extend the approach in this tutorial to 3D, use x,y,z instead of x,y. The desired shape for the segments is (number
2 Interactive Poly Editor with matplotlib Not Working
Following a tutorial Poly Editor I’ve created 2 polygons, added to the figure, and then instantiated 2 interactive polygons. I expected that when I adjusted the individual polygon it would work separately. However they were conflicting with each other. Then I have tried some changes in the original code yet still not produce a successful result. If you’re familiar I
Why Matplotlib.hist taking different list?
I’m trying to plot the following And getting This one actually draws a different array([ 1., 4., 5., 8., 9., 10., 10., 10., 10., 10.], which is created run time automatically. Answer I assume you mean the red histogram appears to be wrong? It’s not. You’ve got cumulative=True so it adds each value to make a “running total”. If you
python matplotlib “merge” x axis labels for multi index
I would like to “merge” the first level of multi index, i.e. have a centered “USA” and “EU” instead of the tupples. Minimal Exmaple Output Desired output Using excel, one gets the desired output (almost) by default: The ideal solution is simple, short and does not require any manual adjustments if more regions / sectrs are added. Answer There are
How to plot each column with each column from Pandas Dataframe?
I were searching how create scatterplot between each column with each column. Similar question to this one and I followed the code from answer: How to make a loop for multiple scatterplots in python? What I done is: But in this solution I’m getting everything on one single plot, I want to make it separately, how I can achieve that?