-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
contourf with custom colormap #16629
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Oh, and even with |
There is a beating of two different discretisations, the manual one and the one from contour, right? So if you create an image plot, i.e. replace If using a contour plot, the contours will only be at the discretization levels if exactly those levels are chosen when calling it (else it wouldn't know about that explicit desire).
Closing this, as there is no bug apparent here, but feel free to discuss further if I'm misunderstanding. |
Well, I only used that data to simplify the MWE, in my actual use case I'm trying to visualise the results of an SVM. And I beg you pardon but if I have data with |
Ok, specifying as a list does work, still I find the behaviour with |
Just as a remark, a similar plot can be created in a single axes using a horizontal bar chart: |
@timhoffm this is just an oversimplification for the sake of an MWE, I need |
@ImportanceOfBeingErnest Thank you very much for your patience with me and the explanations where I misunderstood the documentation. Everything seems clear to me now :) |
Bug report
Using a custom colormap created with
LinearSegmentedColormap.from_list
,contourf
doesn't seem to use the correct colours for every value.Code for reproduction
Actual outcome
Expected outcome
I expected the colours to be correctly picked, meaning an increasing number of different colours in each subplot from top to bottom with each bar in a row roughly the same size (since that's what
Z
should look like).Matplotlib version
print(matplotlib.get_backend())
): PGF with PDF output, GTK3AggInstalled from Arch Linux repositories.
The text was updated successfully, but these errors were encountered: