Skip to content

Commit

Permalink
#8 update histogram example
Browse files Browse the repository at this point in the history
  • Loading branch information
Zhangyixue1537 committed Jun 10, 2024
1 parent c2cecc5 commit a25911a
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 0 deletions.
7 changes: 7 additions & 0 deletions sphinx/source/examples/histogram/README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
***********
Histogram Charts
***********

Below is a gallery of histogram chart.

- RICK Histogram Chart: plot a histogram chart using a customized normal distribution
46 changes: 46 additions & 0 deletions sphinx/source/examples/histogram/plot_histogram.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
"""
RICK Histogram Chart
=======================
Example of a histogram chart.
"""
import os
import os.path as osp
import sys
sys.path.append(osp.dirname(osp.dirname(osp.dirname(osp.dirname(osp.dirname(osp.abspath(__file__)))))))

from sqlalchemy import create_engine
import matplotlib.pyplot as plt
import matplotlib as mpl
import pandas as pd
import configparser
from psycopg2 import connect
import psycopg2.sql as pg
import pandas.io.sql as pandasql
import numpy as np
import datetime
import math
import rick
import geopandas as gpd
import os
import shapely
from shapely.geometry import Point
####os.environ["PROJ_LIB"]=r"C:\Users\rliu4\AppData\Local\Continuum\anaconda3\Library\share"
import importlib
import matplotlib.ticker as ticker
import matplotlib.font_manager as font_manager
import numpy as np

################################
#histogram_chart
#--------------------------
#
#This Section uses the histogram_chart function with a customized dataframe.

rng = np.random.default_rng()
numbers = rng.normal(size=10_000)

##plt.hist(numbers)
fig, ax = rick.charts.histogram_chart(numbers, ylab = 'hist', xlab = '', xmin=-3, nbin=100)
fig.tight_layout()
plt.show()

0 comments on commit a25911a

Please sign in to comment.