Skip to content

Commit

Permalink
Merge branch 'main' into triangulation-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
beckermr authored Jan 7, 2025
2 parents 8397394 + 6b8223a commit a1c8894
Show file tree
Hide file tree
Showing 53 changed files with 4,991 additions and 2,055 deletions.
8 changes: 4 additions & 4 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ How to contribute?
==================

Contributions of any size are greatly appreciated! You can
make a significant impact on ultraplot by just using it and
make a significant impact on UltraPlot by just using it and
reporting `issues <https://github.com/ultraplot/ultraplot/issues>`__.

The following sections cover some general guidelines
regarding ultraplot development for new contributors. Feel
regarding UltraPlot development for new contributors. Feel
free to suggest improvements or changes to this workflow.

.. _contrib_features:
Expand Down Expand Up @@ -46,7 +46,7 @@ Write tests

Most modern python packages have ``test_*.py`` scripts that are run by `pytest`
via continuous integration services like `Travis <https://travis-ci.com>`__
whenever commits are pushed to the repository. Currently, ultraplot's continuous
whenever commits are pushed to the repository. Currently, UltraPlot's continuous
integration includes only the examples that appear on the website User Guide (see
`.travis.yml`), and `Casper van Elteren <https://github.com/cvanelteren>` runs additional tests
manually. This approach leaves out many use cases and leaves the project more
Expand Down Expand Up @@ -203,7 +203,7 @@ Here is a quick guide for submitting pull requests:
base: master
Note that you can create the pull request before you're finished with your
feature addition or bug fix. The PR will update as you add more commits. ultraplot
feature addition or bug fix. The PR will update as you add more commits. UltraPlot
developers and contributors can then review your code and offer suggestions.

.. _contrib_release:
Expand Down
446 changes: 19 additions & 427 deletions LICENSE.txt

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ inside the ``ultraplot`` folder.
:alt: docs
:target: https://ultraplot.readthedocs.io/en/latest/?badge=latest

.. |pypi| image:: https://img.shields.io/pypi/v/ultrplot?color=83%20197%2052
.. |pypi| image:: https://img.shields.io/pypi/v/ultraplot?color=83%20197%2052
:alt: pypi
:target: https://pypi.org/project/ultraplot/

Expand Down
14 changes: 7 additions & 7 deletions WHATSNEW.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ submitting your own changes.

Please note that when classes, functions, keywords, or settings are deprecated,
they are not removed -- using the old syntax will result in a warning rather than
an error and preserve the original functionality. Since ultraplot adheres to `semantic
an error and preserve the original functionality. Since UltraPlot adheres to `semantic
versioning <https://semver.org>`__, we will not consider removing the deprecated
syntax until the first major release (i.e., version 1.0.0).

Expand Down Expand Up @@ -364,7 +364,7 @@ Documentation
-------------

* Populate docs with examples of passing ``format`` arguments to figure and axes
instantiation commands (e.g. ``pplt.figure``, ``fig.subplot``) (:commit:`803a889f`).
instantiation commands (e.g. ``uplt.figure``, ``fig.subplot``) (:commit:`803a889f`).
* Improve website colormap and cycle table rendering time by rasterizing colorbar
data and add `rasterize` as optional keyword arg (:commit:`1a875fc2`).

Expand Down Expand Up @@ -536,7 +536,7 @@ Features
--------

* Permit passing ``format`` keywords when instantiating figures and axes
(:commit:`ae98378d`). For example: ``pplt.figure(suptitle='Super title')``
(:commit:`ae98378d`). For example: ``uplt.figure(suptitle='Super title')``
or ``fig.add_subplot(111, xcolor='gray', xticks=10)`` .
* Add back `color` as a valid `ultraplot.axes.CartesianAxes.format` keyword
arg for consistency with `xcolor` and `ycolor` (:commit:`ecb6fa3f`).
Expand Down Expand Up @@ -908,7 +908,7 @@ Features
* Dynamically add classes that are "registered" by contructor functions
to the top-level namespace (:commit:`4382a1b1`). This is consistent with
behavior of importing custom-ultraplot tickers, norms, etc. to top-level namespace.
Now e.g. ``pplt.MultipleLocator`` or ``pplt.LogNorm`` are allowed.
Now e.g. ``uplt.MultipleLocator`` or ``uplt.LogNorm`` are allowed.
* Allow creating subplots with `~ultraplot.ui.figure` and either (1) subsequently
calling `~ultraplot.figure.Fiugure.subplots` or (2) passing integers or subplot specs
generated by `~ultraplot.gridspec.GridSpec` to `~ultraplot.figure.Figure.add_subplot`
Expand Down Expand Up @@ -951,7 +951,7 @@ Features
geometry by looking up subplotspec indices (:commit:`51967ce3`). Previously 2d
indexing of ``SubplotGrid`` with complex geometry would just return a wrong result.
* Issue warning message when users try ``fig.subplots_adjust()`` or
``pplt.figure(subplotpars=SubplotParams)`` and auto-disable and warn when
``uplt.figure(subplotpars=SubplotParams)`` and auto-disable and warn when
matplotlib "tight layout" rc settings are toggled (:commit:`51967ce3`).
* Add nicer string representations of figures, gridspecs, subplotspecs, and
axes clearly showing the geometry and layout (:commit:`51967ce3`, :commit:`6382cf91`).
Expand Down Expand Up @@ -1013,7 +1013,7 @@ Features
* Make `~ultraplot.config.rc_ultraplot` and `~ultraplot.config.rc_matplotlib` containers
of ultraplot/matplotlib settings part of the public API (:commit:`a50d5264`).
* Allow conversion of numeric inputs with `~ultraplot.utils.units` using e.g.
``pplt.units(num, 'in', 'cm')`` (:commit:`88f3dc88`).
``uplt.units(num, 'in', 'cm')`` (:commit:`88f3dc88`).
* Add more intuitive :rcraw:`grid.labelpad` and :rcraw:`tick.labelpad`
as aliases for :rcraw:`grid.pad` and :rcraw:`tick.pad` (:commit:`a50d5264`).
* Add `~ultraplot.axes.PlotAxes.line` and `~ultraplot.axes.PlotAxes.linex` command
Expand Down Expand Up @@ -1484,7 +1484,7 @@ Internals
Documentation
-------------

* Finally use ``pplt`` as the recommended abbreviation: ``import ultraplot as pplt``.
* Finally use ``uplt`` as the recommended abbreviation: ``import ultraplot as uplt``.
* Major clean up of "Why ultraplot?" page and user guide pages.
* Fix incomplete ``cmap.from_file`` docstrings (:commit:`54f1bc7c`).
* Rename "Changelog" to "What's New?" and list all contributors in "About the Authors".
Expand Down
100 changes: 100 additions & 0 deletions ci/logo.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,104 @@
transparent = True,
bbox_inches = "tight",
)

fig.savefig(
"UltraPlotLogo.png",
transparent = True,
bbox_inches = "tight",
)
fig.show()


# %%
import ultraplot as plt, numpy as np

from matplotlib.font_manager import FontProperties
from matplotlib import patheffects as pe
from matplotlib.patches import Rectangle
from scipy.ndimage import gaussian_filter

font = FontProperties(fname='./PermanentMarker-Regular.ttf')


fs = 38
left = 0.5
sw = 3
fig, ax = plt.subplots(figsize = (2, 2))
ax.text(left, 0.52, "Ultra",
fontsize = fs,
fontproperties = font,
va = "bottom",
ha = "center",
color = "steelblue",
path_effects = [
pe.Stroke(linewidth = sw, foreground = "white"),
pe.Normal(),
],
transform = ax.transAxes)
ax.text(left, 0.48, "Plot",
fontsize = fs,
# fontproperties = font,
va = "top",
ha = "center",
color = "white",
path_effects = [
pe.Stroke(linewidth = sw, foreground = "steelblue"),
pe.Normal(),
],
transform = ax.transAxes)

shift = 0.033
import colorengine as ce

colors = np.linspace(0, 1, 4, 0)
# colors = plt.colormaps.get_cmap("viko")(colors)
ax.axis(False)
ax.axis("square")
# fig.set_facecolor("lightgray")


# Create checkerboard pattern
n_squares_x, n_squares_y = 20, 8 # Adjust number of squares
square_size = 0.1 # Size of each square


fig_aspect = fig.get_figwidth() / fig.get_figheight()
square_size_y = 0.1 # Base square size in y direction
square_size_x = square_size_y / fig_aspect # Adjust x size to maintain square shape

n_squares_x = int(1.0 / square_size_x) + 1 # Calculate number of squares needed in x direction

# Create alpha mask with Gaussian fade
x = np.linspace(-2, 2, n_squares_x
)
y = np.linspace(-2, 2, n_squares_y)
X, Y = np.meshgrid(x, y)
R = np.sqrt(X**2 + Y**2)
alpha = np.exp(-R**2/0.75) # Adjust the 1.0 to control fade rate
alpha = gaussian_filter(alpha, sigma=0.5) # Adjust sigma for smoothness

# Create colormap gradient
cmap = plt.colormaps.get_cmap("viko") # Choose your colormap

for i in range(n_squares_x):
for j in range(n_squares_y):
if (i + j) % 2 == 0: # Checkerboard pattern
color = cmap(i/n_squares_x) # Color varies along x-axis
rect = Rectangle(
(i*square_size_x, j*square_size_y + 0.075),
square_size_x, square_size_y,
facecolor=color,
alpha=alpha[j, i],
transform=ax.transAxes
)
ax.add_patch(rect)



fig.savefig(
"UltraPlotLogoSquare.png",
transparent = True,
bbox_inches = "tight",
)
fig.show()
Loading

0 comments on commit a1c8894

Please sign in to comment.