all I am new to data science and machine learning, and I currently working on an EDA project with NYC yellow taxi datasets. I have a Conda env and am working with Juppyternotebooks. When I use the bellow command I expected a graph to display but only get AxesSubplot:. I am assuming the constriction of the plot happens correctly but I am missing something to display correctly can you please advise. I do have imports for matplotlib, pandas, missingno and some others.
msno.matrix(data_taxi_march)
<AxesSubplot:>
Add ; to end of line or use %matplotlib inline at begging of the cell.
Related
I successfully set up R in my new Atom editor and can get in-line results using the Hydrogen package. I just noticed, however, that when I run lines to obtain "R Documentation" that would pop up automatically in RStudio, Hydrogen only gives me a check mark in-line result with no associated documentation.
Here is what is going on in my Atom editor when I run ?plot
Here is what happens in RStudio (bottom right pane), which I am hoping I can get in Atom
How can I get this working in Atom?
try hydrogen -> Toggle inspector
I had the same question and actually made a little progress. Perhaps someone more experienced than I can use this to make a package to enable an in-atom help documentation panel for us :)
Anyway you can install the atom package 'script' which will properly output some, but not all, help documents. I have an example of one working & one not working.
Working ?read.csv
Not-working ?geom_bar
Background:
I'm new to Octave, as of today.
I am running GNU Octave, version 4.0.2 on Ubuntu 16.04 LTS
I'm using the command-line interface at the terminal (ie, open the terminal and, type "octave").
I'm aware that there is a GUI, but I want to see if I can get this working in the terminal [such a setup is my preference in most applications]
PROBLEM:
Plots are plotted in text. As in:
How can I get a good-looking plot in a plotting window? I genuinely haven't been able to find this information in 10 minutes of Googling...I think it should be easier than that....maybe someday this post will be the easy solution for others.
Best,
-Ryan
I personally do this a lot; it looks like you have it installed in a *nix environment... Octave can produce nice looking figures through cooperation with a couple graphic toolkits, GNUPlot being the one i'm more familiar with.
Check out the documentation at: https://www.gnu.org/software/octave/doc/v4.0.1/Plotting.html
Without seeing your code we're kind of just guessing. I would try something like
figure();
to see if you get a fresh plot window, or try
available_graphics_toolkits()
to ensure that you actually have something installed to generate separate figures.
I ran into a very weird problem: my R code for generating a plot only works if I type it into the console but not when I ran it inside the script (with Ctrl+Enter command)... It's the same problem with all plots (regular plots or ggplots). Also I tried it on two different computers and the same thing happened. Anyone have any idea why this is happening?
One possible reason: I installed the newest version of Rstudio on both computers so it might be an issue with the version. The exact same code worked before on an older version of rstudio...Could this be it? If so, how can I fix it?
I think I figured out what the problem was: the setting in the new version of Rstudio has a default option of outputting the plots inside the Rmarkdown script (at the very end of the script). And that's why I wasn't seeing them. You could change the setting such that it outputs in the console.
Try dev.off() to reset the graphics device.
This helps with a lot of weird graphics behaviour.
Probably too late for the original poster... However, I just ran into the same problem after installing an R update. The way I fixed it was to go to preferences, R markdown, and turn off "show inline output". For me, it was just coming out at the bottom of the chunk instead of in the plot window like I wanted. Hope that helps someone!
I just ran into this problem. I mistakenly put my plot() command inside the r markdown setup chunk. I moved it to its own code chunk and it ran as expected.
I'm using the ZebraDesigner software to create a simple label with a QR Code. It looks good when I print it, but I also need the .prn file with all the information contained inside the QR Code to be "readable". When I open the .prn file with Notepad++, the QR Code line looks like this:
,:::::::::::::::::M07FHFI01FHFC00FFC1FMFC,::::M07C1F07C1FF80H0F801F0K07C,::::O01FKFH03FF0H01F07FHF07C,::::M07FE0F83E007FIF801F07FHF07C,::::M07FHF07FHFH03E0FFC1F07FHF07C,::::M07C00F83E007FIF801F0K07C,::::O01FF80H0HFC1FHFC1FMFC,::::M07C1F0H01FHFC1F07C,::::O01FF801FHFC1F0H01FF83FIFC,::::R07C1FF801FHFC0J01FHFC,::::M07FE0FJFH03E0I01F003E,::::M07C1FF83E007FE0F80I07FE0FFC,::::M07C00FKF83FF07FHF07C0H07C,::::W07FE0FFC,::::M07FMF07C1F07C1FMFC,::::M07C0J01F003FF07C1F0K07C,::::M07C1FHFC1F07C0H07C1F07FHF07C,::::M07C1FHFC1F07FE0FFC1F07FHF07C,::::M07C1FHFC1F0J0F801F07FHF07C,::::M07C0J01F07C0J01F0K07C,::::M07FMF07C0H07C1FMFC,::::,::::^XA
But i want it to be in pure ZPL, just like this one, shown in the The Zebra Programming Guide
:
^FO20,20^BQ,2,10^FDQA,0123456789ABCD
Does anyone know what should I do to generate the file like the one in the documentation or how can I convert it? I've already done a lot of research, but I can't sort it out.
Thanks!
I'm able to reproduce the problem by using a micro QR code.
If that's not mandatory, I suggest you use a "standard" QR code.
I managed to solve this. I reinstalled the printer via ZebraDesigner and changed its port from LPT to USB. Now the .prn file is finally being generated correctly.
It happens when you use different fonts on your label design. If you use Windows fonts, The ZebraDesigner will convert the text into a graphic.
So use Zebra fonts.
I am using Matlab's Mapping Toolbox to create and print a conically projected figure of North America. When I run the code inside the IDE the plots are printed and saved correctly, but when running the same script on the command line using -nodisplay -nodesktop -nosplash I run into a very strange problem.
During the print() function call, Matlab stops running the script without any error, warning, or crash log. Matlab does not actually crash...it just stops executing my code. Printing a figure without a display is suppose to be possible according to this.
Other people have come across a similar issue and have asked about it on the MathWorks website.
Here is some code to reproduce this problem.
So far, no one has come up with a solution. Does anyone have any suggestions? Thanks in advance!
Edit 1:
Here is some self contained code to reproduce the problem. I have tested on both R2011b and R2012a.
figure(1)
axesm eckert4; framem; gridm; axis off; tightmap
load geoid
contourfm(geoid, geoidrefvec, -120:20:100, 'LineStyle', 'none');
coast = load('coast');
geoshow(coast.lat, coast.long, 'Color', 'black')
contourcbar
print('-f1','-dpng','-r200','-painters', 'example');
The following warnings appear if you run MATLAB from scripts using, e.g.,
#!/bin/sh
nohup matlab -nodisplay -nodesktop -r myCode > myLog.log &
exit
.
[Warning: Objects of graph2d.lineseries class exist - not clearing this class or
any of its superclasses]
[Warning: Objects of scribe.legend class exist - not clearing this class or any
of its superclasses]
[Warning: Objects of graphics.panbehavior class exist - not clearing this class
or any of its superclasses]
[Warning: Objects of graphics.zoombehavior class exist - not clearing this class
or any of its superclasses]
[Warning: Objects of graphics.rotate3dbehavior class exist - not clearing this
class or any of its superclasses]
[Warning: Objects of graphics.datacursorbehavior class exist - not clearing this
class or any of its superclasses]
[Warning: Objects of graphics.ploteditbehavior class exist - not clearing this
class or any of its superclasses]
The problem is that the matlab code would like to display a figure, plot or something else, but the option -nodisplay prohibits it. I solved this problem by simply add the following lines to my code set(gcf, 'visible','off'); and at the end close gcf; clear gcf;. Now the plot legend was as in the first plot without shift and I got no warning.
I've come to the conclusion that this problem is not solvable, and is a bug.
The closest I've gotten to solving the problem is using the following code from the shell:
$ matlab -nosplash -nodisplay < makefigure.m
makefigure.m:
plot(randn(100,1));
set(gca,'Units','normalized','Position',[0.13 0.11 0.775 0.815]);
set(gcf,'Units','pixels','Position',[4 4 1200 900]); %# Modify figure size
hgexport(gcf,'myfig.png',...
hgexport('factorystyle'),'Format','png');
Which will output a png file 'myfig.png' of 1200x900 pixels. Unfortunately, while the image is the size I want, the graph itself is still the small size. I'm not certain of the cause of this, but I believe it has something to do with the fact that Matlab is object oriented and that the axes are supposed to be linked to the figure size (that's what the 'Position' variable for gca is normalized to). For whatever reason, this doesn't happen specifically when the display is turned off. I doubt this will be addressed anytime soon by Mathwoks, and I can't blame them since the vast majority of Matlab users use the GUI.
The one potential clue that could help anyone with the means to fix this is that it gives an error when running on the command line:
Warning: Objects of graph2d.lineseries class exist - not clearing this class
or any of its super-classes
I searched for a solution but just found more questions. My suspicion is that if someone can figure out what that means, you can fix this issue. For now, I will once again go back to python because with Matlab I just spend hours dealing with inconveniences instead of being productive.
Edit:
In case it helps, this is Matlab 2012a on
Linux ... 2.6.35.6-45.fc14.x86_64 #1 SMP ... x86_64 x86_64 x86_64 GNU/Linux