Skip to content
Advertisement

Tag: plot

Matplotlib plot with ConnectionPaths objects layout issues

I have a script that plots point correspondences between images: This results with an overlap of the axes ticks of one image with the other. When I try to add fig.tight_layout() at the end of the script the image’s size is drastically diminished: Is it possible to keep the images large and avoid the ticks overlapping? Thanks! Answer As mentioned

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:

how to draw outside mplfinance plot?

I get the error message: Is there a way to plot outside the range? Answer The workaround for this is to set show_nontrading=True I tested with your code, modifying to: and get The reason this does not work with show_nontrading=False (the default, if unspecified, value) is because in that case the x-axis values are actually just integers representing the row

How to change plot legends with roc_auc_score?

I’m plotting ROC curve with plot_roc_curve of scikit-learn, that plot legends are printed automatically. Is there a way to change them? Answer You can pretty much add anything you like to the plot object that is produced through plot_roc_curve. For instance, you can do something like this: This will return:

How to plot percentage of NaN in pandas data frame?

I’d like someone to help me plot the NaN percentage of pandas data frame. I calculated percentage using this code. It gave me this result. Now, I want to plot the percentage along with the column names of data frame. Can anyone help me? Regards. Updated: The graph looks like this. How to beautify this in order to see the

Select plot linestyle with plotly pandas backend

I want to be able to select the linestyle with the pandas plot method with the plotly backend. Matplotlib: When I use the matplotlib backend in pandas, I can do: which allows me to select the linestyle for each column. The output is: Plotly backend: With plotly I can do How can I select the linestyle of a given line

Is there a MatLab equivalent of Python matplotlib’s tight_layout()?

I find the amount of whitespace around plots in both normal Python Matplotlib and Matlab quite annoying, specifically the left and right margins that make your plot look tiny when inserting the saved (landscape) figure into a standard (portrait) .doc or .pdf file. Fortunately Python Matplotlib has the “tight_layout()” functionality that takes care of this beautifully. Does Matlab have a

Advertisement