Disable `DiscreteNorm` by default for `imshow` plots?
See original GitHub issueDescription
In all the examples available for this package and in my tests, the colorbar maximum number of bins is fixed to 10. There is doesn’t seem to by any to changing this
Steps to reproduce
A “Minimal, Complete and Verifiable Example” will make it much easier for maintainers to help you.
fig, ax = proplot.subplots()
pc = plt.imshow(p.image, extent=[file.bounds[0], file.bounds[1], file.bounds[2], file.bounds[3]], cmap=my_cmap, vmin=0.5, vmax=1.5)
plt.colorbar(pc, ax=ax)
ax.set_xlim([0, 1])
ax.set_ylim([0, 1])
ax.set_xlabel(r"$x/R$")
ax.set_ylabel(r"$y/R$")
plt.show()
Actual behavior: [What actually happened]
Equivalent steps in matplotlib
Please make sure this bug is related to a specific proplot feature. If you’re not sure, try to replicate it with the native matplotlib API. Matplotlib bugs belong on the matplotlib github page.
fig, ax = plt.subplots()
pc = plt.imshow(p.image, extent=[file.bounds[0], file.bounds[1], file.bounds[2], file.bounds[3]], cmap=my_cmap, vmin=0.5, vmax=1.5)
plt.colorbar(pc, ax=ax)
ax.set_xlim([0, 1])
ax.set_ylim([0, 1])
ax.set_xlabel(r"$x/R$")
ax.set_ylabel(r"$y/R$")
plt.show()
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (3 by maintainers)
Top Results From Across the Web
Disable the output of matplotlib pyplot - python - Stack Overflow
I have an array A of shape (1000, 2000). I use matplotlib.pyplot to plot ...
Read more >2D plotting commands — ProPlot documentation
By default, proplot uses DiscreteNorm to “discretize” the possible colormap colors for contour and pseudocolor PlotAxes commands (e.g., contourf , pcolor ).
Read more >matplotlib.pyplot.imshow — Matplotlib 3.6.2 documentation
By default, the colormap covers the complete value range of the supplied data. It is an error to use vmin/vmax when a norm...
Read more >proplot/2dplots.py at master - GitHub
By default, proplot automatically adjusts the width of. # `~proplot.axes. ... To disable this feature, pass ``inbounds=False`` to the plotting command or.
Read more >How to change the scale of imshow in matplotlib without ...
This will prevent stretching of the image. By default, imshow sets the aspect of the plot to 1. To display the figure, use...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This is now fixed! See #233. You can use
discrete=False
ordiscrete=True
to enable or disable application ofDiscreteNorm
for different plots, and it is diabled by default for most commands:imshow
,matshow
,scatter
,barbs
,quiver
,streamplot
,hexbin
.This might be help:
Default is rc[‘image.levels’] = 11.
You can change here.