Matplotlib connect scatterplot points with line – Python
I have two lists, dates and values. I want to plot them using matplotlib. The following creates a scatter plot of my data.
I have two lists, dates and values. I want to plot them using matplotlib. The following creates a scatter plot of my data.
Is there a way to group boxplots in matplotlib?
I’m making a visualization of historical stock data for a project, and I’d like to highlight regions of drops. For instance, when the stock is experiencing significant drawdown, I would like to highlight it with a red region.
I have the following range of numpy data (deltas of usec timestamps):
Is it possible to display text in a box through Matplotlib, with automatic line breaks? By using pyplot.text(), I was only able to print multi-line text that flows beyond the boundaries of the window, which is annoying. The size of the lines is not known in advance… Any idea would be much appreciated!
I am trying to plot two separate quantities on the same graph using twiny as follows:
I’m learning how to use mplot3d to produce nice plots of 3d data and I’m pretty happy so far. What I am trying to do at the moment is a little animation of a rotating surface. For that purpose, I need to set a camera position for the 3D projection. I guess this must be possible since a surface can be rotated using the mouse when using matplotlib interactively. But how can I do this from a script?
I found a lot of transforms in mpl_toolkits.mplot3d.proj3d but I could not find out how to use these for my purpose and I didn’t find any example for what I’m trying to do.
I am trying to plot a multi-color line using pandas series. I know matplotlib.collections.LineCollection will sharply promote the efficiency.
But LineCollection require line segments must be float. I want to use datatime index of pandas as x-axis.
I want to plot a graph with a lot of ticks on the X axis using the following code:
Say I have data about 3 trading strategies, each with and without transaction costs. I want to plot, on the same axes, the time series of each of the 6 variants (3 strategies * 2 trading costs). I would like the “with transaction cost” lines to be plotted with alpha=1 and linewidth=1 while I want the “no transaction costs” to be plotted with alpha=0.25 and linewidth=5. But I would like the color to be the same for both versions of each strategy.