- models.py from django.contrib.auth.models import User from django.contrib.contenttypes.fields import GenericForeignKey, GenericRelation from django.contrib.contenttypes.models import ContentType from django.db import models
- models.py from functools import update_wrapper from django.contrib import admin from django.db import models from django.http import HttpResponseRedirect from django.urls import reverse
- admin.py from django.contrib import admin from .models import Story admin.site.register(Story) raise Exception("Bad admin module") models.py from django.db import models
- from django.db import models from django.test import SimpleTestCase from django.test.utils import isolate_apps
- This example demonstrates the use of `.pyplot.subplot2grid` to generate subplots. Using `.GridSpec`, as demonstrated in :doc:`/gallery/userdemo/demo_gridspec03` is generally preferred
- This example demonstrates the implementation of a custom `.BoxStyle`. Custom `.ConnectionStyle`\s and `.ArrowStyle`\s can be similarly defined.
- When creating an annotation using `~.Axes.annotate`, the arrow shape can be controlled via the *connectionstyle* parameter of *arrowprops*. For further details see the description of `.FancyArrowPatch`.
- ConnectionPatch` can be used to draw a line (possibly with arrow head) between points defined in different coordinate systems and/or axes.
- import numpy as np import matplotlib.pyplot as plt # Fixing random state for reproducibility np.random.seed(19680801)
- from matplotlib.patches import Ellipse import matplotlib.pyplot as plt from matplotlib.offsetbox import (AnchoredOffsetbox, DrawingArea, HPacker, TextArea)