How do I create a second (new) plot, then later plot on the old one?

If you find yourself doing things like this regularly it may be worth investigating the object-oriented interface to matplotlib. In your case: import matplotlib.pyplot as plt import numpy as np x = np.arange(5) y = np.exp(x) fig1, ax1 = plt.subplots() ax1.plot(x, y) ax1.set_title(“Axis 1 title”) ax1.set_xlabel(“X-label for axis 1”) z = np.sin(x) fig2, (ax2, ax3) … Read more

Matlab: How to obtain all the axes handles in a figure handle?

Use FINDALL: allAxesInFigure = findall(figureHandle,’type’,’axes’); If you want to get all axes handles anywhere in Matlab, you could do the following: allAxes = findall(0,’type’,’axes’); EDIT To answer the second part of your question: You can test for whether a list of handles are axes by getting the handles type property: isAxes = strcmp(‘axes’,get(listOfHandles,’type’)); isAxes will … Read more

matplotlib savefig in jpeg format

You can save an image as ‘png’ and use the python imaging library (PIL) to convert this file to ‘jpg’: import Image import matplotlib.pyplot as plt plt.plot(range(10)) plt.savefig(‘testplot.png’) Image.open(‘testplot.png’).save(‘testplot.jpg’,’JPEG’) The original: The JPEG image:

How to change plotly figure size

Have you considered to use fig.update_layout( autosize=False, width=800, height=800,) and eventually reduce the size of your marker? UPDATE Full Code import plotly.graph_objs as go trace1 = go.Scatter( x=x1_tsne, # x-coordinates of trace y=y1_tsne, # y-coordinates of trace mode=”markers +text “, # scatter mode (more in UG section 1) text = label3, opacity = 1, textposition=’top … Read more

Subfigs of a figure on multiple pages

Everything inside \begin{figure}…\end{figure} must not be larger than a single page. In order to break it over pages, you must do it manually. Use \ContinuedFloat from the subfig package to do this: (from the subfig documentation, §2.2.3) \begin{figure} \centering \subfloat[][]{…figure code…}% \qquad \subfloat[][]{…figure code…} \caption{Here are the first two figures of a continued figure.} \label{fig:cont} … Read more