Giter Club home page Giter Club logo

tikzplotlib's Introduction

tikzplotlib

The artist formerly known as matplotlib2tikz.

PyPi Version Packaging status PyPI pyversions DOI GitHub stars Downloads

Documentation Status awesome

gh-actions codecov LGTM Code style: black

This is tikzplotlib, a Python tool for converting matplotlib figures into PGFPlots (PGF/TikZ) figures like

for native inclusion into LaTeX or ConTeXt documents.

The output of tikzplotlib is in PGFPlots, a TeX library that sits on top of PGF/TikZ and describes graphs in terms of axes, data etc. Consequently, the output of tikzplotlib

  • retains more information,
  • can be more easily understood, and
  • is more easily editable

than raw TikZ output. For example, the matplotlib figure

import matplotlib.pyplot as plt
import numpy as np

plt.style.use("ggplot")

t = np.arange(0.0, 2.0, 0.1)
s = np.sin(2 * np.pi * t)
s2 = np.cos(2 * np.pi * t)
plt.plot(t, s, "o-", lw=4.1)
plt.plot(t, s2, "o-", lw=4.1)
plt.xlabel("time (s)")
plt.ylabel("Voltage (mV)")
plt.title("Simple plot $\\frac{\\alpha}{2}$")
plt.grid(True)

import tikzplotlib

tikzplotlib.save("test.tex")
import matplotlib as mpl

plt.close()
mpl.rcParams.update(mpl.rcParamsDefault)

--> (see above) gives

\begin{tikzpicture}

\definecolor{color0}{rgb}{0.886274509803922,0.290196078431373,0.2}
\definecolor{color1}{rgb}{0.203921568627451,0.541176470588235,0.741176470588235}

\begin{axis}[
axis background/.style={fill=white!89.8039215686275!black},
axis line style={white},
tick align=outside,
tick pos=left,
title={Simple plot \(\displaystyle \frac{\alpha}{2}\)},
x grid style={white},
xlabel={time (s)},
xmajorgrids,
xmin=-0.095, xmax=1.995,
xtick style={color=white!33.3333333333333!black},
y grid style={white},
ylabel={Voltage (mV)},
ymajorgrids,
ymin=-1.1, ymax=1.1,
ytick style={color=white!33.3333333333333!black}
]
\addplot [line width=1.64pt, color0, mark=*, mark size=3, mark options={solid}]
table {%
0 0
0.1 0.587785252292473
% [...]
1.9 -0.587785252292473
};
\addplot [line width=1.64pt, color1, mark=*, mark size=3, mark options={solid}]
table {%
0 1
0.1 0.809016994374947
% [...]
1.9 0.809016994374947
};
\end{axis}

\end{tikzpicture}

(Use get_tikz_code() instead of save() if you want the code as a string.)

Tweaking the plot is straightforward and can be done as part of your TeX work flow. The fantastic PGFPlots manual contains great examples of how to make your plot look even better.

Of course, not all figures produced by matplotlib can be converted without error. Notably, 3D plots don't work.

Installation

tikzplotlib is available from the Python Package Index, so simply do

pip install tikzplotlib

to install.

Usage

  1. Generate your matplotlib plot as usual.

  2. Instead of pyplot.show(), invoke tikzplotlib by

    import tikzplotlib
    
    tikzplotlib.save("mytikz.tex")
    # or
    tikzplotlib.save("mytikz.tex", flavor="context")

    to store the TikZ file as mytikz.tex.

  3. Add the contents of mytikz.tex into your TeX source code. A convenient way of doing so is via

    \input{/path/to/mytikz.tex}

    Also make sure that the packages for PGFPlots and proper Unicode support and are included in the header of your document:

    \usepackage[utf8]{inputenc}
    \usepackage{pgfplots}
    \DeclareUnicodeCharacter{2212}{−}
    \usepgfplotslibrary{groupplots,dateplot}
    \usetikzlibrary{patterns,shapes.arrows}
    \pgfplotsset{compat=newest}

    or:

    \setupcolors[state=start]
    \usemodule[tikz]
    \usemodule[pgfplots]
    \usepgfplotslibrary[groupplots,dateplot]
    \usetikzlibrary[patterns,shapes.arrows]
    \pgfplotsset{compat=newest}
    \unexpanded\def\startgroupplot{\groupplot}
    \unexpanded\def\stopgroupplot{\endgroupplot}

    You can also get the code via:

    import tikzplotlib
    
    tikzplotlib.Flavors.latex.preamble()
    # or
    tikzplotlib.Flavors.context.preamble()
  4. [Optional] Clean up the figure before exporting to tikz using the clean_figure command.

    import matplotlib.pyplot as plt
    import numpy as np
    
    # ... do your plotting
    
    import tikzplotlib
    
    tikzplotlib.clean_figure()
    tikzplotlib.save("test.tex")

    The command will remove points that are outside the axes limits, simplify curves and reduce point density for the specified target resolution.

    The feature originated from the matlab2tikz project and is adapted to matplotlib.

Contributing

If you experience bugs, would like to contribute, have nice examples of what tikzplotlib can do, or if you are just looking for more information, then please visit tikzplotlib's GitHub page.

Testing

tikzplotlib has automatic unit testing to make sure that the software doesn't accidentally get worse over time. In test/, a number of test cases are specified. Those run through tikzplotlib and compare the output with a previously stored reference TeX file.

To run the tests, just check out this repository and type

pytest

License

tikzplotlib is published under the MIT license.

tikzplotlib's People

Contributors

aikhjarto avatar awehrfritz avatar boeddeker avatar cassiersg avatar daniel-edler avatar danielhkl avatar dhoekstra2000 avatar dougnd avatar edmundus avatar eric-wieser avatar flying-sheep avatar foucault avatar frutti93 avatar fsgeek avatar harenbrs avatar hb avatar ldap avatar m-rossi avatar madsadrian avatar maschlr avatar mlq avatar ngc92 avatar nschloe avatar pre-commit-ci[bot] avatar samop avatar satejsoman avatar senselessdev avatar spott avatar therealsupermario avatar thomaswagnerjku avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tikzplotlib's Issues

linewidth does not change

I set my lines.linewidth and axes.linewidth of my plot in matplotlibrc and if I save as PDF it works.
However, if I export the figure with matplotlib2tikz.save, the in the resulting .tex file the line width is always thick.
What am I doing wrong? I am using Matplotlib 1.5 and the example in the readme works.

Segmentation of long data series to smaller, forgotten chunks so as not to exceed pool memory sizes

I have an issue that when I generate tikz files from long data segments, tex complains that it runs short in pool memory. I have found a fix for this which plots the long data segments without limiting the resolution of the data.

If I was plotting some data with, say,10,000 data points, and it breaks the pool size limits with the following:

\addplot [color=black,solid,line width=0.25]
coordinates{ 1...10000 }

I simply break it up to a few smaller chunks and add the "forget plot" parameter to the \addplot command like so:

\addplot [color=black,solid,line width=0.25,forget plot]
coordinates{ 0...2499 }
\addplot [color=black,solid,line width=0.25,forget plot]
coordinates{ 2500...4999}
\addplot [color=black,solid,line width=0.25,forget plot]
coordinates{ 5000..7499. }
\addplot [color=black,solid,line width=0.25]
coordinates{ 7500...9999}

making sure to not forget plot one of them so that the data series can still be added to a legend, if desired. This works fine. It would be great if this could be automatically introduced to your package. Perhaps leaving it as a parameter like so would be an appropriate interface, like so:

tikz_save( fName, maxSeriesLength=2500 )

probably with a pessimistic default parameter (better safe than sorry!). I'm not sure how many data points are realistic to ensure tex won't throw an error, but it shouldn't be hard to find this out. Leaving it as a parameter can allow arbitrary lengths for users with specific memory requirements.

I hope this can be incorporated easily!

Niall

Provide a more recent matplotlib2tikz release

I recently created an ebuild for the Gentoo science overlay to provide an easier way to install matplotlib2tikz. Currently, version 0.1.0 does not has python3 support, whereas 9999 (the default HEAD of the repo) has. Therefore, it is desirable to provide a new release. This would allow usto install a matplotlib2tikz release version, without needing to install the live ebuild, which are hard masked by default.

Loglog plot produces erroneous tex code (pgfplots 1.4)

When using loglog plots with matplot lib matplotlib2tikz produces
\begin{loglog} \end{loglog}
which is invalid (at least with pgfplots 1.4). The correct is \begin{loglogaxis} \end{loglogaxis} (line 218)

(Sorry for opening two tickets at pretty much the same time :/)

Legend title support

So far, mpl2tikz does not support legend titles. Consider this mwe,

import numpy as np 
import matplotlib.pyplot as plt 

plt.plot([1,2], label="foo")
plt.plot([1,3], label="bar")

plt.legend(loc="lower right", title="title")

from matplotlib2tikz import save as tikz_save
tikz_save("legend_title_mwe.tex")

the title is not displayed.
Adding a title to a legend in pgfplots has been discussed here.
Have you encountered this before/found an idea for a workaround?
Thanks, pylipp

EDIT:
A possible way could be to add

title_text = obj.get_title().get_text()
if title_text != "None":
    texts.append('%s' % title_text)

in draw_legend() before querying any other of the object's texts.
Eventually, \addlegendimage{empty legend} has to be added before the first \addplot.

On python 3.5 pip the install fails untill 'image' is installed and pillow upgraded manually.

Before manually installing image:

PS C:\Users\Erwin> pip install matplotlib2tikz
Collecting matplotlib2tikz
  Using cached matplotlib2tikz-0.5.11.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "[.]\pip-build-aqxpc3bp\matplotlib2tikz\setup.py", line 7, in <module>
        from matplotlib2tikz import __version__, __license__, __author__, __email__
      File "[.]\pip-build-aqxpc3bp\matplotlib2tikz\matplotlib2tikz\__init__.py", line 15, in <module>
        from matplotlib2tikz.save import save
      File "[.]\pip-build-aqxpc3bp\matplotlib2tikz\matplotlib2tikz\save.py", line 7, in <module>
        from . import quadmesh as qmsh
      File "[.]\pip-build-aqxpc3bp\matplotlib2tikz\matplotlib2tikz\quadmesh.py", line 5, in <module>
        from PIL import Image
      File "c:\python35\lib\site-packages\PIL\Image.py", line 66, in <module>
        from PIL import _imaging as core
    ImportError: cannot import name '_imaging'

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in [.]\pip-build-aqxpc3bp\matplotlib2tikz\

Then I did pip install image and pip install pillow --upgrade That last one was needed to upgrade pillow to 3.3.1 from 3.1.0

The output afterward:

Collecting matplotlib2tikz
  Using cached matplotlib2tikz-0.5.11.tar.gz
Building wheels for collected packages: matplotlib2tikz
  Running setup.py bdist_wheel for matplotlib2tikz ... done
  Stored in directory: C:\Users\Erwin\AppData\Local\pip\Cache\wheels\59\0d\82\ed1dfcd5f6bfe068bde12b7280872a25c10b0bd0962ec1a682
Successfully built matplotlib2tikz
Installing collected packages: matplotlib2tikz
Successfully installed matplotlib2tikz-0.5.11

It seems like there are some incomplete deps in the package.

Legend colors incorrect with plot.errorbars()

This is caused by the generated TikZ file generating 3 plots for each line with errorbars and the legend then automatically assigns both legend entries the color of the first line.

Solution could be to add forgetplot after the first plot for each line with errorbars, this way only one color per line with errorbars is assigned in the legend.

Alternatively, one could just do addlegendentry with the specified color just after the first addplot.

matplotlib2tikz v0.5.0 missing matplotlib2tikz module

When I try to pip-install matplotlib2tikz, pip complains about the missing matplotlib2tikz module.

$ pip install matplotlib2tikz # used pip3 on my system
Downloading/unpacking matplotlib2tikz
  Downloading matplotlib2tikz-0.5.0.tar.gz
  Running setup.py (path:/tmp/pip_build_root/matplotlib2tikz/setup.py) egg_info for package matplotlib2tikz
    Traceback (most recent call last):
      File "<string>", line 17, in <module>
      File "/tmp/pip_build_root/matplotlib2tikz/setup.py", line 7, in <module>
        from matplotlib2tikz import __version__, __license__, __author__, __email__
    ImportError: No module named 'matplotlib2tikz'
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):

  File "<string>", line 17, in <module>

  File "/tmp/pip_build_root/matplotlib2tikz/setup.py", line 7, in <module>

    from matplotlib2tikz import __version__, __license__, __author__, __email__

ImportError: No module named 'matplotlib2tikz'

The tar seems to be missing the essential module, cf. manual download:

$ ls matplotlib2tikz-0.5.0     
PKG-INFO  setup.py  test

Worked around by pulling from github, which installs perfectly fine.
Kindly let me know if this is not reproducable for you, cheers.

3D plots

Hi,

trying to plot in 3D gives an error:

import numpy as np
import matplotlib.pyplot as plt
import mpl_toolkits.mplot3d
import matplotlib2tikz as tikz
pos = np.zeros((3,10))
pos[0] = np.arange(10)
ax = plt.gca(projection="3d")
ax.scatter(pos[0], pos[1], pos[2], c=np.arange(pos.shape[1]))
tikz.save("pos.tex")

results in

file encoding: UTF-8
Traceback (most recent call last):
  File "makePlots.py", line 128, in <module>
    tikz.save("../thesis/plots/pos1.tex")
  File "/home/per/.miniconda3/lib/python3.5/site-packages/matplotlib2tikz/save.py", line 146, in save
    data, content = _recurse(data, figure)
  File "/home/per/.miniconda3/lib/python3.5/site-packages/matplotlib2tikz/save.py", line 223, in _recurse
    ax = axes.Axes(data, child)
  File "/home/per/.miniconda3/lib/python3.5/site-packages/matplotlib2tikz/axes.py", line 149, in __init__
    assert yaxis_pos == 'right'
AssertionError

Is 3D plotting supported at all, or do I have to venture further? Great work, though, 2D plots are a real treat with this one!

EDIT: Forgot to say using version 0.5.14

Colour selected from array causes matplotlib to fail

Accessing colours stored in array causes matplotlib to fail:

import numpy as np
from matplotlib import cm
import matplotlib.pyplot as plt
from matplotlib2tikz import save as tikz_save


A = cm.jet(np.linspace(0,1,10))
plt.plot([1,2,3],[1,2,3], color = A[9])

tikz_save('test.tikz')

ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

If I force the colour I've taken from the array into a list (i.e. A[9].tolist()) then everything works.

Grid on top of plot

If I activate the grid in matplotlib in an axes, it is drawn on top of e.g. lineplots because of the axis option axis on top.

The example code

import numpy as np
import matplotlib.pyplot as plt
import matplotlib2tikz

x = np.linspace(-1, 1)

plt.plot(x, x**2, linewidth=5)
plt.grid('on')

matplotlib2tikz.save('test.tex')

results in the following image:
test

The axis option axis on top is caused by https://github.com/nschloe/matplotlib2tikz/blob/master/matplotlib2tikz/axes.py#L84. Maybe just the axis and ticks should be on top of lineplots etc.? However I'm not sure how to do this in pgfplots.

Problem with big numbers

I have generated a tikz tex using this repo for this diagram:

import matplotlib.pyplot as plt
import numpy as np
from matplotlib2tikz import save as tikz_save

operations_ray_list = [121, 169, 289, 441, 961, 1681, 3721, 10201, 40401, 90601, 160801]
gpu_raytracing_list = [46, 45.5, 44, 43, 40, 36, 33, 28.4, 26.6, 25, 20.4]

operations_list = [121, 169, 289, 441, 961, 1681, 3721, 10201, 40401]
goldfeather_list = [87, 71.7, 48.3, 34.7, 17.9, 10.8, 5.2, 1.9, 0.4]
scs_list = [64.5, 48, 39.8, 21, 13.2, 6.8, 3.5, 0.9, 0.1]

plt.figure(figsize=(12,9), dpi=300)

raytracing  = plt.plot(operations_ray_list, gpu_raytracing_list, '-g', marker = 'o', label='Ray tracing')
plt.plot(operations_ray_list, gpu_raytracing_list, 'go')
goldfeather = plt.plot(operations_list, goldfeather_list, '-r', marker='s', label='Goldfeather')
plt.plot(operations_list, goldfeather_list, 'rs')
scs         = plt.plot(operations_list, scs_list, '-b', marker='^', label='SCS')
plt.plot(operations_list, scs_list, 'b^')

plt.xlabel('Number of subtraction operations')
plt.ylabel('Frames per second (FPS)')

plt.xscale('log')
plt.legend(bbox_to_anchor=(0.68, 0.98), loc=2, borderaxespad=0.)

plt.grid(True)
plt.savefig("SubtractionEvaluation1.svg", figsize=(12,9), dpi=300)
plt.savefig("SubtractionEvaluation1.png", figsize=(12,9), dpi=300)
tikz_save('SubtractionEvaluation1.tex', figureheight = '\\figureheight', figurewidth = '\\figurewidth');
plt.show()

But when I copy the generated tex file into the code or use it via include, it gives me some errors related to "\end{axis}". My investigations shows that the problem is related to this array:

xtick={10,100,1000,10000,100000,1000000,10000000},

So, if I change it with

xtick={12,3,4,5,6,7},

everything will work fine. The generated latex code is as follows:

% This file was created by matplotlib2tikz v0.5.9.
\begin{tikzpicture}

\begin{axis}[
xlabel={Number of subtraction operations},
ylabel={Frames per second (FPS)},
xmin=100, xmax=1000000,
ymin=0, ymax=250,
xmode=log,
axis on top,
width=\figurewidth,
height=\figureheight,
xtick={10,100,1000,10000,100000,1000000,10000000},
xticklabels={,$\mathdefault{10^{2}}$,$\mathdefault{10^{3}}$,$\mathdefault{10^{4}}$,$\mathdefault{10^{5}}$,$\mathdefault{10^{6}}$,},
xmajorgrids,
ymajorgrids,
legend cell align={left},
legend style={at={(0.03,0.97)}, anchor=north west},
legend entries={{Ray tracing},{Goldfeather},{SCS}}
]
\addplot [green!50.0!black, mark=*, mark size=3, mark options={solid,draw=black}]
table {%
144 57
484 55
2025 52
3025 49
4356 47
5929 46
9801 46
12321 45
17689 42
48841 38
194481 37
436921 36
};
\addplot [green!50.0!black, mark=*, mark size=3, mark options={solid,draw=black}, only marks]
table {%
144 57
484 55
2025 52
3025 49
4356 47
5929 46
9801 46
12321 45
17689 42
48841 38
194481 37
436921 36
};
\addplot [red, mark=square*, mark size=3, mark options={solid,draw=black}]
table {%
144 216
484 67.7
1156 29.6
2025 16.06
3025 11
5929 5.6
7921 4.3
12321 2.8
17689 1.9
};
\addplot [red, mark=square*, mark size=3, mark options={solid,draw=black}, only marks]
table {%
144 216
484 67.7
1156 29.6
2025 16.06
3025 11
5929 5.6
7921 4.3
12321 2.8
17689 1.9
};
\addplot [blue, mark=triangle*, mark size=3, mark options={solid,draw=black}]
table {%
144 142
484 41.7
1156 18.3
2025 10.4
3025 7.5
5929 3.5
7921 2.6
12321 1.7
17689 1.3
};
\addplot [blue, mark=triangle*, mark size=3, mark options={solid,draw=black}, only marks]
table {%
144 142
484 41.7
1156 18.3
2025 10.4
3025 7.5
5929 3.5
7921 2.6
12321 1.7
17689 1.3
};
\path [draw=black, fill opacity=0] (axis cs:100,1)
--(axis cs:1000000,1);

\path [draw=black, fill opacity=0] (axis cs:100,0)
--(axis cs:1000000,0);

\path [draw=black, fill opacity=0] (axis cs:1,0)
--(axis cs:1,250);

\path [draw=black, fill opacity=0] (axis cs:0,0)
--(axis cs:0,250);

\end{axis}

\end{tikzpicture}

Option to silence warnings

save should implement a "silence" mechanic, or move away from using raw print statements, such as the "Warning: Anything else except for explicit positioning is not supported for annotations yet :(" warning in text.py

Colorbar breaks tex import

Having a weird issue with colorbars usage with pyplot.imshow.
Plottng imshow without colorbar exports perfect.
Adding colorbar leads to break due to

  • ! Extra }, or forgotten \endgroup.
    easily fixed by adding endgroup which seems to miss b4 end of tikzfigure
  • ! Package pgf Error: No shape named group c1r-1 is known. (line 283 m marked below)

still looking into it, any ideas yet?

% This file was created by matplotlib2tikz v0.5.11.
\begin{tikzpicture}

\begin{axis}[
title={A first view},
xmin=-0.5, xmax=639.5,
ymin=-0.5, ymax=511.5,
axis on top,
colorbar,
colormap={mymap}{[1pt]
  rgb(0pt)=(0.267004,0.004874,0.329415);
...long color def...
  rgb(255pt)=(0.993248,0.906157,0.143936)
},
point meta min=0,
point meta max=5,
colorbar style={ytick={0,0.625,1.25,1.875,2.5,3.125,3.75,4.375,5},yticklabels={0.0,0.6,1.2,1.9,2.5,3.1,3.8,4.4,5.0}}
]
\addplot graphics [includegraphics cmd=\pgfimage,xmin=-0.5, xmax=639.5, ymin=-0.5, ymax=511.5] {img1.png};
\end{axis}

\nextgroupplot[
ylabel={sc. Ir},
xmin=0, xmax=1,
ymin=0, ymax=1,
axis on top,
axis y line=right,
ytick={0,0.125,0.25,0.375,0.5,0.625,0.75,0.875,1},
yticklabels={0.0,0.6,1.2,1.9,2.5,3.1,3.8,4.4,5.0}
>>>line 283:  ]
\addplot graphics [includegraphics cmd=\pgfimage,xmin=0, xmax=1, ymin=0, ymax=1] {imageTest_img001.png};
\path [draw=black, fill opacity=0] (axis cs:0,0)
--(axis cs:0,0.00390625)
--(axis cs:0,0.99609375)
--(axis cs:0,1)
--(axis cs:1,1)
--(axis cs:1,0.99609375)
--(axis cs:1,0.00390625)
--(axis cs:1,0)
--cycle;

\path [draw=white, fill=white] (axis cs:0,0)
--(axis cs:0,0.00390625)
--(axis cs:0,0.99609375)
--(axis cs:0,1)
--(axis cs:1,1)
--(axis cs:1,0.99609375)
--(axis cs:1,0.00390625)
--(axis cs:1,0)
--cycle;
>>>>inserting \endgroup as a quick fix for error one<<<<<
\end{tikzpicture}

Dual-axis plotting fails

If you make a dual-axis plot (analogous to matlab plotyy), the two separate axes are collapsed onto one another in the final output.

Code:

from matplotlib.pylab import *
import matplotlib2tikz as tt
fig = plt.figure()
ax = fig.add_subplot(111)

dat = linspace(0,10,20)
ax.plot(dat,dat**2)
ax2 = ax.twinx()
ax2.plot(20*dat,20*dat**2)
tt.save('fails.tikz')

Anchors that can be referenced from outside the axis environment

I am using the wrap=False option to embed the graph generated by matplotlib2tikz into a larger tikzpicture environment. I'd like to reference a point in the graph from outside the axis-environment:

\begin{tikzpicture}

\input{generated_file.tikz}

% reference that anchor
\draw (anchor1) -- (3,3.5);

\end{tikzpicture}

generated_file.tikz:

\begin{axis}

% set an anchor in axis coordinates
\node (anchor1) at (axis cs:1,2)  {};

\end{axis}

I imagine this could be achieved by adding some user-defined attributes to matplotlib's axis object, mapping coordinates to anchor names.

Unless you have a better idea, I'll look at implementing this.

matplotlibs polar plot -> pgfplots polaraxis

A matlab/matplotlib polar plot should be converted into a polaraxis object of pgfplots

width, height = matplotlib.rcParams['figure.figsize']
size = min(width, height)
# make a square figure
fig = figure(figsize=(size, size))
ax = fig.add_axes([0.1, 0.1, 0.8, 0.8], polar=True)
dat = np.genfromtxt(fname)
ax.plot(dat[:,0],dat[:,1])

#does not work
tikz_save('myfile.tex' );

colors undefined if save() is called multiple times

After executing the following code, the color definitions are missing in fig2.tikz:

import numpy
from matplotlib import pyplot
from matplotlib2tikz import save
from mpltools import style
style.use('ggplot')

pyplot.figure()
pyplot.plot(numpy.random.rand(10))
pyplot.plot(numpy.random.rand(10))
save('fig1.tikz')

pyplot.figure()
pyplot.plot(numpy.random.rand(10))
pyplot.plot(numpy.random.rand(10))
save('fig2.tikz')

Data not imported to tikz file

Data is not imported to tikz file when this code is implemented:

(code from: http://matplotlib.org/examples/pylab_examples/subplots_demo.html)

import matplotlib.pyplot as plt
import numpy as np
from matplotlib2tikz import save as tikz_save

x = np.linspace(0, 2 * np.pi, 400)
y = np.sin(x ** 2)
f, axarr = plt.subplots(2, sharex=True)
tikz_save( 'sharex.tikz' );
axarr[0].plot(x, y)
axarr[0].set_title('Sharing X axis')
axarr[1].scatter(x, y)
plt.show()

Thank you

fig.suptitle gives faulty output

The .tikz file here: https://gist.github.com/snim2/eec246862c72fdca4391#file-example-tikz was generated with matplotlib2tikz on a Ubuntu 15.04 machine, with LaTeX packages as per the file list below.

Running pdflatex on this LaTeX file based on the example in the manual:

\documentclass[a4paper]{article}
\usepackage{tikz}
\usetikzlibrary{positioning,calc}
\usepackage{pgf}
\usepackage{pgfplots}
\usepgfplotslibrary{groupplots}
\listfiles
\newlength\figureheight{}
\newlength\figurewidth{}
\setlength\figureheight{4cm}
\setlength\figurewidth{6cm}

\begin{document}
My pgf version is: \pgfversion
\input{example.tikz}
\end{document}

the document fails to compile with this error:

! Missing \endcsname inserted.
<to be read again> 
                   \pgfcrdmth@x 
l.8106 \node at (axis cs:0.5,0.98)

Commenting out lines 8106--8111 of the .tikz file results in the PDF here: https://drive.google.com/file/d/0B9T1QPEACWUlSTlJSmRtT0VRYjQ/view?usp=sharing

It looks to me as if matplotlib2tikz should be generating a bit more code to define an axis, or have I missed a pgf library somewhere?

File list

 *File List*
 article.cls    2014/09/29 v1.4h Standard LaTeX document class
  size10.clo    2014/09/29 v1.4h Standard LaTeX file (size option)
    tikz.sty    2013/12/13 v3.0.0 (rcs-revision 1.142)
     pgf.sty    2013/12/18 v3.0.0 (rcs-revision 1.14)
  pgfrcs.sty    2013/12/20 v3.0.0 (rcs-revision 1.28)
everyshi.sty    2001/05/15 v3.00 EveryShipout Package (MS)
  pgfrcs.code.tex
 pgfcore.sty    2010/04/11 v3.0.0 (rcs-revision 1.7)
graphicx.sty    2014/04/25 v1.0g Enhanced LaTeX Graphics (DPC,SPQR)
  keyval.sty    2014/05/08 v1.15 key=value parser (DPC)
graphics.sty    2009/02/05 v1.0o Standard LaTeX Graphics (DPC,SPQR)
    trig.sty    1999/03/16 v1.09 sin cos tan (DPC)
graphics.cfg    2010/04/23 v1.9 graphics configuration of TeX Live
  pdftex.def    2011/05/27 v0.06d Graphics/color for pdfTeX
infwarerr.sty    2010/04/08 v1.3 Providing info/warning/error messages (HO)
 ltxcmds.sty    2011/11/09 v1.22 LaTeX kernel commands for general use (HO)
  pgfsys.sty    2013/11/30 v3.0.0 (rcs-revision 1.47)
  pgfsys.code.tex
pgfsyssoftpath.code.tex    2013/09/09  (rcs-revision 1.9)
pgfsysprotocol.code.tex    2006/10/16  (rcs-revision 1.4)
  xcolor.sty    2007/01/21 v2.11 LaTeX color extensions (UK)
   color.cfg    2007/01/18 v1.5 color configuration of teTeX/TeXLive
 pgfcore.code.tex
pgfcomp-version-0-65.sty    2007/07/03 v3.0.0 (rcs-revision 1.7)
pgfcomp-version-1-18.sty    2007/07/23 v3.0.0 (rcs-revision 1.1)
  pgffor.sty    2013/12/13 v3.0.0 (rcs-revision 1.25)
 pgfkeys.sty    
 pgfkeys.code.tex
 pgfmath.sty    
 pgfmath.code.tex
  pgffor.code.tex
    tikz.code.tex
tkz-euclide.sty    2011/06/01 1.16 c for plots 2d 
tkz-base.sty    2011/06/01 1.16 c tkz-base
    etex.sty    1998/03/26 v2.0 eTeX basic definition package (PEB)
numprint.sty    2012/08/20 v1.39 Print numbers (HH)
   array.sty    2014/10/28 v2.4c Tabular extension package (FMi)
      fp.sty    1995/04/02
defpattern.sty    1994/10/12
fp-basic.sty    1996/05/13
fp-addons.sty    1995/03/15
 fp-snap.sty    1995/04/05
  fp-exp.sty    1995/04/03
fp-trigo.sty    1995/04/14
  fp-pas.sty    1994/08/29
fp-random.sty    1995/02/23
  fp-eqn.sty    1995/04/03
  fp-upn.sty    1996/10/21
 fp-eval.sty    1995/04/03
tkz-tools-utilities.tex
tkz-tools-arith.tex
tkz-tools-base.tex
tkz-tools-misc.tex
tkz-tools-math.tex
tkz-obj-points.tex
tkz-obj-segments.tex
tkz-obj-marks.tex
tkz-tools-intersections.tex
tkz-tools-transformations.tex
tkz-obj-lines.tex
tkz-lib-symbols.tex
tkz-obj-circles.tex
tkz-obj-addpoints.tex
pgfplots.sty    2014/08/04 v1.11 Data Visualization (1.11-3-g4c99d7a)
supp-pdf.mkii
pdftexcmds.sty    2011/11/29 v0.20 Utility functions of pdfTeX for LuaTeX (HO)
ifluatex.sty    2010/03/01 v1.3 Provides the ifluatex switch (HO)
   ifpdf.sty    2011/01/30 v2.3 Provides the ifpdf switch (HO)
epstopdf-base.sty    2010/02/09 v2.5 Base part for package epstopdf
  grfext.sty    2010/08/19 v1.1 Manage graphics extensions (HO)
kvdefinekeys.sty    2011/04/07 v1.3 Define keys (HO)
kvoptions.sty    2011/06/30 v3.11 Key value format for package options (HO)
kvsetkeys.sty    2012/04/25 v1.16 Key value parser (HO)
etexcmds.sty    2011/02/16 v1.5 Avoid name clashes with e-TeX commands (HO)
epstopdf-sys.cfg    2010/07/13 v1.3 Configuration of (r)epstopdf for TeX Live

/cc @vext01

Absolute linewidths

There is a bug in handling absolute linewidths. For example, create a plot like

p.plot(x, np.sin(x), label="line", lw=4)

and save it with matplotlib2tikz.

This line here from matplotlib2tikz.py

addplot_options.append( 'line width=%spt' % 0.4 * line_width )

will set a fixed linewidth of 0.4pt for the plot, repeats the option string n times if line_with is a even number. It should read

"line width=%fpt" % (.4*line_width)

Furthermore, I don't see why there is a factor of 0.4 involved. When I compare the output of a saved pdf and a tikz figure in a latex document, the tikz linewidths are too thin. Matplotlib defines linewidths in pt, so when I omit the 0.4 factor the graphs are consistent.

missing dependency on PIL/Pillow

when installing via pip without installed Pillow library I get the following error:

$ sudo pip3 install matplotlib2tikz
Downloading/unpacking matplotlib2tikz
  Downloading matplotlib2tikz-0.5.12.tar.gz
  Running setup.py (path:/tmp/pip_build_root/matplotlib2tikz/setup.py) egg_info for package matplotlib2tikz
    Traceback (most recent call last):
      File "<string>", line 17, in <module>
      File "/tmp/pip_build_root/matplotlib2tikz/setup.py", line 7, in <module>
        from matplotlib2tikz import __version__, __license__, __author__, __email__
      File "/tmp/pip_build_root/matplotlib2tikz/matplotlib2tikz/__init__.py", line 15, in <module>
        from matplotlib2tikz.save import save
      File "/tmp/pip_build_root/matplotlib2tikz/matplotlib2tikz/save.py", line 6, in <module>
        from . import image as img
      File "/tmp/pip_build_root/matplotlib2tikz/matplotlib2tikz/image.py", line 6, in <module>
        import PIL
    ImportError: No module named 'PIL'
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):

  File "<string>", line 17, in <module>

  File "/tmp/pip_build_root/matplotlib2tikz/setup.py", line 7, in <module>

    from matplotlib2tikz import __version__, __license__, __author__, __email__

  File "/tmp/pip_build_root/matplotlib2tikz/matplotlib2tikz/__init__.py", line 15, in <module>

    from matplotlib2tikz.save import save

  File "/tmp/pip_build_root/matplotlib2tikz/matplotlib2tikz/save.py", line 6, in <module>

    from . import image as img

  File "/tmp/pip_build_root/matplotlib2tikz/matplotlib2tikz/image.py", line 6, in <module>

    import PIL

ImportError: No module named 'PIL'

after installing Pillow manually with sudo pip3 install Pillow the above command succeeds. so I guess matplotlib2tikz should mention Pillow as dependency?

feature request: support 'symlog' xscale

Besides linear and log, matplotlib offers the symlog axis scaling (see docs) which comes in handy for plotting negative and positive data in one plot. The following code shows a symlog figure but fig.tikz has a linear axis scaling.

from matplotlib import pyplot
from matplotlib2tikz import save

pyplot.plot([-1, 1e-3, 1], [1, 1, 1], '.')
pyplot.xscale('symlog', linthreshx=1e-3)
save('fig.tikz')
pyplot.show()

I've no idea in how much work this would result. It seems like there is no direct support for symlog axis scalings in pgfplots...

tex special characters in axis label not properly escaped

When including a tex special character in a plot label, such as in "Reflectance(%)", the % is included verbatim into the generated .tikz file which causes tex to interpret the text after the "%" as a comment.
mathplotlib2TikZ should trap special characters and convert % to %

Weird random paths are drawn after matplotlib save

Consider the following MWE:

import matplotlib.pyplot as plt
import numpy as np
from matplotlib2tikz import save as tikz_save

x = np.linspace(0, 10)
plt.figure(figsize = (4, 2.5))
plt.plot(x, np.sin(x))
plt.savefig('test.pgf', bbox_inches = 'tight')
tikz_save('test.tex')

Inspecting the resulting file test.tex shows stray lines of the form

\path [draw=black, fill opacity=0] (axis cs:1,-1)
--(axis cs:1,1);

When one removes the line plt.savefig('test.pgf', bbox_inches = 'tight') from the MWE,
then these random paths are also gone.
Maybe the check for fill opacity=0 in https://github.com/nschloe/matplotlib2tikz/blob/master/matplotlib2tikz/path.py#L16 can be generalized?

Numbers should be printed in scientific (exponent) notation

Problem:
Numbers are currently printed in the general format %g. As a result very large decimals are printed in the tex file that matplotlib2tikz produces.
(TeXLive 2010, pgfplots 1.4)

Example that exhibits the problem:
from matplotlib.pylab import *
from numpy import *
from matplotlib2tikz import save as tikz_save
x = logspace(0,6,num=5)
loglog(x,x**2)
tikz_save('logparabola.tex',figureheight='0.6\textwidth',figurewidth='0.8\textwidth',strict=True)

This results in a tex files that contains very large decimal coordinates and causes tex to choke with "Number too big" or "Dimension too large" errors.

Proposed (?) solution:
Use %e (eg %.10e ) instead of %.15g when printing ticks or coordinates (quite possibly graphics as well, haven't tested that). For example in revision 55d56869 in _draw_line2d lines 659, 661 and 664 read %.15g. Changing %.15g to %.10e fixes the "Dimension too large" errors Also in _get_ticks line 408 should read %.10e instead of %s for the very same reason.

suggestions for documentation

just place the file matplotlib2tikz.py in the directory where you want to use it and import:
from matplotlib2tikz import save as tikz_save

and then do instead of pyplot.show():
tikz_save( 'export.tikz' )

later in the README:
\newlength\figurewith
should be \newlength\figurewidth
(missing d)

Can't encode u'u\2212'

when using ipython 0.11 on Python 2.7.2 from debian sid, this simple script

from matplotlib2tikz import save as tikz_save
x=linspace(-2,2,100)
plot(x,x**4+x**3+x**2+x)
tikz_save('teste1.tex')```

fails with error:

UnicodeEncodeError                        Traceback (most recent call last)
/home/pmarc/Dropbox/mestrado/script/<ipython-input-5-4951c59800c1> in <module>()
----> 1 tikz_save('teste1.tex')

/usr/local/lib/python2.7/dist-packages/matplotlib2tikz.pyc in save(filepath, figurewidth, figureheight, textsize, tex_relative_path_to_data, strict, draw_rectangles, wrap, extra)
    146         file_handle.write( "\n\n" )
    147 
--> 148     file_handle.write( ''.join(content) )
    149     if wrap:
    150         file_handle.write( "\\end{tikzpicture}" )

UnicodeEncodeError: 'ascii' codec can't encode character u'\u2212' in position 232: ordinal not in range(128)

The LaTeX system is the full instalation of TeXlive. (package texlive-full)

setup.py fails with python3

python3 setup.py install results in a UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe9 in position 44375: invalid continuation byte when compiling matplotlib2tikz.py.

Use of matplotlib's colormap viridis

When I use matplotlibs new colormap viridis and add a colorbar in a figure, matplotlib2tikz returns an AssertionError, because viridis is not an linear-segemented-colormap.

import numpy as np
import matplotlib.pyplot as plt
import matplotlib.cm as cm
import matplotlib2tikz

x, y = np.meshgrid(np.linspace(0, 1), np.linspace(0, 1))
z = x**2 - y**2

plt.pcolormesh(x, y, z, cmap=cm.viridis)
plt.colorbar()

matplotlib2tikz.save('test.tex')

Is it possible to use pgfplots built-in colormap viridis for the colorbar specification with colormap/viridis, point meta min=x and point meta max=y in the axis options or is there a problem with different colormap-calculations/-interpolations?

python3 doesn't need "from itertools import izip"

Running with python3:

Traceback (most recent call last):
File "./myfile.py", line 46, in
from matplotlib2tikz import save as tikz_save
File "/mnt/mob/docs/repo/relk/org/matplotlib2tikz.py", line 30, in
from itertools import izip
ImportError: cannot import name izip

Different file versions

Thank you for your effort. I used both of your tikz conversion scripts (matlab and matplotlib) and they are both very useful.

Just to let you know that version that you have in the 'Download' and in the 'Code' sections are different.
It seems that 'Download' version is much older and actually doesn't work at all as expected.

legend position

Legend positioning, eg via legend(loc='upper left'), is not maintained in the PGF output. The axis options should include something like legend pos=north west.

automatic testing

We should get a little more serious about our unit/capability tests. Right now, you have to compile all figures and manually look at them to see if something is up. A better way may be to store reference outputs and compare them automatically to what mpl2tikz produces. Image diffing may come in handy.

TypeError: not enough arguments for format string on line 1203

This simple example:

fig, ax = subplots()
ax.scatter(linspace(0, 100, 101), linspace(0, 100, 101) + 15 * rand(101))
tikz_save('test.tikz')

Raises this exception:

file encoding: None
Traceback (most recent call last):
  File ".../tikz_test.py", line 9, in <module>
    tikz_save('test.tikz')
  File ".../matplotlib2tikz.py", line 152, in save
    data, content = _handle_children( data, mpl.pyplot.gcf() )
  File ".../matplotlib2tikz.py", line 1520, in _handle_children
    data, cont = _draw_axes( data, child )
  File ".../matplotlib2tikz.py", line 437, in _draw_axes
    data, children_content = _handle_children( data, obj )
  File ".../matplotlib2tikz.py", line 1538, in _handle_children
    data, cont = _draw_pathcollection( data, child )
  File ".../matplotlib2tikz.py", line 1147, in _draw_pathcollection
    draw_options = do
  File ".../matplotlib2tikz.py", line 1203, in _draw_path
    % tuple( vert )
TypeError: not enough arguments for format string

Using today's version of the script and Python 2.7.3

It seems like a bug to me; is it?

matplotlib 'markevery' is not translated into PGFPlots

Plotting dense data with the 'markevery=' should result in plots where not all data points are drawn with a marker, as described in

http://matplotlib.org/api/lines_api.html#matplotlib.lines.Line2D.set_markevery

However, matplotlib2tikz does not regard this. It could be done using the 'mark repeat' option or even 'mark indices' (see PGFPlots manual pp. 179-180)

Minimal example:


import matplotlib.pyplot as pp
import matplotlib2tikz as m2t

pp.plot(range(10), range(10), marker='o', markevery=3)

m2t.save('mark.tikz')

gives the output

% This file was created by matplotlib2tikz v0.5.6.
% The lastest updates can be retrieved from
% 
% https://github.com/nschloe/matplotlib2tikz
% 
% where you can also submit bug reports and leavecomments.
% 
\begin{tikzpicture}

\begin{axis}[
xmin=0, xmax=9,
ymin=0, ymax=9,
axis on top
]
\addplot [blue, mark=*, mark size=3, mark options={draw=black}]
table {%
0 0
1 1
2 2
3 3
4 4
5 5
6 6
7 7
8 8
9 9
};
\end{axis}

\end{tikzpicture}

It should give something like

% This file was created by matplotlib2tikz v0.5.6.
% The lastest updates can be retrieved from
% 
% https://github.com/nschloe/matplotlib2tikz
% 
% where you can also submit bug reports and leavecomments.
% 
\begin{tikzpicture}

\begin{axis}[
xmin=0, xmax=9,
ymin=0, ymax=9,
axis on top
]
\addplot [blue, mark=*, mark size=3, mark repeat=3, mark options={draw=black}]
table {%
0 0
1 1
2 2
3 3
4 4
5 5
6 6
7 7
8 8
9 9
};
\end{axis}

\end{tikzpicture}

0.5.12 breaks with subplots and horizontal colorbar

Since 0.5.12 update multiple subplots break with horizontal colorbar. Aspect ratio of bar getting inverted?

sample code python:

import numpy as np
import matplotlib.pyplot as plt
import matplotlib2tikz

data = np.random.random((512,640))

fig = plt.figure()
ax1 = plt.subplot(121)
ax2 = plt.subplot(122)
ax = [ax1,ax2]

for i,axes in enumerate(ax):
    im = axes.imshow(data)

cax = fig.colorbar(im, ax=ax, orientation='horizontal')

matplotlib2tikz.save('2plots.tex')

produces tex:

% This file was created by matplotlib2tikz v0.5.12.
\begin{tikzpicture}

\begin{groupplot}[group style={group size=2 by 1}]
\nextgroupplot[
xmin=-0.5, xmax=639.5,
ymin=-0.5, ymax=511.5,
axis on top
]
\addplot graphics [includegraphics cmd=\pgfimage,xmin=-0.5, xmax=639.5, ymin=511.5, ymax=-0.5] {img3.png};
\begin{axis}[
xmin=-0.5, xmax=639.5,
ymin=-0.5, ymax=511.5,
axis on top,
colorbar horizontal,
colormap={mymap}{[1pt]
  rgb(0pt)=(0,0,0.5);
  rgb(22pt)=(0,0,1);
  rgb(25pt)=(0,0,1);
  rgb(68pt)=(0,0.86,1);
  rgb(70pt)=(0,0.9,0.967741935483871);
  rgb(75pt)=(0.0806451612903226,1,0.887096774193548);
  rgb(128pt)=(0.935483870967742,1,0.0322580645161291);
  rgb(130pt)=(0.967741935483871,0.962962962962963,0);
  rgb(132pt)=(1,0.925925925925926,0);
  rgb(178pt)=(1,0.0740740740740741,0);
  rgb(182pt)=(0.909090909090909,0,0);
  rgb(200pt)=(0.5,0,0)
},
point meta min=5.50205141325311e-06,
point meta max=0.99999961523477,
colorbar style={xtick={0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9},xticklabels={0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9}}
]
\addplot graphics [includegraphics cmd=\pgfimage,xmin=-0.5, xmax=639.5, ymin=511.5, ymax=-0.5] {img4.png};
\end{axis}

\end{tikzpicture}

with error:
"...nested axis not allowed..."

Marker fill style

Hey,

I noticed that a marker fillstyle of none in matplotlib always translates to the mark option fill=black in pgfplots. This seems to be as easy as attaching fill opacity=0 to the mark_options inside the draw_line2d function.

Regards

Histograms

as far as i can tell, it doesn’t support histograms. it creates the legend and fills the axes correctly but the file is empty apart from that:

counts = defaultdict(list)

#filling counts…

plt.hist(counts.values(), range=(0, 20))
plt.legend(counts.keys())
tikz_save("thms.tikz")

=>

\begin{tikzpicture}

\begin{axis}[
xmin=0.000000e+00, xmax=2.000000e+01,
ymin=0.000000e+00, ymax=3.500000e+04,
legend entries={Caenorhabditis_elegans,Mycoplasma_genitalium,Homo_sapiens,Escherichia_coli}
]
\end{axis}

\end{tikzpicture}

Pandas bar plot only shows axes and ticks

It seems that a basic bar plot by Pandas does not correctly render the bars.

import pandas as pd
import matplotlib.pyplot as plt
from matplotlib2tikz import save as tikzsave

s = pd.Series({'a':3, 'b':5, 'c':2})
s.plot(kind="bar")
tikzsave("testplot.tex")

This generates a tex file with 12 lines of tex (not counting comments).
The 12 lines setup the axes of the plots, and put labels ('a', 'b', and 'c') on the axis. But the actual bars (with values 3, 5, and 2) are not drawn.

Path of markers are dashed/dotted if the line is dashed/dotted

If you try to use markers with dashed or dotted lines, the dashing/dotting will apply to the marker path as well. This is due to the behaviour of PGFPlots. However, the user will never want that, as this is different from what matplotlib creates.

It can be fixed by simply adding solid to the mark options of an \addplot command. It is possible to do it by hand afterwards, but it would be nice if this happened automatically.

Missing brackets in line 654?!

I've tried this script with python3.2 and got syntax error in line 654. What you find there is,

    print "Problem during transformation, continuing with original data"

If I just add the brackets, then the problem is solved:

    print ("Problem during transformation, continuing with original data")

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.