Skip to main content

Plotxel

Control your plots down to the pixel!
Ever have trouble moving a chart to the right? Moving your axis up? Getting rid of ticks? Then try out Plotxel!

It's wordy, slow, and unnecessary 99% of the time. But that 1%, you'll be glad you have Plotxel.

Installation

pip3 install plotxel

Example

Example Image

from plotxel import Plotxel, Axis

x = Plotxel((800, 500))  # our main drawing canvas in x, y

# add some data as a series. The series name, the x data, and y data
series1 = [i for i in range(10)]
x.add_data('series1', series1, series1)
x.add_data('series2', [1, 2, 3, 4, 5], [1, 2, 3, 4, 5])

# left plot -- its name, type, and data it's linked to
plot1 = x.add_drawable("plot1", "Scatter", "series1")
plot1.title = 'Analysis of Goose Encounters'
plot1.pos = [60, 50]
plot1.title_offset = 23

# right plot and its position. Same data as plot1
plot2 = x.add_drawable("plot2", "Scatter", "series1")
# set a bunch of attributes at once!
plot2.setattrs(
    pos=[450, 50],
    marker_shape='square',
    marker_fill_color=(255, 0, 0),
    title='Analysis of Goose Encounters (red)',
    line_width=0
)

# add some axes, and link them to our plots. It will copy the size, position, scale, and limits of whichever plot it is linked to
ax1 = x.add_drawable("ax1", 'YAxis', link_to="plot1")
ax1.axis_offset = 10
ax1.title_offset = 25  # distance from the ticks. Will have an auto feature in the future!
ax1.title = "Near Death Experiences With Geese"

# all other axes, let's put them flush with the graph by changing the default
# defaults are copied at the time the object is initialized, so this won't affect ax1
Axis.defaults['axis_offset'] = -1
ax1b = x.add_drawable('ax1b', 'XAxis', link_to='plot1')

# you can keep setting attributes in bulk
ax1r = x.add_drawable('ax1r', 'YAxis', link_to='plot1', title_offset=20)
ax1r.setattrs(
    side='right',
    title_offset=20,
    title='Ax1 Right Title'
)

ax1t = x.add_drawable('ax1t', 'XAxis', link_to='plot1')
ax1t.setattrs(
    side='top',
    title=''
)

# or use the constructor!
x.add_drawable("ax2", 'YAxis', link_to="plot2", title_offset=20, side='right', axis_offset=10)

ax3 = x.add_drawable("ax3", 'XAxis', link_to="plot2")
ax3.setattrs(
    side='bottom',
    axis_offset=10,
    title="Number of Freaking Geese",
)


# I think I would prefer axes to be blue!
Axis.defaults['color'] = (0, 0, 255)

# let's add some bar chart data. Since it's a vertical bar chart, we will pull Y data
x.add_data('bar_data', ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], [1, 9, 4, 5, 3, 6, 2])

plot3 = x.add_drawable('bar1', 'Bar', 'bar_data')
# or unpack a dict
plot3_attrs = {
    'pos': (150, 300),
    'dim': (500, 150),
    'ylim': [0, 10],
    'title': 'Safely Nagivating Geese'
}
plot3.setattrs(**plot3_attrs)

x.add_drawable('ax4', 'YAxis', link_to="bar1", title='Likelihood of Goose Attack', title_offset=25)
x.add_drawable('ax5', 'XAxis', link_to='bar1', title='Day of Week', title_offset=5)

# coming soon, Jupyter magic!
# x.anti_aliasing=False
x.show()

# or for SVG
# svg_html = x.draw()

# or for image  in BytesIO / save to filename
# x.render(filename='example2.png')


#x.show()

This program is being developed based on my own needs, and unfortunately I don't do a lot of plotting today, therefore I don't need a lot of features.

In any case, I'll be prioritizing features, up next is bar charts and histograms!

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

plotxel-0.0.6.tar.gz (13.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

plotxel-0.0.6-py3-none-any.whl (14.3 kB view details)

Uploaded Python 3

File details

Details for the file plotxel-0.0.6.tar.gz.

File metadata

  • Download URL: plotxel-0.0.6.tar.gz
  • Upload date:
  • Size: 13.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.18.4 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.4

File hashes

Hashes for plotxel-0.0.6.tar.gz
Algorithm Hash digest
SHA256 04f92f745b270702095229f550cafcd2d2538e0df7be534fdf39e37e4778548b
MD5 094459a8057af85df8728eeedba42ccc
BLAKE2b-256 b72bc42f4dd0e8be2b9665cf35a254d01a002694cff9a415f53aba2c256c5e65

See more details on using hashes here.

File details

Details for the file plotxel-0.0.6-py3-none-any.whl.

File metadata

  • Download URL: plotxel-0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 14.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.18.4 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.4

File hashes

Hashes for plotxel-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 49b28daa8c9781585be9fd715617c8b82b0589ec4dd5b19ae2f2f17e07d5f3c2
MD5 6a16781c6ede5b88daa500fa1f587fa9
BLAKE2b-256 039fb141e70eb1af4bcebdaef4297d4c2cec13a6037dcb4f9e044102a1eeafc7

See more details on using hashes here.

Release history Release notifications | RSS feed

0.0.9

2 files

0.0.8

2 files

0.0.7

2 files

This release

0.0.6 This release

2 files

0.0.5

2 files

0.0.4

2 files

0.0.3

2 files

0.0.2

2 files

0.0.1

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page